1

I use Thunderbird with an IMAP server to access incoming email as well as for online storage of mail, and SMTP server for outgoing email. Every time I send an email, it first sends it via SMTP and then uploads it separately to my IMAP server's Sent Items folder. This is not only inefficient, it's also risky as sometimes, on a poor-quality connection, I can send out an email by SMTP but then fail to save it on the server with IMAP, leaving me without any copy of the email I sent (and Thunderbird doesn't save it in the outbox in such cases).

Is there any way I can set up some local and/or server-side software such that (1) the mail only needs to be uploaded once and (2) it will reliably appear in my Sent Items immediately, without delay (and without requiring it to be re-downloaded) and then also hopefully (3) when my connection is poor and an email can't be saved to the IMAP folder, it automatically stays in my local outbox until properly sent and synched?

Local mail clients have been around for so long now, I am really surprised that there appears to be no solution for this! Seems like webmail is the only robust solution, but that's no good for poor quality connections either.

I am thinking of solutions like offlineIMAP and dovecot, but wondered if anyone has got/seen an outline for how such a setup could be organised?

jdpipe
  • 232
  • 1
  • 11
  • If there isn't a way to do this well, are there any RFCs or proposals for better ways of doing this stuff? – jdpipe Dec 04 '16 at 23:13

2 Answers2

1

This is not possible using imap, the protocol just don't manage at all the sending of messages.

You could manage to do that using sieve scripts while telling postfix to deliver the message to the sender but that won't be robust and would save the email two times in the Sent folder if the client is not configured for your liking.

Overall, this is a bad idea.

Pierre Barre
  • 2,174
  • 1
  • 11
  • 23
  • Also, you can't effectively manage BCC headers with this (which is a complaint gmail users have whose server does do this). – Max Dec 04 '16 at 15:51
  • Are messages sent to BCC recipients by separate SMTP requests at my mail client, or is that done up at the SMTP server? If so, a 'clever' SMTP server should be able to log my outgoing emails to my IMAP server with the BCC stuff intact, right? – jdpipe Dec 04 '16 at 23:14
  • It depends. A clever server could add 'BCC' headers for recipients it saw in SMTP RCPT commands but not in To/Cc headers, however SMTP submission servers generally do not interpret headers; they may add some, but they do not attach any meaning to existing ones. To do so might be considered a violation of SMTP. However, it would not know the 'friendly names', as those are not in SMTP commands. – Max Dec 06 '16 at 21:04
0

From https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol#Disadvantages:

"Unlike some proprietary protocols which combine sending and retrieval operations, sending a message and saving a copy in a server-side folder with a base-level IMAP client requires transmitting the message content twice, once to SMTP for delivery and a second time to IMAP to store in a sent mail folder. This is remedied by a set of extensions defined by the IETF LEMONADE Working Group for mobile devices: URLAUTH (RFC 4467) and CATENATE (RFC 4469) in IMAP and BURL (RFC 4468) in SMTP-SUBMISSION. POP servers don't support server-side folders so clients have no choice but to store sent items on the client. Many IMAP clients can be configured to store sent mail in a client-side folder, or to BCC oneself and then filter the incoming mail instead of saving a copy in a folder directly. In addition to the LEMONADE "trio", Courier Mail Server offers a non-standard method of sending using IMAP by copying an outgoing message to a dedicated outbox folder.[18]"

I like the idea of a clever IMAP server that handles handing off a message via SMTP through the use of an outgoing message folder, which the Courier Mail Server seems to be doing.

The set-up would need a 'smart' local SMTP server (defined below) as well as either a normal online IMAP server or else alternatively a local/offline IMAP server capable of keeping local offline copies of everything and synchronising when connected.

The 'smart' local SMTP server would need to handle the job of arranging for the message to be sent. In one configuration, it could simply do this as normal. But in another configuration, it could communicate with a 'smart' remote SMTP server, and, instead of sending the outgoing message to that server, it could tell that other server that the remote IMAP server has whatever particular message and, then the remote SMTP server could fish out the message from the remote IMAP server and send it on its way.

Such a configuration could be managed without a special email client. The only change from a standard configuration would be (1) setting IMAP to save sent messages in an 'outgoing' folder, and (2) setting the SMTP server to the 'smart' local SMTP server instead of the normal remote SMTP server.

None of this exists, but it could be implemented fairly easily by someone who was comfortable with both SMTP and IMAP protocols and server implementations, right?

jdpipe
  • 232
  • 1
  • 11
  • The Trojita email client seems to implement "BURL". https://projects.flaska.net/projects/trojita/wiki/Trojita – jdpipe Apr 25 '17 at 23:40