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

I'm trying to host my own email forwarding for my domain on a small VPS but am having some odd problems getting forwarding to work. I am using exim4 on Ubuntu 12.04.1 LTS and all of my packages are up to date. My setup is such that any email that comes in to a local user (user@mydomain.com) gets forwarded to user@gmail.com. I also have SMTP setup so that I can send through my own server from Gmail. The forwarding is set up through my /etc/aliases where I simply have

user:        user@gmail.com

I am able to send from my VPS to user@mydomain.com (using mail -s "subject" user@mydomain.com) and I receive the mail in my Gmail inbox. I am able to send from my VPS to user@gmail.com (using mail -s "subject" user@gmail.com) and I receive the mail in my Gmail inbox.

When I try to send from Gmail (or any other address) to user@mydomain.com I can see the message arrive in the logs and exim attempts to send it out, but the email does not show up in the local mailbox (check with the mail command) and it does not get forwarded to Gmail. The exim logs show this:

2013-02-12 19:27:56 1U5QCZ-0002bt-VA DKIM: d=gmail.com s=20120113 c=relaxed/relaxed a=rsa-sha256 [verification succeeded]
2013-02-12 19:27:56 1U5QCZ-0002bt-VA <= user@gmail.comH=mail-qe0-f53.google.com [209.85.128.53] P=esmtps X=TLS1.0:RSA_ARCFOUR_SHA1:16 S=1736 id=CABfo9zkf+wF3TcniU4VjcCTLDnR2NtY2JsFa2YQrMJqmWYKnHw@mail.gmail.com
2013-02-12 19:29:02 1U5QCZ-0002bt-VA gmail-smtp-in.l.google.com [2607:f8b0:4001:c02::1b] Connection timed out
2013-02-12 19:29:05 1U5QCZ-0002bt-VA => user@gmail.com <user@mydomain.com> R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [74.125.142.27] X=TLS1.0:RSA_ARCFOUR_SHA1:16 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"
2013-02-12 19:29:05 1U5QCZ-0002bt-VA Completed

Even the Send Mail As verification email to user@mydomain.com gets forwarded to my Gmail account!

I've checked exim -bp to see if there is anything in the queue but it seems to be empty. I've also done a traceroute on the specified gmail domain and it seems to complete fine. I've seen similar issues posted before, however, all the ones I've read have been all or nothing cases where nothing gets forwarded through, not selectively like this.

Does anyone have any suggestions or recommendations on how I could fix / further debug this problem? Thanks!

share|improve this question
    
Have you checked your spam filter? It's quite possible that google might be filtering the emails. Lastly do you have SPF records for your domain? –  Danie Feb 13 '13 at 5:43
    
I have checked my spam folder and it seems to be clear, so I don't think that is a a problem. I will try getting an SPF record for my domain and see if that fixes the problem. –  nhmood Feb 13 '13 at 15:06

1 Answer 1

It turns out that this is actually an issue (feature?) on Google's end. If you send email from an address that automatically forwards back to you (eg. user@mydomain.com -> user@gmail.com) it will NOT appear in your inbox and only appear in your Sent Mail folder.

This is apparently to prevent multiples of the same message appearing in your inbox (ie. if you are subscribed to a mailing list and send mail to it, you don't want to have your own response in your inbox). They seem to have made this the default on any emails that automatically forward back to keep things consistent.

Reference: http://productforums.google.com/d/msg/gmail/npFUvcOUVPo/4ViZhQNdxfIJ

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.