Ralph Seichter via Postfix-users:
> Consider a pre-generated text file sample.eml like this one:
>
> From: Bob <[email protected]>
> To: [email protected]
> Subject: foobar
>
> The message body goes here...
>
> Imagine further that Bob is logged in as user123 on host.example.net
> which runs Postfix, and Bob sends the message like so:
>
> $ /usr/sbin/sendmail -t < ~/sample.eml
>
> This would typically result in an envelope sender address like
> <[email protected]>, which may not be reachable from the outside.
> To force a different envelope sender address, Bob could use the
> following:
>
> $ /usr/sbin/sendmail -t -r [email protected] < ~/sample.eml
>
> This can of course be automated by extracting the "From:" header value
> from sample.eml, e.g. in a wrapper script which then calls sendmail with
> the appropriate "-r ..." parameter.
>
> I wonder however if this is something which sendmail can achieve out of
> the box, without the need for a wrapper script? The sendmail(1) man page
> doesn't seem to indicate that there are parameters for this use case,
> but I thought I'd ask here.
>
> By the way, I have considered sender_canonical_maps, but if each userNNN
> can use several different valid From: addresses (all valid), canonical
> address rewriting does not seem like the right tool?
If your message file has no From: header, then Postfix provides one
based on the envelope sender address, with a "full name" for that
header based on the -F option, or the NAME environment variable,
or the GECOS field in the password file.
Wietse
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]