Score:3

sendmail (or postfix) is always failing with Helo command rejected

cn flag

On digitalOcean this tutorial points to installing postfix. I've attempted this and also uninstalling postfix then installing sendmail

When a test mail is sent, invariably there is an error in identifying the sender

 451 4.7.1 <m-dev>:  Helo command rejected: HELO string 'm-dev' does not match last HELO string 'theactual.ws' from this IP *(when testing with sendmail)*

[with postfix it complains about it being sent by no-reply@m-dev...]

The tutorial suggests The System mail name must be the same as the name you assigned to your server. But that is simplistic, and has a high probability of not being respected.

Well, the domain name was not assigned to the server. hostname does return the assigned m-dev name.

How can Ubuntu 20.04 be set-up to use a FQDN that actually points to this server (+ has SPF and DKIM configurations set) ?

When attempting with postfix the postfix -n returns

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = loopback-only
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = localhost.$mydomain, localhost, $myhostname
myhostname = m-dev
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level = may
cn flag
edit completed. ` $ hostname market-dev` is still being returned at the console prompt while `echo "This is the body of the email" | mail -s "This is the subject line" some@addresscom` now hits `mail: cannot send message: Process exited with a non-zero status`
Score:5
cz flag

Other mail servers on the Internet generally expect your server to identify itself using its fully qualified domain name, and for the relevant forward and reverse DNS records to match. This does not require any special Postfix configuration on Linux systems which already have their hostname set to the FQDN, but Debian chose to use only an unqualified hostname (which causes a lot of other issues that have to be worked around, this being one of them).

First, you will need to decide what the fully qualified domain name is for this machine. It must not be a naked domain name. Once you have done that, you need to set the DNS address records for that name to the IPv6 and IPv4 addresses of your system, set the PTR records for those addresses to that FQDN, and finally in Postfix, set myhostname to the FQDN.

Finally, if that mail server has remembered something else as your FQDN, (which itself is quite unusual) you will probably have to wait for it to forget before you are able to send mail to it again.

cn flag
This is exactly what I understood in terms of dynamics. However, what do you mean by 'naked domain name'. I set `myhostname = theactual.ws`. New evolution: `echo "body" | mail -s "subject" [email protected]` logs, has a message-id with the FQDN and delivers. But an app on the VPS (rails) `ActionMailer::Base.mail([...]).deliver_now` feedsback `Delivered mail 61[...][email protected] (4028.0ms)` setting up the message-id similarly. It is not logged, queue is empty and message undelivered.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.