phalaaxx / milter

A golang library for milter support
BSD 2-Clause "Simplified" License
46 stars 22 forks source link

Calling Modifer.Addheader() doesn't work from Milter.Headers() #5

Closed porjo closed 6 years ago

porjo commented 6 years ago

Not sure if this is a bug with phalaaxx/milter or just a limitation of the protocol...

I've created a simple milter here which adds a header. I tried doing that from Milter.Headers() however get this error in postfix log:

Jun 18 04:29:07 dev postfix/cleanup[107]: warning: milter unix:/tmp/pol.sock:
  unexpected filter response SMFIR_ADDHEADER after event SMFIC_EOH

For now, I'm doing it in Milter.Body() which works, however I don't need to read the body and would like to avoid that if possible.

porjo commented 6 years ago

After reading milter-protocol.txt and comparing that with code here I'm pretty sure Milter.Body() is always called, irrespective of whether NoBody is set (contrary to phallax/milter documentation)