Ubuntu server 18.04.6 LTS, with functional postfix/dovecot mailserver.
When using his phone to send mail, user Joe gets the following error :
An error occurred while sending mail. The mail server responded:
4.7.25 Client host rejected: cannot find your hostname, [178.197.200.200].
Please check the message recipient "[email protected]" and try again.
with the following in /var/log/mail.log
Oct 24 08:49:23 vps postfix/submission/smtpd[25163]: connect from unknown[178.197.200.200]
Oct 24 08:49:23 vps postfix/submission/smtpd[25163]: NOQUEUE: reject: RCPT from unknown[178.197.200.200]: 450 4.7.25 Client host rejected: cannot find your hostname, [178.197.200.200]; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[192.168.184.19]>
When he gets home and uses another ISP, the mail is sent without error.
/var/log/mail.log reads as follow :
Oct 24 08:59:21 vps postfix/submission/smtpd[25331]: connect from 84-75-202-59.dclient.hispeed.ch[84.75.202.59]
Oct 24 08:59:22 vps postfix/submission/smtpd[25331]: 386394150E: client=84-75-202-59.dclient.hispeed.ch[84.75.202.59], sasl_method=PLAIN, [email protected]
Oct 24 08:59:22 vps postfix/cleanup[25335]: 386394150E: message-id=<[email protected]>
Oct 24 08:59:22 vps postfix/qmgr[6203]: 386394150E: from=<[email protected]>, size=1105, nrcpt=1 (queue active)
At first I thought that the submission port might be blocked by the ISP, but I don't get why the mailserver would even be reachable in this case.
In /etc/postfix/main.cf I set up the following restrictions :
smtpd_client_restrictions =
permit_mynetworks
reject_unknown_client_hostname
check_client_access hash:/etc/postfix/access_client
smtpd_helo_restrictions =
permit_mynetworks
reject_non_fqdn_helo_hostname
reject_invalid_helo_hostname
check_helo_access hash:/etc/postfix/access_helo
smtpd_sender_restrictions =
permit_mynetworks
reject_unknown_sender_domain
reject_non_fqdn_sender
check_sender_access hash:/etc/postfix/access_sender
smtpd_relay_restrictions =
permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination
I could allow unknown_client_hostname
, but isn't it detrimental to security to let anyone's fridge connect here? Is it ok to remove restrictions for reject_non_fqdn_helo_hostname
and reject_invalid_helo_hostname
to let the user authenticate? This means giving a chance to a bot to try for credentials.
Is there a way to allow the user to send mail without sacrificing on security in this case?