Continuous use of mutt

mutt

I would like to use mutt continuously, allow me to explain what I mean with an example. My typical workflow is this:

  • Open up mutt
  • Compose a message
  • Press y to confirm send action
  • wait!
  • Compose another message
  • Press y to confirm send action
  • wait!

I am connected to my Gmail over IMAPS.

The problem is that often I need to reply to many messages in sequence and the pattern above is obviously unacceptable because the program does not return control to me whilst it is trying to deliver the message in the background. My time is valuable and I can't be waiting for a machine to do its job after I expressed my intent (to send) to it already, can I?


  • Can I configure mutt so that it does the message delivery in the background, immediately returning control to me to compose more messages?

My current workaround to this is running mutt within a tmux session with multiple windows, all running tmux and switching to another window to compose the next message as the previous is being delivered. This is a bad kind of "hack", I say.

My settings:

  • smtp_url="smtps://robottinosino@smtp.googlemail.com:465/"

# Gmail configuration
set  folder            =  "imaps://imap.googlemail.com:993"
set  spoolfile         =  "imaps://imap.googlemail.com:993/[Gmail]/All Mail"
set  postponed         =  "imaps://imap.googlemail.com:993/[Gmail]/Drafts"
# set  record          =  "imaps://imap.googlemail.com/[Gmail]/Sent Mail"
set  record            =  "/home/tinosino/Sent_Messages.txt"
set  realname          =  "Tino Sino"
set  imap_user         =  "robottinosino@gmail.com"
set  imap_pass         =  ""
set  smtp_url          =  "smtps://robottinosino@smtp.googlemail.com:465/"
set  smtp_pass         =  ""
set  from              =  "robottinosino@gmail.com"
set  sort              =  threads
set  editor            =  "vim"

What I have tried already:

  • I set sendmail_wait = -1 but the delay in sending a message remains

Best Answer

Generally there are three different ways of sending mail with Mutt:

  • Using SMTP directly from within Mutt. This is what you are doing by specifying smtp_url. In this case Mutt will connect to smtp.googlemail.com and deliver through SMTP.

  • Using a sendmail program which will directly deliver the mail through an SMTP connection and only return after it's done. msmtp is an example of this type of program. You can set Mutt's sendmail_wait variable to specify how long it will wait for sendmailto return before giving up and putting delivery into the background.

  • Using and MTA which can do local queueing, e.g. Postfix. The sendmail program will usually return almost immediately when Postfix has added the mail to its local queue. You can configure Postfix to use Gmail as an SMTP relay, it will then forward all (non-local) mails to Gmail in the background.

Related Question