I'm trying to send and e-mail from mutt from command line using following command:

mutt -F /my/path/to/muttrc -s "Hello" [email protected] < test.txt

But nothing happens. Mutt doesn't display any error but mail it's not sent.

Everything works fine if I enter interactive mutt using mutt command and send the e-mail from there.

In my muttrc I have configured a gmail account, like this:

account-hook    imaps://[email protected] 'set [email protected] imap_pass="password"'
folder-hook     'imaps://[email protected]' 'set folder=imaps://[email protected]/'
set folder=imaps://[email protected]/
mailboxes +INBOX
set spoolfile = +INBOX
folder-hook    imaps://[email protected] 'set smtp_url="smtps://a_user:[email protected]"'
folder-hook     'imaps://[email protected]' 'set [email protected]'
folder-hook    imaps://[email protected] 'set realname="A Real Name"'

set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates
unset record
set timeout=15
set mail_check=60
set imap_keepalive = 900
unset imap_passive
set move = no
set sort = 'last-date-received'
set charset=utf-8
set locale=$LANG
send-hook "~f [email protected]" 'set signature="~/.mutt/signature"'
set editor = 'vim'

1 Answer 1


Looks like you're setting smtp_url only in a folder-hook. That means that its only set when you use that folder, and when you're using the non-interactive command line method, it never actually tries to access the folder, so smtp_url isn't ever set, so it has no idea what method to send messages. It might be defaulting to some other method (like piping to sendmail) and failing.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .