On Tue, Aug 16, 2011 at 20:18, Florian Mutter elm@skweez.net wrote:
How is the plugin supposed to now which identity was used to send an email? the smtp_connect hook doesn't provide the identity that was used to send a message nor does it provide an email address or message ID. I think there should be a message ID which invoked the smtp_connect hook that can be used to determine additional informations about the mail that is about to be sent. I hope you, or someone else, can help me.
The message ID is rather useless because there's no place to fetch additional information. The message is not yet stored in the IMAP backend, this is done after the mail was successfully delivered through smtp. I recommend to register another hook 'message_outgoing_headers' in your plugin in order to gather information about the message to be sent. The data passed to this hook also contains the From address which is set by the identity. Read the sender from there, store it in a member var of your plugin class and read it afterwards when smtp_connect is triggered.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80