I would like to receive system emails from my home server. So I'm trying to configure postfix to do that through my public server. My public server has a fixed IP, while my home server is in a private network with a messed up hostname due to my router's hostname being included in the hostname, leading to a full hostname "homeserver.blablabla_crappyrouter".
My home server connects to my public server through an OpenVPN tunnel with fixed IP where my home server is a client. From my home server to my public server (and vice-versa) there's a fixed IP, so they can reach each other with no problem through a fixed address. This is a tunnel that gets me to reach my home server from anywhere with no security problems.
My postfix configuration on my public server includes the following:
smtpd_recipient_restrictions = reject_invalid_hostname, reject_unknown_recipient_domain, reject_unauth_destination, reject_rbl_client sbl.spamhaus.org, permit smtpd_helo_restrictions = reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_helo_hostname smtpd_client_restrictions = reject_rbl_client dnsbl.sorbs.net
And on my home server, I added my OpenVPN's public server's IP using
relayhost = [<public server IP through OpenVPN>]
Now this configuration doesn't send emails and gives me the error:
Helo command rejected: Host not found
I researched this, and found that postfix searches for the hostname, but apparently it doesn't find it due to its messed up hostname.
My question: How can I tell my public server's postfix to allow everything from my homeserver blindly?
I did set the option in main.cf
smtpd_helo_required = no
but this didn't help. The following are the /var/log/mail.log entries right after I send a test e-mail:
Sep 2 15:53:53 HomeServer sm-mta: t82Drr6w006677: firstname.lastname@example.org, size=69, class=0, nrcpts=1, msgid=<201509021353.t82Drr6w006677@HomeServer.blablabla_crappyRouter>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1] Sep 2 15:53:53 HomeServer sm-mta: STARTTLS=client, relay=mydomain.com., field=cn_subject, status=failed to extract CN Sep 2 15:53:53 HomeServer sm-mta: STARTTLS=client, relay=mydomain.com., field=cn_issuer, status=failed to extract CN Sep 2 15:53:53 HomeServer sm-mta: STARTTLS=client, relay=mydomain.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256 Sep 2 15:53:53 HomeServer sm-mta: t82Drr6w006677: email@example.com, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120069, relay=mydomain.com. [22.214.171.124], dsn=4.7.1, stat=Deferred: 450 4.7.1 <HomeServer.blablabla_crappyRouter>: Helo command rejected: Host not found
The mail I'm trying to send is:
ehlo localhost mail from: firstname.lastname@example.org rcpt to: email@example.com data Subject: My first mail on Postfix Hi, Are you there? regards, Admin . quit
and I send it using the command:
cat mail.txt | nc localhost 25