Hi Timo, There was another thread (it has come up at least a few times in the past few years I've been lurking) on the postfix list about having some kind of automatic 'Save to Sent' option to avoid the users mail client from having to upload messages twice (obviously the only ones of concern are ones with large attachments) - once to send it, and once to save the copy in the sent folder. I know and understand that doing this is not generally the job of the MTA, but hopefully most people can at least admit that there would be a (potentially huge, in the case of any large company that deals with a lot of large attachments in their email) savings in bandwidth (and user frustration) if a way could be found to do this reliably and at little to no 'cost' in terms of CPU/Disk IO, so I have a question about how this might be done... Given: Postfix can be configured to use the Dovecot LDA for delivering mail incoming. My question is simply, why wouldn't it be possible to create a Dovecot LSA ('submission agent'), that could be defined in postfix's master.cf file, which could then be configured to a) pipe the message to postfix, and b) if message is successfully sent, save a copy to the users Sent folder? Obviously, there would be some caveats - ie, postfix and dovecot would both have to be running on the same box (or at a minimum on the same local network)... Anyway, this is just something that really bugs me (and has for many, many years) every time I send a message with a large attachment, and have to watch it slowly process the message sending it, then again to save it to the Sent folder, so Ijust wanted to get your take on if this is even remotely feasible... -- Best regards, Charles
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 4 Mar 2010, Charles Marcus wrote:> Given: Postfix can be configured to use the Dovecot LDA for delivering > mail incoming.And that's all what's needed. Configure your postfix to honor subaddresses, IMHO, it's seperated by "+" in postfix, and pass it as argument of "-m" option to deliver. Configure your MUA to always BCC to me+Sent at example.net This config has three advantages over the traditional one: 1) you transmit the message over the wire just once. 2) you know that, if to send the message failed, the message is not sent, in opposite to differ from "upload to Sent via IMAP failed" in the second stage. 3) the message in your Sent mailbox has the queueid. Debugging is much easier. One disadvantage: 1) If the message is accepted, but for what reason ever is discarded by the MTA, the data is lost. Regards, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBS4+5L7+Vh58GPL/cAQLHsAgAw7MLxmporZp8siSRSqPBdb7t2cfvJPa7 dg2NNLJAuoo093897U0IT02W1iYhU7rjSPraWsFmOA4YZnyZK6WicEhi8Usmp8kz Yx66v9lHCPcZ6JRkneCVxPhBqiCBMucGo8JUjytQcA4I+QnQpFqInZuFyB3IyJhf /WVneTTQ390gkv653zaYilUZEmeq9ZnrV1Sged/1TSfGyjtLcCwU23gmb4I+kWG7 eaJdb/LyUmzn6d+JZaSB/WJO5kAQ9gxvgzIOeJwqt1MzGWZMW7NklfUEbJLlUdlM DHYTHPJrynkA8T93og2ddDknURg0BCP2YYlX72KGadq88F6qq5Nd4A==QvyY -----END PGP SIGNATURE-----
On 2010-03-04 8:32 AM, Charles Marcus wrote:> My question is simply, why wouldn't it be possible to create a Dovecot > LSA ('submission agent'), that could be defined in postfix's master.cf > file,Oh - and by 'LSA', I didn't mean to suggest you should architect a complete 'smtp listener'. I'm thinking more in terms of a 'proxy', where your service would simply proxy the submission transaction while retaining a copy of the email up until the point where it would be needed to be saved to the users Sent folder - and if the send transaction failed for any reason, the email copy is simply discarded. -- Best regards, Charles
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 4 Mar 2010, Charles Marcus wrote: Some MUAs have a server-side outbox. Store anything therein, and the server picks up the messages. To/CC/BCC is taken from the message headers. You can implement this: a) via a Dovecot plugin, that triggers some demon. b) cron job c) filesystem listener (inotify in Linux) Regards, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBS4+8Fr+Vh58GPL/cAQKI6Af/YTzxu/2TPcX98wDIDzZ7k5tXuQ0hCZuk xOkV5we/WB8CqcfsfqiRy1f+3E1+S/2X/nB4q/gZv9/Pfhv8SnqVM+DT3ogfGF0d El7V0O1flqNvnwROft6qWcfMsKWjDPVLy/ug6MY2H1N+askEdZTG1nNnn5uf42l0 STdfWZNL58/ePEEJWZXc2mM3gE500r65J+LLl9afI+gj513Y0T9gI2Al05roT1tA 15JVytU8GNNfLolwPDy07pzJ/6TakXYESg1/5YknATt5Z9OH9Iof6+pPH54Jy4sT Gfn1hdQMtYwakdfalzQ7bxbjxwccqP7SpeUJZORnYOtKga47sHs4eQ==U+xj -----END PGP SIGNATURE-----
On Thu, 2010-03-04 at 08:32 -0500, Charles Marcus wrote:> There was another thread (it has come up at least a few times in the > past few years I've been lurking) on the postfix list about having some > kind of automatic 'Save to Sent' option to avoid the users mail client > from having to upload messages twice (obviously the only ones of concern > are ones with large attachments) - once to send it, and once to save the > copy in the sent folder.LEMONADE group solved this with IMAP URLAUTH (RFC 4467) and SMTP BURL (RFC 4468) extensions. The idea is basically (copy&pasting from RFCs): C: RCPT TO:<ron at gryffindor.example.com> S: 250 2.1.5 ron at gryffindor.example.com OK. C: BURL imap://harry at gryffindor.example.com/outbox ;uidvalidity=1078863300/;uid=25;urlauth=submit+harry :internal:91354a473744909de610943775f92038 LAST S: 250 2.5.0 Ok. So after receiving BURL command, SMTP server connects to IMAP server and fetches the message: S: * OK [CAPABILITY IMAP4REV1 URLAUTH] example.com IMAP server C: a001 LOGIN submitserver secret S: a001 OK submitserver logged in C: a002 URLFETCH "imap://joe at example.com/INBOX/;uid=20/ ;section=1.2;urlauth=submit+fred:internal :91354a473744909de610943775f92038" S: * URLFETCH "imap://joe at example.com/INBOX/;uid=20/;section=1.2 ;urlauth=submit+fred:internal :91354a473744909de610943775f92038" {28} S: Si vis pacem, para bellum. S: S: a002 OK URLFETCH completed Now, the problem is of course that neither Dovecot nor Postfix support these extensions. For Dovecot I was thinking about using METADATA extension's storage for storing the URLAUTH stuff, but METADATA isn't really implemented yet either. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20100304/3454c0f2/attachment-0002.bin>
On 2010-03-04 9:32 AM, Timo Sirainen wrote:> LEMONADE group solved this with IMAP URLAUTH (RFC 4467) and SMTP BURL > (RFC 4468) extensions. The idea is basically (copy&pasting from RFCs): > > C: RCPT TO:<ron at gryffindor.example.com> > S: 250 2.1.5 ron at gryffindor.example.com OK. > C: BURL imap://harry at gryffindor.example.com/outbox > ;uidvalidity=1078863300/;uid=25;urlauth=submit+harry > :internal:91354a473744909de610943775f92038 LAST > S: 250 2.5.0 Ok. > > So after receiving BURL command, SMTP server connects to IMAP server and > fetches the message:But wouldn't this also require the MUA to support the concept of an 'Outbox'? TB3 currently has partial support for an Outbox, but only for 'sending messages in background', not for letting the *server* pick them up and handle it. Yes, support could be added, but I'd much prefer something purely server side that just works regardless of the MUA. Of course, the MUA would have to have a configurable option to *not* 'save a copy' of messages it sends on the server (I would think most do), and support would also have to be added for postfix, which I have no idea if Wietse would have any desire to do this (I lean toward not). The thread is progressing on the postfix list though, and it appears a working solution just might be achievable now through the use of sender_bcc_maps and sieve, if you are using postfix, dovecot and the dovecot LDA... I'll post here the result of that conversation to clarify if this can be done... -- Best regards, Charles