On Fri, Aug 12, 2022 at 04:05:55PM +0200, Sébastien Hinderer wrote:
> Hello Sam, many thanks for your interesting response!

:)

> Sam Kuper (2022/08/11 17:43 +0000):
>> Consider using msmtp for sending, and msmtp-queue for queueing:
>>
>> https://lists.mutt.org/pipermail/mutt-users/Week-of-Mon-20210208/002485.html
> 
> My understanding is that, on one side, mutt would call msmtp-queue as
> a replacement for sendmail

Yes

> and that, on the other side, msmtp needs to somehow be called on a
> regular basis to try to send the messages that are in the queue, if
> network is available. Is this understanding correct?

`msmtp-queue -r` tells msmtp to try to send the emails from
msmtp-queue's queue to your mail provider's SMTP server.  In order for
that to succeed, you need to have a network connection - otherwise the
attempt will time-out and the queued mails will stay in msmtp-queue's
queue so that you can try again later.

So, you can:

-   Manually run `msmtp-queue -r` when you know you have an internet
    connection, or

-   Set up a cron-job to run `msmtp-queue -r` according to your
    preferred schedule (e.g. every 2 minutes), or

-   Some combination of the two (i.e. have a cron-job set up, but
    manually invoke `msmtp-queue -r` on occasions when you don't want to
    wait for the next cron time-point).

It's your choice.



> Also, given how important e-mail is, I am a bit worried about the
> transition: any advice on how to switch from exim4 to this new set-up
> as smoothly as possible and without risking to be unable to send
> e-mail for some time?

Here is what I would do in that situation:

-   Read msmtp and msmtp-queue's documentation.

-   Install and configure msmtp.

-   Test/tweak/re-test msmtp until working.  (E.g. using Mutt or GNU
    Mailutils's `mail` command to send emails from the command-line,
    with relevant command-line options set so as to ensure that msmtp is
    used as the MTA).  Hopefully it would work first time, if configured
    correctly and if your computer has a suitable internet connection.

-   Install msmtp-queue (it comes bundled with msmtp IIRC) and configure
    it, including setting up a cron-job if you want one.

-   Test/tweak/re-test msmtp-queue (similarly to testing msmtp).

-   Edit your muttrc to tell Mutt to use msmtp-queue instead of Exim.

-   Check to see if you have anything else installed that depends on
    Exim.

    -   If so, either leave it as is (probably) or find another solution
        for those things (if you really want to - but Exim is good for
        its intended use case).

    -   If not, then uninstall Exim.

Good luck!

Sam

Reply via email to