LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SendMail Not Sending, Messages Stuck In Queue As: Deferred: Connection (https://www.linuxquestions.org/questions/linux-software-2/sendmail-not-sending-messages-stuck-in-queue-as-deferred-connection-524708/)

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 mail.fieldtechnologies.com.

Where mail.fieldtechnologies.com 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 mx.east.cox.net.

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 sendmail.cf if you want it to talk to the internet.

JustinK101 02-02-2007 11:56 AM

Ok here is the output:

Code:

    [ Fri Feb 02 - 9:54am - ~ ]                                                                                              BELVEDERE | root -=-> echo hello | sendmail -v root
root... Connecting to [127.0.0.1] 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 [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5
250-DELIVERBY
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 [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection

What do I need to modify in the sendmail.cf 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 "username@doma.in".
What does
Code:

echo "/mx doma.in"|/usr/sbin/sendmail -bt
say?
And
Code:

sendmail -v -qRusername@doma.in
?
If you
Code:

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

fukawi2 02-06-2007 07:49 PM

I was just thinking
Code:

dig mx doma.in
But that's good too :P

JustinK101 02-07-2007 12:23 PM

Code:

echo "/mx doma.in"|/usr/sbin/sendmail -bt
RESULT

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

Code:

sendmail -v -qR myEmail@mydomain.com
RESULT

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

Running /var/spool/mqueue/l17IJQXl027794 (sequence 1 of 1)
<myEmail@myDomain.com>... Connecting to mail.fieldtechnologies.com. via esmtp...

*** WAITED LIKE 1 MINUTE ***

<myEmail@myDomain.com>... Deferred: Connection timed out with mail.fieldtechnologies.com.

Code:

mailq| grep "("
RESULT

[ 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:

Code:

dig mx fieldtechnologies.com
RESULT

BELVEDERE | root -=-> dig mx fieldtechnologies.com

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

;; QUESTION SECTION:
;fieldtechnologies.com. IN A

;; ANSWER SECTION:
fieldtechnologies.com. 80 IN A 65.109.199.138

;; Query time: 14 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; 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 11:56 PM.