Subject: Re: [PATCH] hooks--update: new, required, config variable: hooks.envelopesender,

From: Jim Meyering <[email-masked]>
Date: Fri, 23 Mar 2007 14:29:06 +0100

Andy Parkins <[email-masked]> wrote:
> On Friday 2007 March 23 12:11, Jim Meyering wrote:
>> This change adds a new, required, config variable: hooks.envelopesender,
>> and use that with sendmail's -f option.  This is important in order
>> to avoid relying on sendmail's "guess" at an appropriate envelope
>> sender address.  Without this, and in the presence of strict servers,
>> it is far too easy not ever to be notified, or (more insidious) never
>> to receive bounce email.
>
> Won't work.

Thanks for the quick feedback.

It works for me using the sendmail from sendmail, and I have tested
this with the one from postfix, too.

>>>From "man sendmail" (although my sendmail is actually exim)
...
> The hook scripts run under the identity of the user doing the push; so "-f"
> won't have an effect.

It has a dramatic effect for me.
With it, mail is sent, without, it's not.

> I'm not sure why you would even need it; as the above quote says, the sender
> is set up as the user who ran the command.

Part of the problem was that sendmail used a mangled hostname.
Without -f, it would use [email-masked].

But IMHO, relying on the current behavior (using envelope sender same as
the From: address) is not an option.  It must be configurable.  I want
the envelope sender to be the same admin address for all outgoing mail,
since that's where reports of delivery problems are sent.  Besides, the
users in question don't even have "real" shell or email access on the server
system, so receiving systems would not be able to authenticate them.

In fact, some of the "users" in question are fake accounts used solely
for write access (via git-server) to the shared git repository, so the
user name exists only on the server system.

If we can't do this portably via the sendmail program, then
perhaps it's a good time to switch to using a module like Net::SMTP.