* Dan Raymond via Postfix-users:
> Thank you postfix--- and Ralph for showing me options for working around
> the defect.
While sendmail does not behave how you apparently expect it to behave,
that does not constitute a defect. The command runs in the calling
user's process context, and somehing like "sudo sendmail -f john ..."
only overrides the sender envelope address, as documented. It still runs
as root. The From-header is part of the /content/ and quite a different
beast.
As was suggested, generating headers and body yourself are your best bet
if you want full control. You can use Postfix's rewrite mechanisms as
well, but a generator script is typically the easier option.
#!/usr/bin/env bash
# /usr/local/bin/gm.sh
gen_mail() {
cat <<EOT
From: John the Tosser <[email protected]>
To: Joe Random User <[email protected]>
Subject: Envelope and content are different things
Message body goes here...
EOT
}
gen_mail | sendmail -t
# End of script
No matter which user invokes /usr/local/bin/gm.sh the message content
will look the same, but the envelope sender address changes.
-Ralph
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]