[RCD] SMTP settings override via Identities plugin
thomas at roundcube.net
Mon Sep 5 20:25:50 CEST 2011
On Tue, Aug 16, 2011 at 20:18, Florian Mutter <elm at 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.
List info: http://lists.roundcube.net/dev/
More information about the Dev