No wait for email sending via slow SMTP

sunnavy
2011-07-13 07:39:59 +0000

How many seconds do you usually wait after typing 'y' in Mutt to send an email? I wait for 10 seconds or so normally, sigh.

So I chose to speed this up by sending emails to a directory first via sendmail-todir, then doing the real sending via sendmail-fromdir.

First tell mutt to use sendmail-todir

# in .muttrc
set sendmail="sendmail-todir --dir /home/sunnavy/.mail_to_send"

sendmail-fromdir is a bit complex, so we need a config file:

dir: /home/sunnavy/.mail_to_send
smtp_options:
    sasl_username: 'alice@example.com'
    sasl_password: '*******'
    host: 'smtp.example.com'
    ssl: 1
    port: 465
refresh: 3 # loop forever and wait 3 seconds after each loop; 0 means no loop
on_error: /path/to/notify/cmd # the only argument is the error msg
die_on_error: 1 # die on sending error
sendmail-fromdir --config /path/to/config

With this, I don't need to wait any more ;)