Forward Mails to Gmail

emailemail-servergmailpostfixspf

I have a postfix mailserver running. Mails sent from users to Gmail are showing up in Gmail, so it works in general. Same for all other freemail hosts I know.

The problem is that some users have no local mailbox but a forwarding to Gmail. If someone sends a mail to such a user my mail server forwards the mail to Gmail. This works, even if the original domain has a SPF record with "-all". But if a Gmail users sends a mail to my server which is then forwarded to Gmail again the mail never shows up in Gmail.

I already tried:
– Check the logs. Gmail SMTP just reports "OK" but the mail seems to get discarded in a later step.
– Enable SRS. Still no mail in Gmail

Anyone out there who has a running setup able to forward mails from Gmail to Gmail? Is there something I am missing that's causing Google to classify my mail as spam so badly that it doesn't even go to the Spam folder?

Best Answer

Are you sending email back to the same gmail account that you are posting the email from?

If a message goes from abc@gmail.com to def.whatever and then back to abc@gmail.com, gmail will not put the message in the inbox. https://support.google.com/mail/answer/6588?hl=en You can change this behavior by specifying the def@whatever as an alternate email address alias in your account options.

This troubleshooter might help you as well.
https://support.google.com/mail/troubleshooter/2935079?hl=en

Before you do all of this though, check your postfix logs at /var/log/maillog and make sure you are getting a positive response from gmail. Something similar to

status=sent (250 2.0.0 OK 1404098487 fv4si21511978pbb.224 - gsmtp)

If you're getting something else, ie:

status=SOFTBOUNCE (host gmail-smtp-in.l.google.com[74.125.25.27] said: 550-5.7.1 [107.161.16.11      12] Our system has detected that this message is 550-5.7.1 likely unsolicited mail.

Well, then, you know the problem.