Score:1

FROM address for system emails on Linux (Postfix)

cn flag

I have an unbuntu server using sendmail and postfix to send apticron, cron etc emails.

postfix is configured to use a smart relay, the smart relay is rejecting emails as they come from the subdomain of the server rather than the domain.

So, I have a server called backup on mydomain.com emails were set with a From: header of backup.mydomain.com and our relay is only configured to allow emails from mydomain.com. I don't want to change this.

So in postfix's main.cf I added masquerade_domains for mydomain.com, which if I'd read the [docs][1] right would mean that backup would be stripped out of the from to result in emails From: [email protected] coming as From: [email protected]

However, I am now getting emails From: root@backup

main.cf

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = backup.mydomain.com
masquerade_domains = mydomain.com
mydomain = mydomain.com
myorigin = $mydomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, backup.mydomain.com, backup, localhost.localdomain, localhost

Suggestions appreciated. I've seen various other posts with complex changes to sendmail and other solutions, but, they don't seem right as I'm just trying to get the email to be from [email protected] for a named server in the domain, which I understand to be a postfix concern and masquerade_domains seems to be the documented solution. [1]: http://www.postfix.org/postconf.5.html#masquerade_domains

I sit in a Tesla and translated this thread with Ai:

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.