I'm writing a plugin that implements Swift_Events_BeforeSendListener to pipe $e->getMessage()->build()->readFull() to spamassassin but the headers are not complete and I need a snapshot of the final message to score it properly.
During execution of beforeSendPerformed() the To, From and Message ID are blank:
Ah yes, that's a problem really. Swift adds those headers immediately before sending the message, but apparently not before the beforeSendPerformed() method is used. It'd require some modification of the send() method inside the Swift class to change that.
Right ! well I had a look at that.. it's just before the headers are set! So close yet so far .. Maybe I'll do something external to swift for this bit .. However the manual needs an update near:
"BeforeSendListener is run before the message gets sent. You will know who the recipients are and what the message is at this stage, ... and so on .."
n2breed wrote:Right ! well I had a look at that.. it's just before the headers are set! So close yet so far .. Maybe I'll do something external to swift for this bit .. However the manual needs an update near:
"BeforeSendListener is run before the message gets sent. You will know who the recipients are and what the message is at this stage, ... and so on .."
It's not very elegant though since once you've done that you then need to setTo(null) before the end of the method otherwise Swift will not do it's own natural set of replacements in the Headers.