On 12/24/2025 12:48 PM, Marvin Renich via Postfix-users wrote:

> * Wietse Venema via Postfix-users <[email protected]> [251224 10:04]:
> I think what the OP is saying is that when sendmail auto-generates a
> "From:" header, it is getting the email portion from the -f
> envelope.from, but the full name from the current user.  I think he is
> saying that an auto-generated "From:" header (in absence of -F) should
> either use both the full name and email from the current user or
> (preferably) use both the full name and email based on the envelope.from
> address.
>
> If the primary use of -f was for specifying a non-root user of the host
> where sendmail is being invoked when being invoked by root, I would
> agree with the OP.  But in my experience, the primary use is to specify
> an email that is related to the current user, but not directly related
> to anything specific to the current host.
>
> The fact that -f specifies an email (perhaps not associated with the
> current host) as opposed to a host user is a clear indication that the
> current implementation is correct.

I suppose if the caller specifies "-f otheruser@otherhost" (is that allowed?) 
then there is no way for sendmail to determine the display name.  In that case 
it should probably be blank or "<unknown>".  In my case I am specifying "-f 
otheruser" and otheruser is an account on the current host.  I didn't think 
this was uncommon.  In my use case I have a PHP script that runs as "www-data" 
and I want the header to specify a different user on the same host that can 
actually receive email replies.  I have been running this script for the last 
11 years using the original sendmail and it has worked without issue.  Recently 
I switched over to postfix and my script broke.

The postfix implementation violates the principle of least surprise and it 
breaks compatibility with the original sendmail implementation.  I doubt this 
was a conscious decision by the postfix developers.  More likely this was 
merely overlooked and should be fixed.

_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to