Skip to main content

Sendmail "Message accepted for delivery" but doesn't make it "Deferred: Connecti [Resolved]

I'm trying to get sendmail working. Sending an email to myself, it appears the email is delivered...

May 24 06:55:13 texascoders sendmail[29544]: x4O6tDOL029544: to=, ctladdr=root@texascoders.com (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30113, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (x4O6tDVt029545 Message accepted for delivery)

But a few minutes later I get errors like this:

May 24 07:27:47 texascoders sm-mta[30712]: x4O74rBD029756: to=, ctladdr= (0/0), delay=00:22:53, xdelay=00:04:21, mailer=esmtp, pri=210301, relay=mail.protonmail.ch. [185.70.40.103], dsn=4.0.0, stat=Deferred: Connection timed out with mail.protonmail.ch.

I'm using Debian 9 on a VPS. So far:

  • I set my hostname with hostnamectl
  • changed /etc/hosts (not sure if that helped)
  • Added SPF record
  • Added DKIM record

Solved: It was the ISP. I didn't think of this at first because I have multiple providers and the one I usually use doesn't block port 25. I opened a ticket and now just waiting to reboot. "We have removed the default SMTP block on your account."


Question Credit: PJ Brunet
Question Reference
Asked May 24, 2019
Posted Under: Unix Linux
6 views
2 Answers

Are you SURE your outgoing SMTP connections are not firewalled out (by your ISP)?

Does the command below get SMTP greeting messages (after a few seconds)?
[ Is it sendmail's fault?]

telnet mail.protonmail.ch. 25


credit: AnFi
Answered May 24, 2019

Your first message only indicates your local sendmail MTA accepting the message for local processing. The second message is about failing to connect to mail.protonmail.ch which is the server indicated by the primary MX record for protonmail.com. That would be the next hop on the mail's path to the destination.

Your VPS provider might be required by local regulating authorities to restrict outgoing unauthenticated SMTP connections in port 25 to the VPS provider's local SMTP servers only, to make sure spammers and email-sending malware can be detected and their traffic stopped as near the source as possible.

In that case, you might have to specify the appropriate outgoing email server as your "smarthost" through which all outgoing email will be sent. This can be done by putting something like this in your /etc/mail/sendmail.mc:

define(`SMART_HOST',`smtp.example.com')

and then regenerating your sendmail.cf (often with cd /etc/mail; make).

You should also be aware of a thing called greylisting: mail servers may, when receiving a connection from a previously unknown source, initially reject the connection/message but remember the IP address it was coming from. A legitimate mail server will try again a few minutes later and will then be accepted; a spammer/malware might just skip to an easier target. After submitting a few valid mail messages in this delayed way, the remote mail server may omit the delay mechanism.


credit: telcoM
Answered May 24, 2019
Your Answer
D:\Adnan\Candoerz\CandoProject\vQA