Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Envelope info for pipe alias?

9 views
Skip to first unread message

timoth...@gmail.com

unread,
Jun 21, 2017, 7:47:38 AM6/21/17
to
I have a process that receives mail on a pipe from /etc/aliases, and passes it on to another server after some processing.

I need to make the envelope information (sender, recipients) available. (So that the intermediate filter can be transparent to the end process.)

I know that smrsh prevents sending it via environment variables, so it seems that adding some custom headers is the way to do this.

So the goal is that for locally delivered mail (preferably only the 'prog' delivery agent, but should be harmless for all), add headers something like:

X-Envelope-Mail-From:
X-Envelope-Rcpt-to: (one or more, or one with a list would be fine.)

I'd rather not have them appear in outbound mail, as they're redundant and might confuse external processes. The filter would consume them, and use them as the
envelope data for the next stage.

From reading (and re-reading) the documentation, I THINK these are in the macros ${rcpt_addr}, ${rcpt_host}, ${mail_addr} & ${mail host}.

Is this correct?

To get started, I tried adding (at the end of sendmail.mc)

HX-Envelope-Rcptto: ${rcpt_addr}
HX-Envelope-Rcpthost: ${rcpt_host}
HX-Envelope-Mailhost: ${mail_host}
HX-Envelope-Mailaddr: ${mail_addr}

I only see the last one in test mail. So I must be missing something.

Help appreciated...

Thanks in advance.

Claus Aßmann

unread,
Jun 21, 2017, 9:55:41 PM6/21/17
to
> I have a process that receives mail on a pipe from /etc/aliases, and
> passes it on to another server after some processing.

> I need to make the envelope information (sender, recipients)
> available. (So that the intermediate filter can be transparent to
> the end process.)

> X-Envelope-Mail-From:
> X-Envelope-Rcpt-to: (one or more, or one with a list would be fine.)

Doesn't work - it's only one at most, and then it's $u:
5.2. D -- Define Macro
....
$u The recipient user.

Check the docs about defining mailers and how to handle
the list of recipients, e.g.,

5.4. M -- Define Mailer
...
m This mailer can send to multiple users on the same
host in one transaction. When a $u macro occurs
in the argv part of the mailer definition, that
field will be repeated as necessary for all
qualifying users. Removing this flag can defeat
duplicate supression on a remote site as each
recipient is sent in a separate transaction.



--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.
0 new messages