Best practices for forwarding mail to Gmail
If you're forwarding mail to Gmail, you may want to ensure that mail will be correctly classified by the Gmail spam filter. Check out the sections below for tips on how to optimize Gmail's spam-filtering capabilities.
If you're a mail server administrator:
Ownership and FilteringWe recommend that you do not change the envelope sender when forwarding email to Gmail. Sometimes, when forwarding email, the envelope sender gets changed to your domain. When this happens, Gmail may learn that your domain is sending spam, and will treat other emails from this domain as spam as well. Are you using procmail for forwarding?
Please note that procmail is one of the most common reasons why the envelope sender gets changed when forwarding. Adding the following to your config file will fix this issue:
SENDER=`formail -c -x Return-Path`
SENDMAILFLAGS="-oi -f $SENDER"
Alternatively, changing the envelope sender is ok if you do one of the following:
- Put "SPAM" in the subject
- OR discard any spam emails and not forward them to Gmail at all.
SpamAssassin is a free spam filter that can be used for identifying spam outside of Gmail, and putting "SPAM" in the subject.