Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with sendmail and apache running on different servers

Status
Not open for further replies.

mrjimmbo

IS-IT--Management
Dec 6, 2006
4
AU
Hi all.

I was wondering if anyone has experience with running apach and sendmail on seperate server machines.

I am using PHP's PEAR mail class to send mail to my mail server and then out into the big world. At the moment I and getting an error message (on the test webpage) "unable to connect to smtp server 192.168.0.4:25"

I can ssh into the webserver and from there telnet into the mail server on port 25. Also, the IP of the webserver is in the access file. I recently tried to set up SMTP Auth for sendmail but as far as I can tell that has nothing to do with relaying mail.

Any help would be greatly appreciated.

-James
 
It doesn't say anything about when I've tried to use the PEAR mail package. Only information in it is when I use the PHP mail function on the same server (ie mail server) to send email which works.

This is the last output from that:

Dec 8 08:30:57 server sendmail[14246]: kB7LUu2K014246: from=apache, size=1384, class=0, nrcpts=1, msgid=<200612072130.kB7LUu2K014246@server.meetyouthere.dynalias.com>, relay=apache@localhost
Dec 8 08:30:57 server sendmail[14246]: kB7LUu2K014246: STARTTLS=client, error: connect failed=-1, SSL_error=5, timedout=0, errno=2
Dec 8 08:30:57 server sendmail[14246]: ruleset=tls_server, arg1=SOFTWARE, relay=[127.0.0.1], reject=403 4.7.0 TLS handshake.
Dec 8 08:30:57 server sendmail[14246]: kB7LUu2K014246: to=mrjimmbo@hotmail.com, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=31384, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 403 4.7.0 TLS handshake.
Dec 8 08:30:57 server sendmail[14247]: STARTTLS=server, error: accept failed=0, SSL_error=5, timedout=0, errno=0
Dec 8 08:30:57 server sendmail[14247]: kB7LUvbF014247: server.meetyouthere.dynalias.com [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA


I can post more if you would like. Thankyou very much for taking the time so far!
 
Also I tried it using my ISPs email server only to get the same error message. I can telent into their server as well so I am at an absolute loss. I think it might be a problem with my server setup.
 
My gut reaction is: Drop the ":25" from the IP address. Port 25 is implied when doing smtp connections.

Test to make sure that a firewall or local firewall rules aren't blocking traffic from your server:
Code:
telnet 192.168.0.4 25
You should see a banner that says what mail server it is. Just type "quit" and it will exit.

This probably does not apply to you, but it's here in the interest of completeness. Make sure the sendmail on the server is listening on all interfaces:
Code:
netstat -ltnp | grep :25
It should show a line that looks like this:
Code:
mail ~ # netstat -ltnp | grep :25
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      20381/sendmail: acc
If it says that it's listening on 127.0.0.1, then that's another problem (but you say you get the same results when using your ISP, which leads me to believe your problem is with your php code first).
 
Hi

Thankyou very much for taking the time to respond!

As per my previous posts I am able to telnet into any mail server from behind my firewall and, yeah I've tried netstat -ltnp | grep :25 and it is listening for all IPs.

Oh yeah and with the code, I did remove the port 25 thing, still no work :(

I think you're right with the code issuse though becuae it doesn't even take time to connect it just goes straight to the error page. Probable a config issue

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top