I composed a simple HTML mail with one txt attachment. enigma.php calling this hook: $this->add_hook('message_outgoing_body', array($this, 'msg_encode'));
In msg_encode function debugging 'message' argument gives the following output:
*array ( 'body' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body> <p>123</p> <p> </p> <div> </div> </body></html> ', 'type' => 'html', 'message' => Mail_mime::__set_state(array( '_txtbody' => NULL, '_htmlbody' => NULL, '_html_images' => array ( ), '_parts' => array ( ), '_headers' => array ( ), '_build_params' => array ( 'head_encoding' => 'quoted-printable', 'text_encoding' => 'quoted-printable', 'html_encoding' => 'quoted-printable', 'html_charset' => 'ISO-8859-1', 'text_charset' => 'ISO-8859-1', 'head_charset' => 'ISO-8859-1', 'eol' => ' ', 'delay_file_io' => false, ), )), 'abort' => false, )*
Where can I find the attached txt file? How can I reach and encrypt it?
(I got no reply email from RC dev list. Maybe something wrong in my gmail account. sorry.)
thx A.
On 08/22/2012 10:52 PM, Szuts Attila wrote:
I composed a simple HTML mail with one txt attachment. enigma.php calling this hook: $this->add_hook('message_outgoing_body', array($this, 'msg_encode'));
In msg_encode function debugging 'message' argument gives the following output:
you mean debugging all hook arguments....
/array ( 'body' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
Where can I find the attached txt file? How can I reach and encrypt it?
Attachments are available via $GLOBALS['COMPOSE']['attachments']
If using message_outgoing_body will be still uncomfortable, I suppose we could add an additional hook after complete message is composed, ca. line 606 of sendmail.inc file. Also extending Mail_mime package with some more getters could be useful.
I've created a hook in sendmail.inc (Line: 606)
$data = $RCMAIL->plugins->exec_hook('message_outgoing_complete', array('message' => $MAIL_MIME)); $MAIL_MIME = $data['message'];
Please place this hook (or similar) in next RC release.
thx A.
2012/8/23 A.L.E.C alec@alec.pl
On 08/22/2012 10:52 PM, Szuts Attila wrote:
I composed a simple HTML mail with one txt attachment. enigma.php calling this hook: $this->add_hook('message_outgoing_body', array($this, 'msg_encode'));
In msg_encode function debugging 'message' argument gives the following output:
you mean debugging all hook arguments....
/array ( 'body' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN">
Where can I find the attached txt file? How can I reach and encrypt it?
Attachments are available via $GLOBALS['COMPOSE']['attachments']
If using message_outgoing_body will be still uncomfortable, I suppose we could add an additional hook after complete message is composed, ca. line 606 of sendmail.inc file. Also extending Mail_mime package with some more getters could be useful.
-- Aleksander 'A.L.E.C' Machniak LAN Management System Developer [http://lms.org.pl] Roundcube Webmail Developer [http://roundcube.net]
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl _______________________________________________ Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev
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?
thx A.
2012/8/23 A.L.E.C alec@alec.pl
On 08/22/2012 10:52 PM, Szuts Attila wrote:
I composed a simple HTML mail with one txt attachment. enigma.php calling this hook: $this->add_hook('message_outgoing_body', array($this, 'msg_encode'));
In msg_encode function debugging 'message' argument gives the following output:
you mean debugging all hook arguments....
/array ( 'body' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN">
Where can I find the attached txt file? How can I reach and encrypt it?
Attachments are available via $GLOBALS['COMPOSE']['attachments']
If using message_outgoing_body will be still uncomfortable, I suppose we could add an additional hook after complete message is composed, ca. line 606 of sendmail.inc file. Also extending Mail_mime package with some more getters could be useful.
-- Aleksander 'A.L.E.C' Machniak LAN Management System Developer [http://lms.org.pl] Roundcube Webmail Developer [http://roundcube.net]
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl _______________________________________________ Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev
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.