Jason T. Slack-Moehrle
2012-Apr-13 04:18 UTC
[CentOS] an assortment of mail serving issues
Hi All, I moved to a new CentOS6 install after an old CentOS5 server started exhibiting problems. I am having mail serving issues and they are confusing. I am seeing both Sendmail and Zimbra issues. We front e-end out operation with a pfSense box and it has the following mail ports open: 25, 465, 587, 110, 143, 993, 995. We have Zimbra and that also requires 7025 and 7071 be open. This sent OS Server has these same ports open and verified by 'system-config-network-tui' 1. We have a few php based sites that utilize code like: $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mail_to = "slackmoehrle at gmail.com"; $mail_subject = "[6Colors] Footage!"; $mail_body = "<html><body><br />"; $mail_body = $mail_body."[6Colors - FOOTAGE]<br /><br />"; $mail_body = $mail_body."Name: ".$vName."<br />"; $mail_body = $mail_body."E-Mail Address: ".$vEmail."<br /><br />"; $mail_body = $mail_body."Comments: ".$vComment."<br />"; $mail_body = $mail_body."------------ END ------------ <br />"; $mail_body = $mail_body."<br /></body></html>"; mail($mail_to, $mail_subject, $mail_body, $headers); This mail is failing to be delivered. 2. We have a database backup script that e-mails a few very small databases every night. #Enter the email address you would like to receive the backup EMAIL="slackmoehrle at gmail.com"; MAIL="/usr/bin/mail"; /usr/bin/uuencode $DUMP$EXT2$EXT4 $DUMP$EXT2$EXT4 |$MAIL -s "Mysql Backup For $DATABASE" $EMAIL ; This mail is failing to be delivered. 3. We have a CMS running that we have tried using SendMail and SMTP by authenticating using Google credentials, following Google instructions and the CMS cannot send outgoing mail as well. 4. Zimbra users can send mail, but replying back doesn't work. They cannot receive e-mails. I thought to check '/var/log/maillog' so I did 'tail maillog' # tail maillog Apr 12 20:43:56 www postfix/lmtp[21788]: connect to thedigiologygroup.org[75.149.56.27]:7025: Connection timed out Apr 12 20:43:56 www postfix/lmtp[21788]: 6AD69198102B: to=<jason at thedigiologygroup.org>, relay=none, delay=21, delays=0.07/0.01/21/0, dsn=4.4.1, status=deferred (connect to thedigiologygroup.org[75.149.56.27]:7025: Connection timed out) Apr 12 20:44:04 www postfix/smtpd[21765]: disconnect from mail-pz0-f51.google.com[209.85.210.51] Here clearly is a connection timeout on port 7025, but I do see that it is open on our pfSense box and the CentOS server experiencing this. So I started checking things like DNS, etc # host thedigiologygroup.org thedigiologygroup.org has address 75.149.56.27 thedigiologygroup.org mail is handled by 0 mail.thedigiologygroup.org. # dig +short thedigiologygroup.org mx 0 mail.thedigiologygroup.org. I had Comcast create Reverse PTR records yesterday for the IP 75.149.56.27 for mail.thedigiologygroup.org and mail.ouremail.us. I use DNSQueries to test this and I found they have a type for the mail.ouremail.us entry, they used .com, so I will call and have them correct it I tried doing an SMTP test on DNSqueries.com and it fails saying: I was NOT able to connect on port 25 to mail.thedigiologygroup.org I dont know if this is trying open relay stuff, so that should fail? I rebooted the server finally and looked at maillog after a reboot and I see: # tail /var/log/maillog Apr 12 21:14:05 www zmmailboxdmgr[5836]: status OK Apr 12 21:14:05 www zmmailboxdmgr[6021]: status requested Apr 12 21:14:05 www zmmailboxdmgr[6021]: status OK Apr 12 21:14:30 www postfix/postqueue[6243]: fatal: Queue report unavailable - mail system is down Apr 12 21:15:00 www postfix/postqueue[6251]: fatal: Queue report unavailable - mail system is down Apr 12 21:15:07 www zmmailboxdmgr[6351]: status requested Apr 12 21:15:07 www zmmailboxdmgr[6351]: status OK Apr 12 21:15:07 www zmmailboxdmgr[6360]: status requested Apr 12 21:15:07 www zmmailboxdmgr[6360]: status OK Apr 12 21:15:30 www postfix/postqueue[6559]: fatal: Queue report unavailable - mail system is down So I am really confused and I was hoping for some advice on sorting this out. -Jason
Jason T. Slack-Moehrle
2012-Apr-13 16:35 UTC
[CentOS] an assortment of mail serving issues - PARTIALLY SOLVED
OK, I solved this, partially. It turns out that this is 'nearly always caused by a host that is configured on private IP Space (or using NAT) and that does not have an interface for the public IP address the server resides on. This can be easily fixed by simply using native IP address lookups for lmtp rather than DNS' so a few Zimbra commands and everything works Zimbra wise. Special thanks to John Stanley for e-mailing me privately about a few things. The remaining issue is that e-mail from our websites isn't working still PHP mail functions dont seem to be getting to us. Items like: $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mail_to = "jason at thedigiologygroup.org"; $mail_subject = "[6Colors] Contact Requested!"; $mail_body = "<html><body><br />"; $mail_body = $mail_body."[6Colors - CONTACT]<br /><br />"; $mail_body = $mail_body."Name: ".$vName."<br />"; $mail_body = $mail_body."E-Mail Address: ".$vEmail."<br /><br />"; $mail_body = $mail_body."Comments: ".$vComment."<br />"; $mail_body = $mail_body."------------ END ------------ <br />"; $mail_body = $mail_body."<br /></body></html>"; mail($mail_to, $mail_subject, $mail_body, $headers); I tried a test message from the website and then looked at `/var/log/maillog' and I dont see anything. Any thoughts? -Jason