5

I have a VPS with Postfix. E-mail is working - I can send messages to and from it, tested using mutt and my GMail account.

However, I want to forward all mails send to my VPS to my GMail account so it's all in one place.

I tried specifying my gmail address in my .forward, but after doing so, e-mails just get lost completely. They don't show up in mutt, and they don't show up in GMail.

mail.log suggest that the e-mail was sent on, and there are no errors that I can see in mail.err. From my perspective it looks as if GMail is just receiving the e-mail and discarding it, but that can't be right!

Addendum: Specifying my forwarding e-mail address in /etc/postfix/virtual leads to the same result:

Apr  4 08:49:28 vps-375 postfix/smtpd[16235]: 8062044D1B2F: client=mail-qw0-f48.google.com[209.85.216.48]
Apr  4 08:49:28 vps-375 postfix/cleanup[16239]: 8062044D1B2F: message-id=<[email protected]>
Apr  4 08:49:28 vps-375 postfix/qmgr[15970]: 8062044D1B2F: from=<[email protected]>, size=1581, nrcpt=1 (queue active)
Apr  4 08:49:29 vps-375 postfix/smtp[16240]: 8062044D1B2F: to=<[email protected]>, orig_to=<[email protected]>, relay=gmail-smtp-in.l.google.com[209.85.143.27]:25, delay=1.3, delays=0.41/0.02/0.36/0.52, dsn=2.0.0, status=sent (250 2.0.0 OK 1301903372 m53si9513199wej.191)
Apr  4 08:49:29 vps-375 postfix/qmgr[15970]: 8062044D1B2F: removed

Any suggestions?

2 Answers 2

6

It turns out the problem here was GMail not showing e-mails forwarded back to it. Sending an e-mail from other addresses were correctly forwarded. GMail seems to discard the messages that are forwarded back to it.

1
  • This was my problem to! You can send your self an email from here using a service
    – Rick
    Jun 4, 2015 at 20:17
5

For simplicity append `/etc/aliases' with an entry like this will which will duplicate all mail to a user:

jonathan: [email protected]

This is slightly different and will also copy it to the local user's Maildir/box:

jonathan: jonathan, [email protected]

You get the idea. Follow that with newaliases to build a .db version of that file.

AFAIK this is needed in main.cf for that method:

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

If that doesn't work for whatever platform reason then a virtual_alias_domains = me.com entry in main.cf, another line in main.cf as virtual_alias_maps = hash:/etc/postfix/virtual and a flat file in this format in /etc/postfix will do it:

[email protected] [email protected]

followed by postmap /etc/postfix/virtual should do it.

1
  • This led to the same outcome as in my question - mail.log showed an e-mail being sent, but it was never recieved in my GMail account.
    – Dave
    Apr 4, 2011 at 18:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .