Score:0

Postfix: Rewrite header FROM sender based on sasl login username

cn flag

Lets say I got a sasl login user called myloginuser. The user owns the domain: example.org and has set up following email address: [email protected]

myloginuser is authenticated and wants to send an email.

His mail client is misconfigured and sets From: Sid Sample <[email protected]>

I want postfix to rewrite header to From: [email protected] <[email protected]> as a fallback in case the client attempts to send mail from an email he does not own.

Failed solution 1:

smtpd_sender_login_maps = hash:/etc/postfix/login_map
smtpd_sender_restrictions = reject_sender_login_mismatch

I could use this. Problem the mail gets rejected instead of just rewritten header from part.

Failed solution 2:

header_checks = pcre:/etc/postfix/replace_from.header_check

Cannot use this since the username myloginuser is not matching the email [email protected].

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.