0

I can receive emails from gmail, however certain other servers are getting rejected when they try to send emails to my server

Here are the logs when I tried to get authentication from startcom.org as well as some other server attempting to send me something the day before.

Oct 11 05:26:54 snw postfix/smtpd[2342]: connect from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 05:26:55 snw postfix/smtpd[2342]: NOQUEUE: reject: RCPT from 118-161-77-187.dynamic.hinet.net[118.161.77.187]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<159.8.48.206>
Oct 11 05:26:56 snw postfix/smtpd[2342]: lost connection after RCPT from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 05:26:56 snw postfix/smtpd[2342]: disconnect from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 05:30:16 snw postfix/anvil[2344]: statistics: max connection rate 1/60s for (smtp:118.161.77.187) at Oct 11 05:26:54
Oct 11 05:30:16 snw postfix/anvil[2344]: statistics: max connection count 1 for (smtp:118.161.77.187) at Oct 11 05:26:54
Oct 11 05:30:16 snw postfix/anvil[2344]: statistics: max cache size 1 at Oct 11 05:26:54
Oct 11 12:31:05 snw postfix/smtpd[2613]: connect from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 12:31:06 snw postfix/smtpd[2613]: NOQUEUE: reject: RCPT from 118-161-77-187.dynamic.hinet.net[118.161.77.187]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<159.8.48.206>
Oct 11 12:31:07 snw postfix/smtpd[2613]: lost connection after RCPT from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 12:31:07 snw postfix/smtpd[2613]: disconnect from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 12:34:27 snw postfix/anvil[2615]: statistics: max connection rate 1/60s for (smtp:118.161.77.187) at Oct 11 12:31:05
Oct 11 12:34:27 snw postfix/anvil[2615]: statistics: max connection count 1 for (smtp:118.161.77.187) at Oct 11 12:31:05
Oct 11 12:34:27 snw postfix/anvil[2615]: statistics: max cache size 1 at Oct 11 12:31:05
Oct 11 13:45:07 snw dovecot: imap-login: Disconnected (no auth attempts in 1 secs): user=<>, rip=141.212.122.112, lip=159.8.48.206, TLS: Disconnected, session=<pGIDxtch6QCN1Hpw>
Oct 11 23:42:31 snw postfix/smtpd[3020]: connect from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 23:42:32 snw postfix/smtpd[3020]: NOQUEUE: reject: RCPT from 118-161-77-187.dynamic.hinet.net[118.161.77.187]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<159.8.48.206>
Oct 11 23:42:33 snw postfix/smtpd[3020]: lost connection after RCPT from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 23:42:33 snw postfix/smtpd[3020]: disconnect from 118-161-77-187.dynamic.hinet.net[118.161.77.187]
Oct 11 23:45:53 snw postfix/anvil[3022]: statistics: max connection rate 1/60s for (smtp:118.161.77.187) at Oct 11 23:42:31
Oct 11 23:45:53 snw postfix/anvil[3022]: statistics: max connection count 1 for (smtp:118.161.77.187) at Oct 11 23:42:31
Oct 11 23:45:53 snw postfix/anvil[3022]: statistics: max cache size 1 at Oct 11 23:42:31
Oct 12 17:28:53 snw postfix/smtpd[3682]: connect from gateway.startcom.org[212.117.158.94]
Oct 12 17:28:55 snw postfix/smtpd[3682]: 12EE9DA2954: client=gateway.startcom.org[212.117.158.94]
Oct 12 17:28:55 snw postfix/smtpd[3682]: lost connection after RCPT from gateway.startcom.org[212.117.158.94]
Oct 12 17:28:55 snw postfix/smtpd[3682]: disconnect from gateway.startcom.org[212.117.158.94]
Oct 12 17:29:01 snw postfix/smtpd[3682]: connect from apache-7.startcom.org[192.116.242.7]
Oct 12 17:29:01 snw postfix/smtpd[3682]: SSL_accept error from apache-7.startcom.org[192.116.242.7]: -1
Oct 12 17:29:01 snw postfix/smtpd[3682]: warning: TLS library problem: 3682:error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol:s23_srvr.c:647:
Oct 12 17:29:01 snw postfix/smtpd[3682]: lost connection after STARTTLS from apache-7.startcom.org[192.116.242.7]
Oct 12 17:29:01 snw postfix/smtpd[3682]: disconnect from apache-7.startcom.org[192.116.242.7]

