Hi all, Hope someone out there has experience with this. I can send, receive, and smtp my mail with my centos server fine and dandy. All the virtual domains headers for from and reply to and such are good.
However, there is one field that I cannot change. (centos 5.2, dns, sendmail, virtualhosts all on same server)
The ip and hostname of the server is coming up when the ehlo is called from the receiving server (like yahoo.com and gmail)..instantly tagging all mail as spam, but not deleting it.
The header on the mails shows this....
Received: from 45.45.01.01 (EHLO server.myserverhostname.com) (45.45.01.01)
Where it should have the ip address of the website and the website mail.website.com...
I have played with masquerade_envelope, masquerade_as, masquerade_domain, etc...and about 100 different combinations. I have added the websites to etc/hosts in an effort to make that work too.
I am assuming it is masquerade that will do it. But lost as to how to proceed. Is there anyone out there hosting some websites who could point me in the right direction.
All the books and websites deal with multiple machines and masquerading all domains as the same...and not making them all different.
I cannot conclude or solve this. Any help deply appreciated.
Received: from 45.45.01.01 (EHLO server.myserverhostname.com) (45.45.01.01)
Where it should have the ip address of the website and the website mail.website.com...
This line is added by the RECEIVING machine. The IP address is that which connected to the receiving machine. The "ehlo" value reported is that used by the sending machine, and is set by the Dj line in sendmail.cf (confDOMAIN_NAME in sendmail.mc) on the sending machine.
At last a lifeline. That would be the canonical hostname right, the $j?
So would you use masquerade or some kind of local_domain setting to make the receiving client see the proper information in ehlo relating to the domain that sent it? So the server would respond to the request with the proper ip and mailmydomain.com instead of server ip and serverhostname.
Hey...and thanks for any help. This last bit is killing me.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Stephen Harris Sent: Monday, September 22, 2008 8:51 AM To: CentOS mailing list Subject: Re: [CentOS] Sendmail and headers
Received: from 45.45.01.01 (EHLO server.myserverhostname.com) (45.45.01.01)
Where it should have the ip address of the website and the website mail.website.com...
This line is added by the RECEIVING machine. The IP address is that which connected to the receiving machine. The "ehlo" value reported is that used by the sending machine, and is set by the Dj line in sendmail.cf (confDOMAIN_NAME in sendmail.mc) on the sending machine.
--
rgds Stephen _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Mon, Sep 22, 2008 at 08:56:18AM -0400, Bob Hoffman wrote:
At last a lifeline. That would be the canonical hostname right, the $j?
So would you use masquerade or some kind of local_domain setting to make the receiving client see the proper information in ehlo relating to the domain that sent it? So the server would respond to the request with the proper ip and mailmydomain.com instead of server ip and serverhostname.
Hey...and thanks for any help. This last bit is killing me.
The IP address reported is the _actual_ IP address of the machine connecting, not the IP address of the "ehlo" response. You can't masquerade that in sendmail at all.
If you set the canonical name (Dj, confDOMAIN_NAME) then your machine will pretend to be that name for sending/receiving/EHLO etc etc.
So the _hostname_ shown in the EHLO response can be changed, but the IP address can _not_.
The IP address reported is the _actual_ IP address of the machine connecting, not the IP address of the "ehlo" response. You can't masquerade that in sendmail at all.
If you set the canonical name (Dj, confDOMAIN_NAME) then your machine will pretend to be that name for sending/receiving/EHLO etc etc.
So the _hostname_ shown in the EHLO response can be changed, but the IP address can _not_.
(hopefully this is right, text, bottom, cut text)
I am thinking there is no way then, to use virtual domains and have the mail server show up as mail.mydomain.com at all. It will be my hostname I have now and that is it.
I tried resetting the DNS records so the mail servers pointed to the domain on the IP for the hostname, but that did not work, still came up as 'flakey' in the headers and bounced as spam from yahoo and stuff.
Well...at least I can stop dealing with masquerade, that was annoying as heck.
Stephen, thank you for clearing this up a bit. I see the answer to virtualhost mails working correctly are gonna be hard, and obviously in a different direction.
Oh what fun programming is......
The IP address reported is the _actual_ IP address of the machine connecting, not the IP address of the "ehlo" response. You can't masquerade that in sendmail at all.
I am thinking there is no way then, to use virtual domains and have the mail server show up as mail.mydomain.com at all. It will be my hostname I have now and that is it.
If these are virtual machines (uml, xen, vmware, whatever) then the host could do IP NAT so that traffic _looks_ like it's coming from the host (or another of the virtual machines). If they're physically seperate boxes then you need to arrange for a smart-host type setup and have mail forwarding through that.
If these are virtual machines (uml, xen, vmware, whatever) then the host could do IP NAT so that traffic _looks_ like it's coming from the host (or another of the virtual machines). If they're physically seperate boxes then you need to arrange for a smart-host type setup and have mail forwarding through that.
Nope, just one server with some domains. One server with the dns, sendmail and domains all bundled up in a nice pile. I am gonna try to do the different ip listen thing with sendmail since they all have their own ip first...
Gonna sleep now... A long night of getting no where with the sendmail books...well at least the issue is solved finally.. Whew.
Bob Hoffman wrote:
I don't know what you mean by "some domains". How are you implementing the domains?
I have a server. It has centos. I run apache. I have domains on there, websites.. Each is listed in the dns and some are ip based and some name based.
a mail server needs REVERSE DNS that matches its announced name for best results. have all your domains use the same 'real' hostname for the MX record, and whatever IP this server needs to reverse to that same name, or at least a name in the same domain (my server reverses to hogranch.com, and uses mail.hogranch.com as its email MX, this seems acceptable to most... this server delivers mail for several different domains)
on 9-22-2008 7:25 AM Bob Hoffman spake the following:
I don't know what you mean by "some domains". How are you implementing the domains?
I have a server. It has centos. I run apache. I have domains on there, websites.. Each is listed in the dns and some are ip based and some name based.
If you want each server to have different sendmail processes and ip addresses, you need some sort of virtual server setup. Sendmail won't work the same as your apache setup works. The mail goes out over a certain ip address, and the receiving machine sees that address and does a reverse DNS on it.
What you use is not as important. Youi could use zen, vmware, freeVPS, or whatever else is available. http://en.wikipedia.org/wiki/Comparison_of_virtual_machines lists many
on 9-22-2008 7:25 AM Bob Hoffman spake the following:
I don't know what you mean by "some domains". How are you implementing the domains?
I have a server. It has centos. I run apache. I have domains on there, websites.. Each is listed in the dns and some are ip based and some name based.
If you want each server to have different sendmail processes and ip addresses, you need some sort of virtual server setup. Sendmail won't work the same as your apache setup works. The mail goes out over a certain ip address, and the receiving machine sees that address and does a reverse DNS on it.
What you use is not as important. You could use zen, vmware, freeVPS, or whatever else is available. http://en.wikipedia.org/wiki/Comparison_of_virtual_machines lists many
making 'received from ' header work with virtual domains
SOLVED
Brent Bates pointed me in a direction... And with some guess work and some hours (all day) in the books...and trials...this is accomplishable.
All you have to do is add a b modifier to your daemon options and a h modifier to client_options. Then just add mail.mydomain.com for each domain and ip to etc/hosts
Now all header show up correctly.
My earlier mails had a server.creat....com received from...now look at you headers on this mail... It now says mail.bobhoffman.com and the proper ip address.
So... It can be done, easily and simply. Save this mail since it is the only one in existance with the answer
End of this post in the thread will show more specifics. http://www.bobhoffman.com/forums/viewtopic.php?f=4&t=5#p8
Bob Hoffman wrote:
At last a lifeline.
Wow fantastic stuff. You would be a star if you followed some of the tips at http://lists.centos.org/pipermail/centos/2008-September/064533.html particularly bottom posting.
Thanks, Josh.
On Sep 22, 2008, at 5:58 AM, Bob Hoffman wrote:
Received: from 45.45.01.01 (EHLO server.myserverhostname.com) (45.45.01.01)
You should have a PTR record for your IP address that matches the name that the server has configured in the define(`confDOMAIN_NAME', `server.foo.com') line of your .mc file.
Then you should have an A record that resolves the domain name "server.foo.com" to the IP address that your server is connecting with.
Do this and your email will flow much more smoothly.
You should not have to fuss with masquerades just to deliver email for a bunch of Apache virtual host sites.
For extra credit you can configure SPF and Domain Keys, but this can have adverse side effects if the virtual host users are not careful about their email client configuration.
--Chris