PDA

View Full Version : sendmail says Deferred: Connection refused by serverhostname



Fli
08-31-2015, 11:43 PM
In the /var/log/maillog i found many lines:


Aug 31 22:30:01 anonymized sendmail[229580]: t7VMU1mV229580: Authentication-Warning: fqdn.hostname.tld: nobody set sender to root using -f
Aug 31 22:30:01 anonymized sendmail[229580]: t7VMU1mV229580: from=root, size=634, class=0, nrcpts=1, msgid=<[email protected]>, relay=nobody@localhost
Aug 31 22:30:02 anonymized sendmail[230186]: t7VMU1O3230186: from=<[email protected]>, size=980, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Aug 31 22:30:03 anonymized sendmail[229580]: t7VMU1mV229580: to=root, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30634, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (t7VMU1O3230186 Message accepted for delivery)
Aug 31 22:30:03 anonymized sendmail[230440]: t7VMU1O3230186: to=<[email protected]>, delay=00:00:02, xdelay=00:00:00, mailer=esmtp, pri=120980, relay=fqdn.hostname.tld. [serveriphere], dsn=4.0.0, stat=Deferred: Connection refused by fqdn.hostname.tld.


it was fixed by editting file /etc/mail/sendmail.cf

Find: "# SMTP daemon options"

and below that line i had in that section this line:

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

after i added this line after it:

O DaemonPortOptions=Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1

it started working (errors no longer appear) and i started receiving mails sent from the server. no need to restart anything.

I tried to remove deferred emails by command: postsuper -d ALL deferred;postsuper -d ALL defer
but command mailq still lists many emails and last line is: "Total requests: 4732"

so not sure how to remove old emails, i listen direct deleting from postfix folders is dangerous