Marius Gedminas <[EMAIL PROTECTED]> wrote on Fri, 09 Jun 2000:
> Use `set from=...' instead of `my_hdr From: ...'.
Right, this is the way to go.
> $realname takes
> precedence over $from, but not over my_hdr.
Actually, not exactly that. $realname contains the name part of the
address. $from is only the address. The From header is made up of
$realname and $from, they contain separate parts of information, so
can't take precedence over one another.
"my_hdr From: ..." does override both $realname and $from.
> BTW I've heard that setting $from does not work well within send-hooks.
That is correct, the $from variable has been consulted already by the
time send-hooks execute. It works as follows when an new email is
started:
1a) The address from $from is used as the From address.
1b) If $reverse_name is set, and this is a reply, then an address from
the original message's To/Cc header is used, if any of them match
$alternates. If none match, $from is used. If there are multiple
matches, I'd guess the first match is used.
2) The send-hooks execute. You can match against recipient headers (To,
Cc, Bcc) and *also* the current From header. You can't set $from,
because that will only affect the *next* email.
3) Any my_hdr directives are then applied. If you set my_hdr's in
send-hooks, these will be followed.
Therefore, for complex situations, it may be necessary to play around
with all of $from, $reverse_name and "my_hdr From: ..." -- the default
case being no my_hdr From:, having $from and $reverse_name set, and
then matching both recipients and the current From header, and if
needed, changing the From address with "my_hdr From: ..."
(I hope I got this exactly right this time, I've certainly had trouble
understanding some of the details...)
Regards,
Mikko
--
// Mikko Hänninen, aka. Wizzu // [EMAIL PROTECTED] // http://www.iki.fi/wiz/
// The Corrs list maintainer // net.freak // DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
"I used to be indecisive, but now I'm not sure."