On 08/28/2012 01:35 PM, Szuts Attila wrote:
When I call 'message_outgoing_complete' hook it returns an encrypted (by RECIPIENT public key) $MAIL_MIME instance. After that I want to store ('_store_target') the message in Sent Items folder (or Draft or what user wants), encrypted by SENDER public key.
I think hook could return 2 Mail_Mime instance: one for sending (rcmail_deliver_message()) and one for later storing ($IMAP->save_message()). Is there any best practice?
I think, we could extend message_sent hook (rcmail.php). This is not executed on draft saving, but you can detect what is the current action by checking $_POST['_draft']. Then in save-draft-request use message_outgoing_complete else use both message_outgoing_complete and message_sent.