-   Linux - Software (
-   -   SendMail Not Sending, Messages Stuck In Queue As: Deferred: Connection (

JustinK101 02-01-2007 11:40 AM

SendMail Not Sending, Messages Stuck In Queue As: Deferred: Connection
Hello, I am running CentOS with the webmin to manage most everything, sendmail is active and running. When I send an email via PHP using the mail() function I can see the message in the webmail queue, but the status of messages are always:

Deferred: Connection timed out with

Where is the domain of the recipient. Any idea how to fix this issue? The messages never get sent, and eventually time out. Thanks for the help.

asommer 02-01-2007 12:08 PM

Ususally when I've seen the Deferred message in the logs it's because the recipient is the one deferring for whatever reason.

Have you tried contacting the recipient and making sure they don't have you blacklisted or anything?

JustinK101 02-01-2007 12:43 PM

No, doesnt seem to be the recipient, I tried a few others on different servers, all do the same thing.

Connection timed out with

Could this be my firewall blocking? I opened up SMTP and POP on the router for the servers ip though.

asommer 02-01-2007 12:45 PM

Possibly, but I'd think that outgoing traffic would be fine. Since you're sending the message via PHP do you need a reverse DNS back to your server?

JustinK101 02-01-2007 12:48 PM

Any way to test SMTP besides php?

Posterboy 02-02-2007 07:23 AM

Try this: echo hello |sendmail -v user@yourbox
That ought to tell you something about local mail, and remember, sendmail will NOT send mail anywhere off the box, by default. Have to change if you want it to talk to the internet.

JustinK101 02-02-2007 11:56 AM

Ok here is the output:


    [ Fri Feb 02 - 9:54am - ~ ]                                                                                              BELVEDERE | root -=-> echo hello | sendmail -v root
root... Connecting to [] via relay...
220 localhost.localdomain ESMTP Sendmail 8.13.1/8.13.1; Fri, 2 Feb 2007 09:54:49 -0800
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost.localdomain [], pleased to meet you
250 HELP
>>> MAIL From:<root@localhost.localdomain> SIZE=6 AUTH=root@localhost.localdomain
250 2.1.0 <root@localhost.localdomain>... Sender ok
>>> RCPT To:<root@localhost.localdomain>
>>> DATA
250 2.1.5 <root@localhost.localdomain>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 l12Hsnic004575 Message accepted for delivery
root... Sent (l12Hsnic004575 Message accepted for delivery)
Closing connection to []
>>> QUIT
221 2.0.0 localhost.localdomain closing connection

What do I need to modify in the to be able to send mail out of the internal network. Also, how I change it from saying localhost.localdomain. Thanks!

fukawi2 02-02-2007 08:04 PM

SendMail is extremely powerful, but also very complicated.

Unless you have a reason for using sendmail other than the fact that it is the default RedHat / Fedora / CentOS MTA, I'd suggest moving to another MTA. I find Postfix much simpler to configure for all my servers, except for my Mail Server, which runs qmail.

Postfix makes it much easier to change the "localhost.localhost" setup, as well as relaying etc...

JustinK101 02-05-2007 12:04 PM

Ok, I think I have sendmail almost all setup though, just a small thing I am sure is not configured correctly. I can send mail successfully inside the network, but outside traffic mail is stuck in the queue.

JustinK101 02-06-2007 07:25 PM

Bump, Anybody?

fukawi2 02-06-2007 07:34 PM

You're over my head now sorry - I'd still suggest moving to Postfix.

Maybe a DNS error? Can you dig MX records for remote sites on your mail server?

unSpawn 02-06-2007 07:47 PM

Example: say you have a message in the queue to user "".
What does

echo "/mx"|/usr/sbin/sendmail -bt

sendmail -v
If you

mailq| grep "("
, do all queued messages show the same error code?

fukawi2 02-06-2007 07:49 PM

I was just thinking

dig mx
But that's good too :P

JustinK101 02-07-2007 12:23 PM


echo "/mx"|/usr/sbin/sendmail -bt

[ Wed Feb 07 - 10:19am - /var/www/html ] BELVEDERE | root -=-> echo "/mx"|/usr/sbin/sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> getmxrr( returns 1 value(s):


sendmail -v -qR

[ Wed Feb 07 - 10:21am - /var/www/html ] BELVEDERE | root -=-> sendmail -v -qR

Running /var/spool/mqueue/l17IJQXl027794 (sequence 1 of 1)
<>... Connecting to via esmtp...


<>... Deferred: Connection timed out with


mailq| grep "("

[ Wed Feb 07 - 10:26am - /var/www/html ] BELVEDERE | root -=-> mailq | grep "("
/var/spool/mqueue (1 request)
(Deferred: Connection timed out with mail.fieldtechnologies.c)

JustinK101 02-07-2007 12:37 PM

In responce to:


dig mx

BELVEDERE | root -=-> dig mx

; <<>> DiG 9.2.4 <<>> mx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54695
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

; IN A


;; Query time: 14 msec
;; WHEN: Wed Feb 7 10:35:54 2007
;; MSG SIZE rcvd: 55

This is the most interesting this proves it is not my firewall, but in fact a setting in sendmail. I am able to ping.

All times are GMT -5. The time now is 04:00 PM.