Here are the logs when I use gmail to send to my sever

Oct 12 17:58:05 snw postfix/smtpd[3968]: connect from mail-io0-f174.google.com[209.85.223.174]
Oct 12 17:58:05 snw postfix/smtpd[3968]: E3E54DA0A51: client=mail-io0-f174.google.com[209.85.223.174]
Oct 12 17:58:06 snw postfix/cleanup[3977]: E3E54DA0A51: message-id=<CADZik+Vnys--dh_dhOqTSE2ZePWZiBKVp9-EqnYAyJRfk+hQGA@mail.gmail.com>
Oct 12 17:58:06 snw postfix/qmgr[5644]: E3E54DA0A51: from=<[email protected]>, size=1931, nrcpt=1 (queue active)
Oct 12 17:58:06 snw postfix/smtpd[3968]: disconnect from mail-io0-f174.google.com[209.85.223.174]
Oct 12 17:58:06 snw postfix/pipe[3980]: E3E54DA0A51: to=<[email protected]>, relay=dovecot, delay=0.77, delays=0.38/0.1/0/0.29, dsn=2.0.0, status=sent (delivered via dovecot service)
Oct 12 17:58:06 snw postfix/qmgr[5644]: E3E54DA0A51: removed

I use:

  • Roundcube as an IMAP client (probably irrelevant)
  • Dovecot for auth with virtual users on MySQL
  • Postfix as mail software (postconf output here)

I suspect this has something to do with my server being restrictive on SSL/TLS auth, but how do I configure my server so that it will accept almost anything

2 Answers 2

5

The problem is evident in these log lines:

Oct 12 17:29:01 snw postfix/smtpd[3682]: SSL_accept error from apache-7.startcom.org[192.116.242.7]: -1
Oct 12 17:29:01 snw postfix/smtpd[3682]: warning: TLS library problem: 3682:error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol:s23_srvr.c:647:

apache7-startcom.org tries to set up an SSL/TLS connection but fails, probably because it tries to speak an SSL/TLS protocol your server doesn't accept.

You should really post the output of just postconf -n so it shows only the configuration parameters that are different from the defaults. Your postconf output contains too much noise to be really useful.

That said in line 713 of your postconf gist you seem to forbid every TLS protocol except TLSv1.2. This is very restrictive and probably too much for a mail server that should be able to accept incoming mail. I would set the relevant TLS configuration parameters like this:

smtpd_tls_mandatory_protocols=!SSLv2,!SSLv3
smtp_tls_mandatory_protocols=!SSLv2,!SSLv3

That way you disable SSLv2 and SSLv3, both of which are broken and insecure, and leave TLSv1, TLSv1.1 and TLSv1.2 available. Restart Postfix after adding or changing these parameters in /etc/postfix/main.cf.

0

I had this exact same situation with connecting gmail to my postfix server, and the same error message. Turned out that permissions and SELinux context on my certificate & key were incorrect.

In my case, I did an sftp put to get the certs onto the server, then I had copied the entire directory including the certificates to the final location.

restorecon -rv [directory]

to restore the correct SELinux context, if you moved the directory from somewhere else (or with the -Z flag).

Make sure that when you correct the permission and ownership (root:root & 640), that you do it to the entire directory, recursively, not just the files inside the directory.

/etc/postfix/main.cfg (just the relevant part)

smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes

#Do not forget that the directory and contents have to be owned by root
smtpd_tls_cert_file = /etc/letsencrypt/live/mydomain.com-0001/fullchain7.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mydomain.com-0001/privkey7.pem

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .