I have set up an alias in /etc/mail/aliases like this:

user: xxxx@gmail.com

This relay DOES work when I telnet to example.com 25 and send mail to user@example.com (where example.com is my domain); it indeed turns up in xxxx@gmail.com inbox.

Also mail sent from my server at example.com is generally deliverable to this same email address, xxxx@gmail.com.

HOWEVER, the relay DOES NOT work when I send mail from xxxx@gmail.com to user@example.com, expecting it to be relayed back to xxxx@gmail.com.

The mail.log shows it being received and sent just fine, so I guess it is being blocked by gmail for some reason. Why though? As I said, gmail generally does except mail from this server.

  • Not that it helps, but I have noticed that under some circumstances gmail won't deliver mail from itself to itself. For example, if you try to send yourself a gmail invite. – David Mackintosh May 13 '10 at 3:18
  • Thanks, that is probably somehow related. As I note below, the relay does work when the originator is another gmail user, so I am hoping it is just a quirk having to do with sending to oneself and not indicative of something that will cause other problems... – ben May 13 '10 at 18:07

i would check your spam folder in gmail, to be sure it is not going there. if your mail logs show that the message has been sent to gmail, and the gmail server responds with an OK message, then your message should exist somewhere.

otherwise, your mail log should hold some clue as to why it wasn't delivered successfully.

also, watch your mail log when you send locally, to be sure that there isn't something in the logs you're missing (like gmail's OK response) when you send from gmail to your server.

  • I marked your answer as correct because for some reason its not letting me up-vote it. I think David Mackintosh's comment is closer to what is actually going on here... the mail is definitely not turning up in spam; then I had someone else send an email from a gmail account to user@example.com, and it was quickly relayed to my gmail inbox. There is NO discernible difference between the two events in my mail log. At the end of the log entries both say stat=Sent (OK [numbers] [letters and numbers].[numbers]) Weird? – ben May 13 '10 at 18:02
  • in his example of sending a gmail invite to yourself; i have had those invites appear in my spam filter. gmail tends to flag mail from a user, to the same user as possible spam, in my experience. – cpbills May 13 '10 at 18:04
  • weird, yes. but it likely has something to do with gmail's SPF checking mechanism. an email sent from an gmail user will be sent through gmail's servers, and have the proper SPF dns records associated with it. the face that gmail accepts your mail, with no error and does not deliver it, even to spam, is a bit confusing. perhaps gmail is ignoring it, assuming it is a bounced error message from your server. that actually seems pretty likely, now that i consider it. – cpbills May 13 '10 at 18:33
  • you might try using a .procmailrc recipe to alter the subject slightly, and then forward the email for user@example.com to user@gmail.com, even forwarding through .procmailrc might prevent gmail from identifying it as a bounced error. – cpbills May 13 '10 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy