Set up msmtp to queue sent emails offline
To set up msmtpq I followed /usr/share/doc/msmtp/examples/msmtpq/README.msmtpq and the short section on msmtpq
of a blog post titled A simple mail transfer agent.
Below I describe the steps I took.
Copy the following files:
sudo cp /usr/share/doc/msmtp/examples/msmtpq/msmtpq /usr/local/bin/
sudo cp /usr/share/doc/msmtp/examples/msmtpq/msmtp-queue /usr/local/bin/
Update the following line in .muttrc:
set sendmail ="/usr/local/bin/msmtpq"
Add the following line in .muttrc:
set sendmail_wait = -1
Create:
$ mkdir .msmtp/mailqueue/msmtpq
$ touch .msmtp/mailqueue/msmtpq
$ echo > .msmtp/mailqueue/msmtpq << EOF
Q=~/.msmtp/mailqueue
LOG=~/.msmtp/log/msmtp.queue.log
You might need to update file permissions, check A simple mail transfer.
In /usr/local/bin/msmtpq update:
Q=~/.msmtp.queue
to:
Q=~/.msmtp/mailqueue
To test msmtpq, disconnect from the internet and send an email. Mutt should print Mail sent
on the prompt, at the bottom.
To check that the email was queued, run:
$ msmtp-queue
The terminal should print something like:
mail num=[ 1 ] id=[ 2024-06-13-18.11.00 ]
From: JD <j@d.com>
To: j@d.com
Subject: test msmtpq
Alias
In ~/.bash_aliases
I added:
alias queue='msmtp-queue'
I can pass the option msmtp-queue offers to the alias fine e.g. queue -h
.
✍✍✍✍✍✍✍✍✍✍✍✍✍✍
I do self-funded research and I'm writing a book.
> What's the book about?
About technologies and agency.
Meaning, technologies can foster agency. No doubt. But I am also asking:
Can usage of technologies give us a sense of empowerment while in fact undermining our abilities?
I posted a summary of the prologue on the homepage: https://yctct.com/
✍✍✍✍✍✍✍✍✍✍✍✍✍✍
personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki msmtp mutt