vimmaniac / ppymilter

Automatically exported from code.google.com/p/ppymilter
0 stars 0 forks source link

REPLBODY causes faults in Postfix #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to work out a possible issue using the REPLBODY response. This is 
using the latest version of ppymilter as well as Postfix 2.8.5

I know that REPLBODY isn't implemented but I created a simple 
'bNew Body...' call, added it to the actions and sent the commands on their 
merry way back. (You can see the code in 
https://github.com/mozilla-services/bipostal/blob/master/src/bipostal.py)

The outbound call goes fine, however things fail on Postfix for odd reasons. 
Inside of src/milter/milter8.c, milter8_event() handles the 'b' command 
correctly, but reports the data size is 0, and thus doesn't process the call. 
Then the milter handler determines there's more data available, but pulls a 
'\0' as the command, and fails the message.

Sadly, this code isn't well documented, so I'm not sure if the problem is with 
the character padding being done to the outbound data or if there's some other 
effect causing the data to be mis-interpreted. 

I'm hoping that all this needs is a bit of clarification on how REPLBODY calls 
should be sent.

Thanks!

Original issue reported on code.google.com by jrcon...@gmail.com on 9 Nov 2011 at 8:16

GoogleCodeExporter commented 9 years ago
Ah, resolved the problem.

Turns out something was returning a unicode string. AsyncChat doesn't handle 
that very well and was causing the problem. Wrapping the REPLBODY content with 
a str() solved the issue and things are working fine now. 

Feel free to close this issue.

Original comment by jrcon...@gmail.com on 10 Nov 2011 at 4:10