I don't like waking up early but people prefer to be emailed in the morning rather than at 3AM. Therefore I often use at to send the email whilst I'm asleep.
But that comes with the complication that I need to write the email as a text file and send it with sendmail. I leave those not yet sent emails in Mutt's postponed mbox. Is there a way to use mutt to send that email?
OK, one way to send a mail later with mutt is the following:
echo 'cat /home/grochmal/body | mutt -s "mail" [email protected]' | at now + 12 hours
But I have that mail in the postponed mbox.
If I have only a single postponed mail, I can do this:
echo '/usr/sbin/sendmail -t <(cat /home/grochmal/mail/postponed | sed 1d)' | at now + 12 hours
But I often have several postponed emails in my postponed mbox, how do I select the one I want to send?
The relevant parts of my muttrc are:
set sendmail = "/usr/sbin/sendmail -oem -oi -f $EMAIL"
set folder = $HOME/mail
set record = +sent
set postponed = +postponed
My /usr/sbin/sendmail is just a softlink to the postfix wrapper.