croessner / vrfydmn

Postfilx milter that rejects/fixes manipulated From:-header
GNU General Public License v3.0
14 stars 4 forks source link

TypeError when parsing headers in 0.11 #12

Open fanto666 opened 2 months ago

fanto666 commented 2 months ago

I am getting following errors:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/Milter/init.py", line 770, in milter.set_eoh_callback(lambda ctx: ctx.getpriv().eoh()) File "/usr/sbin/vrfydmn", line 199, in eoh if "@" in component: TypeError: a bytes-like object is required, not 'str'

and:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/Milter/init.py", line 772, in milter.set_eom_callback(lambda ctx: ctx.getpriv().eom()) File "/usr/sbin/vrfydmn", line 341, in eom newfrom = " ".join([s for s, in decoded_from]) TypeError: sequence item 0: expected str instance, bytes found

fanto666 commented 2 months ago

It seems that "component" and "decoded_from" are sometimes defined as "bytes", thus they need decoding to a str.

fanto666 commented 1 month ago

I see that the first part was already fixed in #5

fanto666 commented 1 month ago

this patch should fix decoding of From: header fields, which can appear as array of differently encoded words

vrfydmn-decode.patch

croessner commented 2 weeks ago

Sorry for the delay. I am really busy at the moment... Anyways, could you please make a PR for this?