Mail bounces because of missing PTR record.

14 posts / 0 new
Last post
#1 Mon, 08/27/2012 - 15:47
eddieb

Mail bounces because of missing PTR record.

Hello

I think this one is going to require some higher than average willingness to help. I have mydomain.com on IP .198 and alias mydomain.com.br (without apache website enabled) also on .198.

Email from .198 sometimes bounces back due to receiving SMTP complaining that it can't resolve the domain of the sending SMTP (my server).

The interesting part is that none of the IPs on the server have PTR records setup and this is the only IP on the entire machine that has this problem. Also note that the receiving SMTP complains that it can't reverse resolve .195, not .198.

Given that Virtualmin's last update allows for setting the IP it will use to send mail on behalf of a vhost, I think this would come in handy now, but I can't find WHERE in postfix to set this. And to be honest, I dont think it is going to solve the problem since .196 and .197 are similary configured and don't have this problem.

See the returned mail at http://minus.com/lxXHrkYZ1n7b8. The password is "helpme" (didnt want search engines indexing the contents of the returned mail out of respect for our clients).

Thank you,

Eddie

CentOS 6.3 x86_64 Webmin 1.590 Virtualmin 3.94.gpl

Mon, 08/27/2012 - 17:57
Locutus

I think this would come in handy now, but I can't find WHERE in postfix to set this

I'm a little stumped about this, too. So far I had no need for this feature, but I just tried to find where to set and test it.

The "Try it" link in the changelog takes me to the "Email Settings" screen for a domain, but I don't see any new option on that screen.

As for your problem with the "cannot resolve sending address domain": I'm guessing this is not related to missing PTR entries, but the receiving mail server tried to resolve the domain stated in the HELO command, or the domain of the sender email address, to see if it has an MX entry. Maybe THAT one is missing.

Mon, 08/27/2012 - 20:42
eddieb

hmmmm, it's probably the domain stated in the HELO command... how do I change this in Postfix? I think it would be wise to have HELO inform the domain on that IP that WILL have a PTR record (I will be setting these up soon).

for me the "Try it" link in the changelog also takes me to the "Email Settings" screen for a domain... hence the question.

Wed, 08/29/2012 - 14:55
eddieb

how do I change the domain stated in the HELO in Postfix ?

Thanks

Wed, 08/29/2012 - 15:26
andreychek

The hostname seen in Postfix is typically based on either the server's hostname, or the myhostname variable set within Postfix.

Also, in regards to the newest settings in Virtualmin that allow you to tweak what IP address email goes out on, there's some documentation on that here:

http://www.virtualmin.com/documentation/email/dependent

Wed, 08/29/2012 - 17:32
eddieb

I dont have Server Configuration -> Email Settings.

See http://easycaptures.com/fs/uploaded/642/5005469325.png

Maybe because we dont handle mail for ANY users? The only sender on the machine are the web apps...

Thu, 09/06/2012 - 09:10
eddieb

how do I configure it, andrey?

thank you

Thu, 09/06/2012 - 10:17
andreychek

Sorry, right now it's not possible to set this up if the "Mail" feature for your domain isn't enabled.

-Eric

Thu, 09/06/2012 - 12:30
eddieb

Maybe it is the HELO command in Postfix. Is it possible to set a different HELO command for each IP?

Thanks

Fri, 09/07/2012 - 17:15
eddieb

AT LEAST, is it possible to set PostFix to send mail for domainA.com FROM THE IP that corresponds to domainA.com ?

Thanks

Fri, 09/07/2012 - 22:18
andreychek

Maybe it is the HELO command in Postfix. Is it possible to set a different HELO command for each IP?

I don't know how to change the Postfix "HELO" based on what IP address is being connected to.

However, this shouldn't be necessary -- it should be possible to receive mail for any domain on your server regardless of what the HELO is set to. You would just want to make sure your HELO address resolves -- both a normal lookup and a reverse lookup.

AT LEAST, is it possible to set PostFix to send mail for domainA.com FROM THE IP that corresponds to domainA.com ?

All email goes out via the primary IP address (associated with your primary interface, often eth)), unless using the new Virtualmin feature to send out via the IP address associated with a particular domain. But it's only possible to use that feature when the "Mail for Domain" feature is enabled.

-Eric

Sat, 09/08/2012 - 10:41
eddieb

Ok! So I should include in the SPF record for every domain, not matter what IP, a "ptr:DomainThatResolvesToThePrimaryIP.com" and be done with it, correct?

Thanks Eric.

Sat, 09/08/2012 - 23:50
andreychek

Correct, the SPF record should list the primary IP address of the server.

-Eric

Sun, 09/09/2012 - 10:44
eddieb

Thanks Eric!

The only problem left is that emails generated by webapps use an improper sender. The apps use PHPmailer.

I have the "Contact email" for the myvhost.com set to eddie@mycompany.com, but email from myvhost.com gets delivered using "Return-Path: myvhost@subDomainThatResolvesToThePrimaryIP.mycompany.com", which screws things up since undeliverables just sit at the server unread, forever. Also, the spf for myvhost.com includes the IP for subDomainThatResolvesToThePrimaryIP.mycompany.com as an allowed sender, but subDomainThatResolvesToThePrimaryIP.mycompany.com itself does NOT have (and should NOT have) any SPF records (it is just a subdomain used to address the virtual machine itself).

How do I tell PostFix to use the "Contact email" specified in the vhost settings? Or at least use myvhost@myvhost.com ?? Maybe the solution is to have PostFix strip out the Return-Path created by PHPmailer and set it to the "Contact email" for the vhost...

Thanks again

Topic locked