[Pymilter] Getting CC recipients

Stuart D Gathman stuart at bmsi.com
Thu Jun 7 14:53:24 EDT 2012


On Jun 7, Larry G. Wapnitsky transmitted in part:

> Using the following code, I’m able to see the TO: recipients via my milter:
> 
>     @Milter.noreply
>     def envrcpt(self, recipient, *str):
>         rcptinfo = recipient, Milter.dictfromlist(str)
>         self.R.append(rcptinfo)
>         return Milter.CONTINUE

Those are NOT the TO: recipients.  Those are the "envelope" recipients.
There is no direct relationship between To: (or Cc:) and envelope
recipients.

Envelope recipients are defined in RFC 5321.

Headers, including To: and Cc: are defined in RFC 5322.

You can use the standard python email package to parse the headers. 
The milter-template.py sample in the pymilter package shows you how to 
collect the message, including headers, and parse it with email.


More information about the Pymilter mailing list