On 1/15/19 8:02 PM, David B Funk wrote:
It's a bit tricky to implement a milter correctly because people often don't understand that the message which sendmail hands to a milter is as-received from the incoming network connection.

Any locally added stuff (EG the "Received:" header) isn't in that milter stream.

Thus the milter must completely/correctly synthesize all locally added headers.

I might have known that at some point in the past but I definitely forgot about it until today.

Actually the spamass-milter method (calling spamc) makes it easier to debug.

Wait.  What‽

I thought spamass-milter used the same protocol to communicate with spamd that spamc does. Somehow I was not aware that spamass-milter actually used spamc to communicate with spamd.

Just create a script which wraps spamc in-between a couple of "tee"s to capture stdin & stdout and you'll have everything you want to know.

<Face Palm>

A simple example which ignores signal handling:

  #!/bin/sh
  # 'spamc' debugging script
  FILE_NAME="/var/tmp/spamc-transcript-$$"
  echo "spamc args: $*" "" > ${FILE_NAME}.in
  tee -a ${FILE_NAME}.in | /real/path/to/spamc "$@" | tee ${FILE_NAME}.out

Adjust paths as needed.

*nod*nod*

Thank you for the information Dave.



--
Grant. . . .
unix || die

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to