luth wrote:
Zope needs a From address. I have domain1.com (and others) pointing to my Linode, so that web pages for domain1.com (and others) are served from it. I'm using
contact@domain1.com as the "From" field for the domain1.com site. However, the mails sent from here don't reach their destination.
If I use a different email address from a different domain (which is managed elsewhere), say,
contact@domain2.com, for the "From" field, then the mails Zope sends do reach their destination. I guess that in this case the email address is validated by the mail server "elsewhere". Is my guess correct?
Hmm, do you get bounces for the messages and/or see any errors in your /var/log/mail.log file? If you're dealing with the same destination, it sounds odd that the second domain works but the first doesn't, since if anything else I'd expect checks on the destination side to fail more clearly in the second case. Does your mail from domain1.com fail to all destinations or just some?
Historically, a target server permitted the mail to arrive from anywhere as long as its destined for a locally deliverable user. But with the problems of spam, email relaying, and source address forgeries, servers may apply various techniques to attempt to validate the source of a message. I think all of them are subject to inaccuracy, so I'm not sure how prevalent rejections are (which risk false positives - even Google just adds an SPF header indicating its status, but doesn't actually reject a message if a domain has no SPF information in DNS).
But it's something under the control of the remote server, since it can choose whether to accept the message, so in theory anything can be done. Some mechanisms, like SPF, are controllable by you putting entries into DNS under the domain in question specifying which servers are permitted to generate mail on behalf of that domain.
But the majority of the checks I can think of that might fail for your domain1.com case would also fail for domain2.com since that's not something that maps to your server either.
That includes the possibility of bad luck of having your Linode's public address happen to be on a black list (email servers can subscribe to lists of addresses previously identified as an open relay). But if both of your tests were to the same destination server, then you'd have gotten blocked both times. BTW, you can run a check on your IP address against the major blacklists at
http://www.anti-abuse.org/multi-rbl-check/ and if you happen to have gotten one, I believe Linode will allocate you a new address.
Quote:
So, what should I do so that
contact@domain1.com is considered a valid address and Zope can send emails with it?
It depends on how the remote domain is performing its validation, which hopefully an error response or bounce message might indicate. Even if you don't receive a full bounce message, the status in mail.log (look for the "status=" field at the end of the final delivery log message) ought to have a textual message along with any failure code. Unless the receiving domain accepts the message cleanly, but still later drops it on the floor, which would be annoying.
At a minimum, it wouldn't be a bad idea to ensure that the domain1.com hostname used in the outbound messages have a DNS A record that maps to your Linode. That should help assure a destination server doing checking that the return address represents the actual host sending the message.
Quote:
Here is my guess, please tell me if I am right: I need to create
contact@domain1.com at Google Apps and then go to Linode "DNS Manager" and set some Google's server as the MX server. Right now I have "mail.domain1.com" as the MX server, which I haven't defined anywhere.
The MX records are primarily for inbound service, and it's very common they are are different than servers used for outbound mail. So while not impossible, I'd be surprised if the MX was the problem (providing that the A record is accurate). Of course, it wouldn't hurt to have the MX record refer to a name that can be resolved through DNS.
Quote:
Does this mean that the Postfix solution for outbound mail needs the Google Apps patch?
Not sure what the "patch" is, but no, I believe your outbound solution should be (or certainly can be) independent from how you decide to handle your inbound mail.
-- David