That was the ticket, I changed python-libmilter to get the RCPT TO from
the R<> part instead of the {rcpt_addr} macro and postfix now deletes
the recipient correctly now that the correct case is sent back:
https://github.com/crustymonkey/python-libmilter/pull/2

I also noticed that postfix's {rcpt_host} has the correct case
information (eXample.org, not example.org), so shouldn't {rcpt_addr}
contain it too?  Especially since sendmail sends case information as well?

Either way, thanks for helping me get to the bottom of this!

On 11/08/2013 04:26 PM, Wietse Venema wrote:
> moparisthebest:
>> I went ahead and ran:
>> tcpdump -w /tmp/log.txt -i lo -s 0 host 127.0.0.1 and port 5001
>>
>> on both servers to see what was actually sent back and forth from
>> sendmail/postfix to the python milter, and discovered packets from
>> sendmail contain:
>>
>> {rcpt_addr}[email protected]
>>
>> while packets from postfix contain:
>>
>> {rcpt_addr}[email protected]
> 
> Confirmed. The value of the {rcpt_addr} macro is not the same address
> as RCPT TO.  Instead, it is part of a triple ({rcpt_mailer},
> {rcpt_host}, {rcpt_addr}).
> 
> This {rcpt_addr} value is not stored into the Postfix queue file,
> and should therefore not be used to delete recipients.
> 
> (you could turn off case folding here by editing smtpd_resolve.c).
> 
>> And both of them end up sending this snippet later in the transaction:
>>
>> R<[email protected]>
> 
> That is the RCPT TO address that both Postfix and Sendmail send
> to the Milter "rcpt" event handler. Absent Postfix virtual aliasing
> and address rewriting, this is the address that will end up in the
> Postfix queue file.
> 
> So that is what you should use when you want to delete recipients.
> I'm pretty sure that this is what you should use with Sendmail, too.
> 
>       Wietse
> 

Reply via email to