LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail from different virtual hosts on one ip (https://www.linuxquestions.org/questions/linux-server-73/sendmail-from-different-virtual-hosts-on-one-ip-782449/)

swg1cor14 01-15-2010 01:54 PM

Sendmail from different virtual hosts on one ip
 
Ok I have 5 virtual hosts on one IP but only 1 domain (forwardconference.org) will be sending emails out to people....confirmations and such. The other sites may send out some emails...like back to my personal email address not hosted on this server. That works. But to people on like aol or yahoo or hotmail....it doesnt

Problem is, most people are not getting the emails. Mailq reports them being deffered for some reason. I'm having our ISP setup a PTR to forwardconference.org....does this mean all my emails from either of the sites....even if I put a different FROM: address in the php mail script...will come from forwardconference.org? Or should I just setup my server as its own SMTP server?

lukesc 01-15-2010 02:23 PM

If you are literally using sendmail, do yourself a favor and ditch it for postfix or exim. Emails going out from the sendmail binary with "sendmail" appeared to be coming from 127.0.0.1. This caused emails for us to be rejected 75% of the time (php's mail() function uses the sendmail binary). It *may* be fixable by changing some configuration options, but sendmail configuration is like trying to read Chinese. Both postfix and exim have human readable config files, and I found that postfix's configuration file is heavily documented (whereas exim you'll have to look more into documentation).

I've found that Exim is good for sending/receiving as I've used that on a WHM/Cpanel setup (configures everything). Postfix I'm not that familiar with, but it was good enough for me for sending mail out.

Both postfix (at least the Redhat EL5/Cent OS 5 packaged version) and Exim are drop in replacements of sendmail. On Redhat/CentOS you would so something like:

yum install postfix/exim
yum remove sendmail
system-switch-mail (choose postfix/exim)

Then you'd have to configure postfix/exim. They are MUCH easier to understand.

swg1cor14 01-15-2010 02:48 PM

I'm already running postfix....but I get the same problem. The PTR is the only thing that will fix it....Supposedly....but since i can only have 1 PTR per domain and it has to point to one of the domains I use on that server....are ALL my email addresses going to come from the domain I choose to have the PTR relay back?

lukesc 01-15-2010 04:17 PM

The outgoing emails will usually only appear to come from the main ip, not the virtual ips, regardless of what sites you have to the virtual ips. The virtual ips are usually only for inbound connections. Outbound connections usually originate from your main ip.

I would try mxtoolbox.com. They have some very nice tools to make sure everything is setup correctly (dns, reverse dns, mx records, etc..), and to see if you are on any blacklists.

You could also try telneting localhost on port 25 as well as externally to make sure connections can be made. Mxtoolbox will also tell you if you are an open relay or not (if you are you'd need to configure the mail server). If you are an open relay, it's a sure way to get blacklisted, which can be a lengthy process to get off each one if you are.

With the PTR (which I'm assuming is the reverse dns) you only have to set this to your server's host name. Like server.mydomain.com, and do that on every IP you have. You also want to make sure you have an A record for the "server" sub domain that points to your main IP (or what ever hostname you have). You can see your host name by running "hostname" in SSH.


All times are GMT -5. The time now is 08:17 AM.