Mutt - Could not connect to smtp.gmail.com (Interrupted system call)
Asked Answered
N

1

5

Thought I would try out Mutt on Ubuntu and after trying to get it to work for a couple days now I'm stuck on this error.

Could not connect to smtp.gmail.com (Interrupted system call).

I've looked all over the internet trying to figure out how to fix it but I can't find anything that will fix it. The ~/.mutt and ~/.mutt/cache/ folders are created. I don't think there's an issue with msmtp because it's not adding anything to the log file.

here's my .muttrc without my passwords of course:

set imap_user = "<my_email>@gmail.com"
set imap_pass = "<my_password>"
set smtp_url = "smtp://<my_email>@smtp.gmail.com:587/"
set smtp_pass = "<my_password>"
set from = "<my_email>@gmail.com"
set realname = "<my_name>"
set sendmail="/usr/bin/msmtp"

set header_cache =~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
set certificate_file =~/.mutt/certificates

set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set trash = "imaps://imap.gmail.com[Gmail]/Trash"

#======================================================#
# Order of headers and what to show
hdr_order Date: From: User-Agent: X-Mailer \
          To: Cc: Reply-To: Subject:
ignore *
unignore Date: From: User-Agent: X-Mailer  \
         To: Cc: Reply-To: Subject:

#======================================================#
# which editor do you want to use? 
# vim of course!
set editor="vim -c 'set tw=70 et' '+/^$' "
set edit_headers          # See the headers when editing

and my .msmtprc

account default
host smtp.gmail.com
port 587
from "<my_email>@gmail.com"
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on
user "<my_email>@gmail.com"
password "<my_password>"
logfile ~/.msmtp.log

now here's the really weird stuff... mutt is able to get new emails as well as when I postpone an email it saves it as a draft in gmail and uploads it to the gmail server. Thanks.

Niemeyer answered 7/9, 2014 at 19:13 Comment(1)
"now here's the really weird stuff... mutt is able to get new emails" - Getting new mails and saving drafts is done with IMAP against imap.gmail.com. So problems affecting the sending through smtp.gmail.com do not affect retrieving.Frae
N
10

After many more days of searching I found the solution. I needed to change the smtp url to:

set smtp_url="smtps://<username>@smtp.gmail.com:465/"

emails send just fine now!

Niemeyer answered 10/9, 2014 at 21:17 Comment(2)
by the way, this question is better suited to && might've gotten more replies on: unix.stackexchange.comPolysyllable
In case it helps anybody: my smtp_url did not include a port and that worked fine from my home network. Later when I used the same computer but from a different network, I could not get neomutt to send messages until added :587 explicitly.Holp

© 2022 - 2024 — McMap. All rights reserved.