<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>I had some issue with addheder, workaround is to use chgheader like this:</p>
<p>self.chgheader("X-%s-Scanned" % (conf["name"]), 1, time.strftime('%d.%m.%Y %H:%M:%S'))</p>
<div id="signature">---<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Semi</div>
</div>
<p><br /></p>
<p id="reply-intro">Ed Wong kirjoitti 19.5.2023 13:03:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>Hi,<br /><br /></div>
I have the following code:<br /><br /></div>
if __name__ == "__main__":</div>
Milter.factory = SimpleMilter</div>
Milter.set_exception_policy(milter.CONTINUE)</div>
Milter.set_flags(Milter.CHGHDRS + Milter.ADDHDRS)</div>
sys.stdout.flush()</div>
Milter.runmilter("simplemilter", "/tmp/simpmilt.socket", 240)<br /><br /></div>
Given that, I should be able to add a header field/value to the headers,</div>
but when I do the following:<br /><br />def close(self):<br /> ...</div>
self.addheader("X-MARK", "Seen by SimpleMilter")<br /><br /></div>
I get an error:<br /><br /></div>
milter.error: cannot add header<br />
<div> </div>
<div>Now I'm wondering if I can't addheaders that late into the process.</div>
<div>Is this the case?<br /><br /></div>
<div>Any clarifications appreciated, thanks.<br /><br /></div>
<div>Ed</div>
</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br />Pymilter mailing list<br /><a href="mailto:Pymilter@gathman.org">Pymilter@gathman.org</a><br /><a href="https://gathman.org/mailman/listinfo/pymilter" target="_blank" rel="noopener noreferrer">https://gathman.org/mailman/listinfo/pymilter</a></div>
</blockquote>
</body></html>