From: Paweł Janik on
Hello

Is possible to set sendmail for incoming mail that it insert for each
mail information about who is recipient of email ?

Example mail is sending to 2 address on this same server - and each of
copies mail on mbox have field in header like:

on first mbox
Delivered-To: user1(a)example.net


on second mbox
Delivered-To: user2(a)example.net


Best Regards

Paweł Janik
From: Grant Taylor on
On 04/26/10 07:42, Paweł Janik wrote:
> Is possible to set sendmail for incoming mail that it insert for each
> mail information about who is recipient of email ?
>
> Example mail is sending to 2 address on this same server - and each of
> copies mail on mbox have field in header like:
>
> on first mbox
> Delivered-To: user1(a)example.net
>
> on second mbox
> Delivered-To: user2(a)example.net

That type of logging would probably be best done by the Local Delivery
Agent (LDA) rather than Sendmail.

You probably can add a custom header to the message via Sendmail, but it
would be the same for all recipients.



Grant. . . .
From: Andrzej Adam Filip on
Paweł Janik <scorpio(a)pogodanet.pl> wrote:
> Is possible to set sendmail for incoming mail that it insert for each
> mail information about who is recipient of email ?
>
> Example mail is sending to 2 address on this same server - and each of
> copies mail on mbox have field in header like:
>
> on first mbox
> Delivered-To: user1(a)example.net
>
> on second mbox
> Delivered-To: user2(a)example.net

Do you want:
a) recipient addresses as passed in "rcpt to:"
b) recipient addresses after rewriting and alias expansion
[with or without domain part?]

"a" => do not ask me
"b" => Which local mailer do you use? Is it procmail?
To check which local mailer your sendmail uses as root execute:
echo '=M' | sendmail -bt | grep local

--
[pl>en Andrew] Andrzej Adam Filip : anfi(a)onet.eu : Andrzej.Filip(a)gmail.com
http://open-sendmail.sourceforge.net/ http://anfi.homeunix.org/
Smoking is, as far as I'm concerned, the entire point of being an adult.
-- Fran Lebowitz
From: Andrzej Adam Filip on
Grant Taylor <gtaylor(a)riverviewtech.net> wrote:
> On 04/26/10 07:42, Paweł Janik wrote:
>> Is possible to set sendmail for incoming mail that it insert for
>> each mail information about who is recipient of email ?
>>
>> Example mail is sending to 2 address on this same server - and each
>> of copies mail on mbox have field in header like:
>>
>> on first mbox
>> Delivered-To: user1(a)example.net
>>
>> on second mbox
>> Delivered-To: user2(a)example.net
>
> That type of logging would probably be best done by the Local Delivery
> Agent (LDA) rather than Sendmail.
>
> You probably can add a custom header to the message via Sendmail, but
> it would be the same for all recipients.

Classic sendmail.cf passed LDA "user1", "user2" - recipient address
after rewriting and alias expansion with domain part stripped.
Preserving domain part in arguments passed via command line to LDA would
require some sendmail.cf tweaks.

--
[pl>en Andrew] Andrzej Adam Filip : anfi(a)onet.eu : Andrzej.Filip(a)gmail.com
http://open-sendmail.sourceforge.net/ http://anfi.homeunix.org/
What good is an obscenity trial except to popularize literature?
-- Nero Wolfe, "The League of Frightened Men"
From: Paweł Janik on
W dniu 2010-04-26 17:15, Andrzej Adam Filip pisze:
> Paweł Janik<scorpio(a)pogodanet.pl> wrote:
>> Is possible to set sendmail for incoming mail that it insert for each
>> mail information about who is recipient of email ?
>>
>> Example mail is sending to 2 address on this same server - and each of
>> copies mail on mbox have field in header like:
>>
>> on first mbox
>> Delivered-To: user1(a)example.net
>>
>> on second mbox
>> Delivered-To: user2(a)example.net
>
> Do you want:
> a) recipient addresses as passed in "rcpt to:"
> b) recipient addresses after rewriting and alias expansion
> [with or without domain part?]
>
> "a" => do not ask me
> "b" => Which local mailer do you use? Is it procmail?
> To check which local mailer your sendmail uses as root execute:
> echo '=M' | sendmail -bt | grep local
>

Yes - I'm using procmail.
I need it for small autorespond script which will detect destination
address and will use it for sender address in autorespond.

When mail is sent to one address I have in header section "Received:
[...] for user1(a)example.net" but if mail is sent to multiple recipient
there isn't this information ...

How can I solve this ?

Best Regards

Pawel Janik