Using offline-imap to send email written offline

Nicolas Estibals nicolas.estibals at
Fri Jan 11 13:28:01 GMT 2013

[2013-01-11 13:37:02 +0100] Romain Pelisse:
> Hum, yep, of course - I did not think this one through... That might be a
> good idea, setting up a decent local postfix on laptop has been on my todo
> list.
> On 11 January 2013 11:20, Dima Pasechnik <dimpase+olimap at> wrote:
> > On 11 January 2013 18:11, Romain Pelisse <belaran at> wrote:
> > > I'm using Mutt with offline-imap and I'm very happy of it (so all my thanks
> > > to you, guys). As i'm currently sitting on a plane, writing emails, with
> > > Mutt, I'm bit sad however to have to manually send them when I'll be online.
> > >
> > > Would there be a way with ofline-imap to send to messages ? Maybe by moving
> > > them out of drafts to an other special folder ?

This problem troubles me also and it seems to exist a more  modern way
to send emails which solve the problem.

> >
> > imap does not have anything to do with *sending* mail. You might
> > install postfix, or another queuing smtp server on your machine (or
> > perhaps you have one already), and send mails just as if your are
> > online. Next time you really are online, postfix will do the delivery.

So far, my understanding of IMAP is that it's a synchronisation protocol
for mails. The way to use it to send mail is to let the server to send
mails for you.

Some imap servers use an "outbox" or "sendbox" directory and when you
push an email there, it sends it and move it to the "sent" directory.
The main advantage there is you don't have to worry anymore about
sending email when you get back offline (using postpone is not what you
want and it's somewhat cumbersome to go to your "drafts" directory and
send all emails manually).  A second advantage is that the date field
will actually correspond to the moment you wrote the email. Also, you
only transmit your mail once over the network (not nce by imap to sync
the "sent" directory and once by smtp)

Then offlineimap should be a perfect way to send emails: you write it
offline in your "outbox" directory and then, when offlineimap
synchronize again, your mail is sent. [1]

So far it seems to be a perfect solution but two problem arise:
  1. mutt does not support outbox but there is a patch from Aron Griffis
  that I have ported to lastest version of mutt

  2. most, if not all, of the mail account I use do not provide this
  outbox feature.

I've started the writing of daemon called fakeoutbox to provide this
functionality. Basically, it watch by inotify an outbox directory in the
maildir format and send it by smtp and move the mail to a sent
directory. For the moment, I have no time to develop it further and it
is not in a usable shape but I can send you the small python program that
do it (it is a very simple program to write given the mailbox, smtplib2
and pyinotify libraries). What needs to be done now is (by priority
  - a proper configuration files (ConfigParser?)
  - multi-account support (I like to use different smtp servers
    depending on the email account I use)
  - desktop notification when mails are eventually sent (option, but
    might be good to know that the mail is properly sent and show
    errors when they happen)
  - unsend function (wait xx minutes before actually sent the mail to
    prevent accidental sending)
  - ...

Since part of the configuration may be shared with offlineimap, it
doesn't seem a bad idea to me to integrate a fakeoutbox functionality
in OLI but it seems also ok to me to keep it unix-style: one feature,
one program

[1] It might be good to have some feedback, if some offlineimap already
used it that way.

My two cents ;-)

N. E.

More information about the OfflineIMAP-project mailing list