Use case. A typical use case is the following: You have a notebook or a workstation without a full-fledged MTA (e.g., postfix) installed, but something like msmtp, esmtp, or ssmtp, which only forward the mail to an SMTP server. Such lightweight SMTP clients typically do not feature a mail queue.1 In case that your SMTP client cannot connect to the SMTP server, the mail is lost2.
Smailq implements a mail queue and uses MSAs like msmtp to actually deliver mails. It also comes with shell scripts sendmail and mailq that wrap around smailq. Note that typical Unix-type software (e.g., cron, caff, etc.) uses /usr/sbin/sendmail to send mails. Hence, if cron informs the administrator of an error while the notebook is offline, the mail is inserted into the queue instead of being dropped.
By default, smailq looks at $HOME/.smailq.conf and /etc/smailq.conf (in that order) for a configuration file, unless the configuration file is explicitly specified by an option. A configuration file with its default values would look like this:
You may obtain a copy of the git repository of smailq by
or you can simply download the latest tarball.
Installation is done by simply calling make install in the source directory as a privileged user.
If you use Gentoo Linux, then you may get a copy of my Gentoo overlay. Besides mail-mta/smail, the overlay also contains a virtual/mta ebuild that takes smailq into account. If some package is depending on an mta, Gentoo portage will enforce that virtual/mta is installed, which will again pull-in a concrete package that provides /usr/sbin/sendmail. This would lead to a conflict when installing smailq by hand. Hence, it is recommended to use the respective ebuilds.
msmtp for instance ships shell scripts that implement a simple queuing mechanism around msmtp. However, /usr/sbin/sendmail is still a symlink to /usr/bin/msmtp and, thereby, Unix-type software like cron would trust that msmtp queues mails that cannot be delivered right now. ↩
It would be the responsibility of the caller of the SMTP client to queue mails, which is typically not the case. ↩