r/linux•
jsve

Introducing offlinemsmtp

Hello everyone, I wrote a program called offlinemsmtp which wraps msmtp (an SMTP client) so that you can use it offline. (For those who are unfamiliar with msmtp, it is a commonly used program for sending mail in many terminal email clients such as mutt and mu4e.)

You can read my blog post about it here: sumnerevans.com/2019/introducing-offlinemsmtp.html.

The project is on GitLab: gitlab.com/sumner/offlinemsmtp.

Version 0.3.5 is available on PyPi and the AUR.

Posted Dec 12, 2019, 3:16 AM UTC

2612
FoxboronArch Linux Team•

So you reimplemented msmtp-enqueue.sh, msmtp-listqueue.sh and msmtp-runqueue.sh?

13
jsveOP:arch:•

There are a few differences (you could argue that these are merely quality-of-life improvements, but that's all I need).

  1. The offlinemsmtp daemon runs continually in the background and (at a configurable time interval) attempts to send the mail in the queue directory.
  2. The offlinemsmtp daemon will only send an email message if it can connect to the configured SMTP server.
  3. If you can connect to the SMPT server already, and a new message comes into the queue, offlinemsmtp will send it immediately.
  4. offlinemsmtp integrates with system notifications so that you are notified when mail is being sent.
2
FoxboronArch Linux Team•

Highlighting the differences in the README sells the idea better.

A few of these things are fairly simple with a systemd service.

6
the_gnarts•

which wraps msmtp (an SMTP client) so that you can use it offline

What does “offline” refer to in that context? Purely local delivery like with LMTP?

4
jsveOP:arch:•

Offline basically means "queue messages for sending later" in this context. The offlinemsmtp daemon will poll for internet connectivity and when it determines that it can access the SMTP server, it will send the messages.

The reason this is nicer than msmtp is that with msmtp, if you send without internet connectivity, it will freeze mutt and then error, forcing you to save the message as a draft, and then remember to send it once online.

2
Schplaf:gentoo:•

I suppose it introduces a queue, like the scripts provided with msmtp (msmtp-runqueue.sh, etc.). Therefore emails can be "sent" offline, then sent when online.

1
floriplum•

Nicely timed since i am currently setting up my neomutt client.

Still im wondering what the difference between offlinesmtp and the msmtp-runqueue.sh script is(feature wise).

3
jsveOP:arch:•

I've described some of the feature differences in this comment: https://www.reddit.com/r/linux/comments/e9hyvi/introducing_offlinemsmtp/faka7pv/

1
Wolfizen•

Neat!

1
2cats2hats•

Is msmtp a replacement for ssmtp?

Thanks.

1
jsveOP:arch:•

It would appear to be, according to this: https://gitlab.com/muttmua/mutt/-/wikis/SendmailAgents

1
2cats2hats•

Thanks.

1