Package: offlinemsmtp
Allows you to usemsmtpoffline by queuing email until you have an internet
connection.FeaturesRuns as a daemon and (at a configurable time interval) attempts to send the
mail in the queue directory.Drop-in replacement formsmtpin your mutt config.Only attempts to send the queued email message if it can connect to the
configured SMTP server.When a new email message comes into the queue and you are already online,offlinemsmtpwill send it immediately.Integrates with system notifications so that you are notified when mail is
being sent.Disable/enable sending of mail by the presence/absence of a file. This is
useful if you want to have some sort of "offline mode".InstallationUsingPyPi:pip install --user offlinemsmtpOn Arch Linux, you can install theofflinemsmtppackage from theAUR. For example, if you useyay:yay -S offlinemsmtpRun the daemon using systemdCreate a file called~/.config/systemd/user/offlinemsmtp.servicewith the
following content (if you installed via the AUR package, a service file was
already created for you in/usr/lib/systemd/userso you only need to do this
step if you want to customize the parameters passed to the daemon):[Unit]
Description=offlinemsmtp

[Service]
ExecStart=/usr/bin/offlinemsmtp --daemon

[Install]
WantedBy=default.targetThen, enable and startofflinemsmtpusing systemd:systemctl --user daemon-reload
systemctl --user enable --now offlinemsmtpUsageofflinemsmtphas two components: a daemon for listening to the outbox folder
and sending the mail when the network is available and a enqueuer for adding
mail to the send queue.To run the daemon in the current command line (this is useful for testing), run
this command::offlinemsmtp --daemonTo enqueue emails, use theofflinemsmtpexecutable without--daemon. All
parameters (with a few caveats described below inCommand Line
Arguments) are forwarded on tomsmtp. Anything
passed in via standard in will be forwarded over standard in tomsmtpwhen the
mail is sent.Configuration with MuttTo use offlinemsmtp with mutt, just replacemsmtpin your mutt configuration
file withofflinemsmtp. Here is an example:set sendmail = "offlinemsmtp -a personal"Command Line Argumentsofflinemsmtp accepts a number of command line arguments:-h,--help- shows a help message and exits.-o DIR,--outbox-directory DIR- set the directory to use as the outbox.
Defaults to~/.offlinemsmtp-outbox.-d,--daemon- run the offlinemsmtp daemon.-s,--silent- set to disable all logging and notifications.-i INTERVAL,--interval INTERVAL- set the interval (in seconds) at which
to attempt to flush the send queue. Defaults to 60.-C FILE,--file FILE- the msmtp configuration file to use.--send-mail-file FILE- only send mail if this file exists (defaults toNonemeaning that no file is required for mail sending to be enabled)All remaining arguments are passed tomsmtp. The-Cargument is
automatically passed tomsmtp.Anything after a special--argument will be passed tomsmtp. This allows
you to pass arguments that may conflict withofflinemsmtparguments tomsmtp.ContributingSee theCONTRIBUTING.mddocument for details on how to
contribute to the project.Other projectshttps://github.com/marlam/msmtp-mirror/tree/master/scripts/msmtpqueue- this
is included withmsmtp, but doesn't have all of the features that I want.https://github.com/dcbaker/py-mailqueued- looks cool, I didn't see it when I
was researching, but it's probably better than my implementation, even thought
I had a lot of fun doing mine.https://github.com/venkytv/msmtp-offline- it's written in Ruby.