Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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=<BANLkTina6U==71+ZW-bafMbE6QCHqeYQ4g@mail.gmail.com>
Apr  4 08:49:28 vps-375 postfix/qmgr[15970]: 8062044D1B2F: from=<redacted@gmail.com>, size=1581, nrcpt=1 (queue active)
Apr  4 08:49:29 vps-375 postfix/smtp[16240]: 8062044D1B2F: to=<redacted+domain@gmail.com>, orig_to=<dave@domain.net>, 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?

share|improve this question

2 Answers 2

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

jonathan: jonathanross@gmail.com

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

jonathan: jonathan, jonathanross@gmail.com

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:

me@me.com jonathanross@gmail.com

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

share|improve this answer
    
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 '11 at 18:00
up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.