[Mimedefang] Adding Recipients to X-Recipients Header

Marcus Schopen lists at localguru.de
Wed Jun 22 06:20:56 EDT 2011

Hi Steffen,

Am Mittwoch, den 22.06.2011, 09:14 +0200 schrieb Steffen Kaiser:
> Hash: SHA1
> On Wed, 22 Jun 2011, Marcus Schopen wrote:
> >> Correct.  You can find out other recipients on YOUR mail server (or 
> >> downstream), but not recipients which were handled by other servers 
> >> upstream or in parallel to yours.
> >
> > I add the following lines to filter_end
> >
> >    foreach $recip(@Recipients) {
> >     if ($recip =~ /<.*\@test\.com>$/i) {
> >      action_add_header("X-Orig-Rcpts", "$recip");
> >     }
> >    }
> >
> > If I send an email from an external MX to BCc test at test.com and BCc
> > test2 at test.com I just get an X-Orig-Rcpts for test2 at test.com. In my
> > config stream_by_domain is activated in filter_begin.
> Hmm, if you use stream_by_domain() already, all recipients should have the 
> same domain already.

Right, it wouldn't be a problem or in my setup it's welcome if only all
recipients of one domain are shown in the X-Orig-Rcpts Header.

> The man of stream_by_domain() says:
> "
> stream_by_domain() looks at all the recipients of  the  message,
>                and  if  they  belong  to the same domain (e.g., 
> joe at domain.com,
>                jane at domain.com and sue at domain.com), it returns 0 and  sets 
> the
>                global  variable $Domain to the domain (domain.com in this 
> exam‐
>                ple.)
> "
> - ->
> if($Domain =~ /\A(?:domain1|domain2|...)\z/i) {
>  	#action_delete_all_headers('X-Orig-Rcpts'); # see below
>  	action_add_header('X-Orig-Rcpts', join(', ', @Recipients));
> }

I've tested this with

 action_add_header('X-Orig-Rcpts', join(', ', @Recipients));

But if I send an email e.g. from GMX using Bcc to jane at domain.com and
sue at domain.com only one recipient is shown in @Recipients. In my
understanding for this domain domain.com both recipients should put to
the X-Orig-Rcpts Header by above line. Ideas?

> BTW: If someone knows your mail setup or you forward such mails around, 
> the header may contain more (or not) what you intend. Depending on your 
> needs you should replace the 'X-Orig-Rcpts' header.

If a recipient forwards such a marked email with X-Orig-Rcpts header to
someone else outside, it would only be a problem if the new recipient
should not see to whom else the mail was addressed to under my domain. I
can live with that. Otherwise one should not forward such an Bcc email.
But you are right. This is a point one has to think about.


> Regards,
> - -- 
> Steffen Kaiser
> Version: GnuPG v1.4.6 (GNU/Linux)
> R0/NPK9BLTeL15brH21Rs/oT/vToRVoUUD/b29H8nyDyJbe5LiuR+nEfpC+UUme0
> lcaV4m3m32h6iDxvlFVBaADd3Do4BzXluk9lLCXk5pUzVtcOBVfHtCLB1OpZK9Ro
> DgZwNxnJabJ6Rw6ZW7lnaHPBnLEXdup+eo/BgSPcZ3XlOD12VYOqryJKTM1VJ+jn
> 0msfb9pRo8ZSwBy+QmfYzMVZkEZmWXX7TIf/Gqc65N/d9b20hakXJIKzSv/ZFxAu
> rh9KifHzxfsGN+9R02QTXMMWD9NvRy7Agqwg+q7wN/x0T0uMG3bf8A==
> =aKAE
> _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang at lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

More information about the MIMEDefang mailing list