postfix forwarding issue

I have setup a postfix server and set the MX record, SPF, and DKIM up to attempt to have a virtual mail forwarder. (for instance should forward to All appears well in the logs but gmail can only receive mail sent with sendmail from the console, but not when forwarded by the virtual rules.

This works:

sendmail Test ctrl-d

and results in a mail.log of:

Dec 29 15:55:19 www postfix/pickup[27575]: D6D3BE19EC: uid=0 from=<root> Dec 29 15:55:19 www postfix/cleanup[27580]: D6D3BE19EC: Dec 29 15:55:19 www postfix/qmgr[27576]: D6D3BE19EC:, size=290, nrcpt=1 (queue active) Dec 29 15:55:21 www postfix/smtp[27582]: D6D3BE19EC:,,[]:25, delay=3.6, delays=2.2/0/0.51/0.88, dsn=2.0.0, status=sent (250 2.0.0 OK 1388350521 t39si43670816yhp.150 - gsmtp) Dec 29 15:55:21 www postfix/qmgr[27576]: D6D3BE19EC: removed

and a e-mail on gmail with the following header:

Delivered-To: Received: by with SMTP id oa6csp248797lbc; Sun, 29 Dec 2013 12:55:21 -0800 (PST) X-Received: by with SMTP id g29mr42719681yhg.17.1388350521272; Sun, 29 Dec 2013 12:55:21 -0800 (PST) Return-Path: Received: from ( [x.x.x.x]) by with ESMTP id t39si43670816yhp.150.2013. for; Sun, 29 Dec 2013 12:55:20 -0800 (PST) Received-SPF: pass ( domain of designates x.x.x.x as permitted sender) client-ip=x.x.x.x; Authentication-Results:; spf=pass ( domain of designates x.x.x.x as permitted sender); dkim=pass (test mode) Received: by (Postfix, from userid 0) id D6D3BE19EC; Sun, 29 Dec 2013 15:55:19 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=mail; t=1388350519; bh=g3zLYH4xKxcPrHOD18z9YfpQcnk/GaJedfustWU5uGs=; h=Date:From:From; b=HuJJBtPKQsF5VTwRWR7fhviOHX2gYlmqzK1P+kybHDEiFkWiFg1UfUGZX/LPprRO1 zlzupc4Hizp/7jPcqTcagkm0R+3NhKVR2n7xNDG4c7JO0V7EiW4CF0x689NzizwsSY IyrLprJu5PAlL6f7KXm0HScfi4l8pdrVkVEBMEpA= Message-Id: Date: Sun, 29 Dec 2013 15:55:17 -0500 (EST) From: (root)


When I send an e-mail to from gmail the following log results but no e-mail arrives in my gmail box or spam box:

Dec 29 15:57:46 www postfix/smtpd[27586]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled Dec 29 15:57:46 www postfix/smtpd[27586]: connect from[] Dec 29 15:57:47 www postfix/smtpd[27586]: 25F9FE19EA:[] Dec 29 15:57:47 www postfix/cleanup[27590]: 25F9FE19EA: Dec 29 15:57:47 www postfix/qmgr[27576]: 25F9FE19EA:, size=1747, nrcpt=1 (queue active) Dec 29 15:57:47 www postfix/smtpd[27586]: disconnect from[] Dec 29 15:57:48 www postfix/smtp[27591]: 25F9FE19EA:,,[]:25, delay=1.5, delays=0.54/0/0.39/0.58, dsn=2.0.0, status=sent (250 2.0.0 OK 1388350668 v3si43678694yhd.138 - gsmtp) Dec 29 15:57:48 www postfix/qmgr[27576]: 25F9FE19EA: removed

The postfix/smtp is identical to the one that delivers properly from sendmail.

Closest question I’ve found is: But DKIM and SPF does not appear to be the problem based on the full header result show a spf=pass and dkim=pass.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Okay I think the issue is a gmail only silliness that organizes the email by the “Message-ID” field. So when it gets the e-mail forwarded back it just leaves the sent version and never delivers it to the inbox. <br> <br>To avoid this you have to add the account into gmail as an alias. (and not check not an alias)

Thanks a lot! I had the same problem and it was very frustrating.

Okay so I finally setup an e-mail account other than gmail and tried forwarding mail there and it works fine. I guess it must be something gmail specific. (Still don’t know what)