[neomutt-users] Does smtp_user ever get used?
Andrew Sullivan
ajs at anvilwalrusden.com
Fri May 15 18:31:54 CEST 2020
Hi,
I continue to struggle to get my .muttrc working the way it used to
do. I appreciate the efforts of the developers, and I don't mean this
as a criticism, but it seems to me that perhaps there are not quite as
many unit tests as might be desirable given the changes that I gather
must be going on. At the same time, I am perfectly prepared to
believe that my configuration used to work by accident, and that it
needs to be made to work according to the docs.
So, I thought I'd try troubleshooting with a totally bare-bones
config.
Sorry this is a little long, but I wanted to post all the relevant
stuff I could.
The only things I have in this config are this, so everything else is
default (passwords and so on redacted, obviously):
---%<---cut here---
account-hook . 'unset imap_user; unset imap_pass; unset smtp_url; unset tunnel;'
#accounts
account-hook imaps://mx5.yitter.info/ 'set imap_user="ajs at crankycanuck.ca"; set imap_pass="PASSWD1"'
account-hook smtp://mx5.yitter.info:587/ 'set smtp_user="ajs at crankycanuck.ca"; set smtp_pass="PASSWD1"'
account-hook imaps://outlook.office365.com 'set imap_user="WORKMAIL"; set imap_pass=PASSWD2'
account-hook smtp://smtp.office365.com:587/ 'set smtp_user="WORKMAIL"; set smtp-pass="PASSWD2"'
# set up for crankycanuck on mx5
named-mailboxes cranky-mx5-in imaps://mx5.yitter.info/INBOX
# set variables for any mail on mx5.
folder-hook 'imaps://.*@mx5\.yitter\.info/.*' set reverse_name; set from=ajs at anvilwalrusden.com; set folder="imaps://mx5\.yitter\.info/"; set record="+sent-mail.`date +%Y.%m`"; set spoolfile=imaps://mx5.yitter.info/INBOX'
# set up crankycanuck sending on mx5
send2-hook '~f .*@crankycanuck\.ca$' 'set signature=~/.mutt/.signature-cranky; set hostname=crankycanuck.ca; set smtp_url="smtp://mx5.yitter.info:587/"; set folder="imaps://mx5\.yitter\.info/"'
send2-hook '~f .*@anvilwalrusden\.com$' 'set signature=~/.mutt/.signature-anvil; set hostname=crankycanuck.ca;set smtp_url="smtp://mx5.yitter.info:587/"; set folder="imaps://mx5\.yitter\.info/"'
# work mail
named-mailboxes isoc-in imaps://outlook.office365.com/INBOX
folder-hook 'imaps://WORKMAIL@outlook\.office365\.com/.*' 'set hostname=WORK; set reverse_name; set from=WORKMAIL; set folder="imaps://outlook\.office365\.com/";set record="+sent-mail-`date +%Y-%m`"; set spoolfile=imaps://outlook.office365.com/INBOX'
send2-hook '~f WORKMAIL' 'set signature=~/.signature-WORK; set hostname=outlook.office365.com; set smtp_url="smtp://smtp.office365.com:587/"; set folder="imaps://outlook\.office365\.com/"
---cut here--->%---
When I start up, here's what displays when I do "set":
---%<---cut here---
set alias_file = "./.muttrc-accounts.min"
set folder = "imaps://mx5.yitter.info/"
set from = "WORKMAIL"
set imap_pass = "PASSWD2"
set imap_user = "sullivan at isoc.org"
set mbox = "~/mbox"
set postponed = "~/postponed"
set record = "imaps://mx5.yitter.info/sent-mail.2020.05"
set spoolfile = "imaps://mx5.yitter.info/INBOX"
set tmpdir = "/var/folders/p6/x273422d61gbwc_10m_klnqc0000gp/T"
---cut here--->%---
This is _approximately_ what I'd expect. It isn't clear to me why,
but when I start under these circumstances the
imaps://mx5.yitter.info/INBOX is the one I get. (Given the order of
the named-mailboxes command, I'd actually have expected the second
one, but I'm not going to worry about that now.) The folder, from,
record, and spoolfile are all being set by the has been set by the
appropriate folder-hook. The imap_pass and imap_user have been set by
whatever account_hook happened to run last, which is probably the work
one given the order in the file.
I turn on debugging so I can attach the below logfile. I compose a
mail.
After I compose the mail, I have this:
---%<---cut here---
set alias_file = "./.muttrc-accounts.min"
set debug_file = "~/.neomutt-debug-wkg02"
set debug_level = 3
set folder = "imaps://mx5.yitter.info/"
set from = "ajs at anvilwalrusden.com"
set hostname = "crankycanuck.ca"
set imap_pass = "PASSWD2"
set imap_user = "WORKMAIL"
set mbox = "~/mbox"
set postponed = "~/postponed"
set record = "imaps://mx5.yitter.info/sent-mail.2020.05"
set signature = "~/.mutt/.signature-anvil"
set smtp_url = "smtp://mx5.yitter.info:587/"
set spoolfile = "imaps://mx5.yitter.info/INBOX"
set tmpdir = "/var/folders/p6/x273422d61gbwc_10m_klnqc0000gp/T"
---cut here--->%---
This has added a few of the things from the send2-hook. (FWIW, I
tried this with a send-hook, too. Send-hook actually works better
initially, which makes me think it's the right thing, but either one
seems good enough to demonstrate what I'm trying to show.)
The problem is that smtp_pass and smtp_user is not yet set. Now, the
manual says of account-hook, "This hook works like folder-hook but is
invoked whenever NeoMutt needs to access a remote mailbox (including
inside the folder browser), not just when you open the mailbox." But,
when I send the mail, it doesn't work. I get "SMTP session failed:
554 5.7.1 <caloric at gmail.com>: Relay access denied", and the log says this:
---%<---cut here---
2020-05-15 12:07:30]<M> mutt_send_message() Sending message...
[2020-05-15 12:07:30]<3> mutt_buffer_mktemp_full() send.c:1371: mutt_mktemp returns "/var/folders/p6/x273422d61gbwc_10m_klnqc0000gp/T/neomutt-ISOC-S3HV2J-502-78159-16960525481330012227"
[2020-05-15 12:07:30]<1> mutt_account_hook() account-hook '.' matches 'smtp://mx5.yitter.info:587/'
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<1> mutt_account_hook() account-hook 'smtp://mx5.yitter.info:587/' matches 'smtp://mx5.yitter.info:587/'
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<2> mutt_window_reflow() entering
[2020-05-15 12:07:30]<M> raw_socket_open() Looking up mx5.yitter.info...
[2020-05-15 12:07:30]<M> raw_socket_open() Connecting to mx5.yitter.info...
[2020-05-15 12:07:30]<2> mutt_socket_open() Connected to mx5.yitter.info:587 on fd=10
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 220 mx5.yitter.info ESMTP Postfix (Ubuntu)
[2020-05-15 12:07:31]<2> mutt_socket_write_d() 10> EHLO crankycanuck.ca
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250-mx5.yitter.info
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250-PIPELINING
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250-SIZE 102400000
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250-ETRN
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250-STARTTLS
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250-ENHANCEDSTATUSCODES
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250-8BITMIME
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250-DSN
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 250 SMTPUTF8
[2020-05-15 12:07:31]<2> mutt_socket_write_d() 10> STARTTLS
[2020-05-15 12:07:31]<2> mutt_socket_readln_d() 10< 220 2.0.0 Ready to start TLS
[2020-05-15 12:07:31]<2> ssl_load_certificates() loading trusted certificates
[2020-05-15 12:07:31]<1> ssl_setup() Error loading trusted certificates
[2020-05-15 12:07:32]<1> ssl_verify_callback() checking cert chain entry /O=Digital Signature Trust Co./CN=DST Root CA X3 (preverify: 1 skipmode: 0)
[2020-05-15 12:07:32]<1> ssl_verify_callback() checking cert chain entry /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3 (preverify: 1 skipmode: 0)
[2020-05-15 12:07:32]<1> ssl_verify_callback() checking cert chain entry /CN=mx5.yitter.info (preverify: 1 skipmode: 0)
[2020-05-15 12:07:32]<2> ssl_verify_callback() hostname check passed
[2020-05-15 12:07:32]<2> mutt_socket_write_d() 10> EHLO crankycanuck.ca
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250-mx5.yitter.info
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250-PIPELINING
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250-SIZE 102400000
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250-ETRN
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250-AUTH PLAIN LOGIN
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250-ENHANCEDSTATUSCODES
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250-8BITMIME
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250-DSN
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250 SMTPUTF8
[2020-05-15 12:07:33]<2> mutt_socket_write_d() 10> MAIL FROM:<ajs at anvilwalrusden.com>
[2020-05-15 12:07:33]<2> mutt_socket_readln_d() 10< 250 2.1.0 Ok
[2020-05-15 12:07:33]<2> mutt_socket_write_d() 10> RCPT TO:<caloric at gmail.com>
[2020-05-15 12:07:34]<2> mutt_socket_readln_d() 10< 554 5.7.1 <caloric at gmail.com>: Relay access denied
[2020-05-15 12:07:34]<E> smtp_get_resp() SMTP session failed: 554 5.7.1 <caloric at gmail.com>: Relay access denied
[2020-05-15 12:07:34]<2> mutt_window_reflow() entering
---cut here--->%---
It's clear that the account-hook gets invoked, because after this
failure running ":set" shows the correct smtp_pass and smtp_user. But
there's no effort to authenticate to the submission service so that
the mail can be sent.
I find that if I put the user name and password into the smtp_url
everywhere that URL is needed, it works, but this means having the
password for smtp scattered all over the place rather than in one
well-contained file.
This makes me wonder whether the smtp_user and smtp_pass actually can
ever work: if the variables are set but the SMTP connection never
tries AUTH, it doesn't seem like they have any effect.
I'm sure I'm overlooking something. But I can't figure out what it
is.
Best regards,
A
--
Andrew Sullivan
ajs at anvilwalrusden.com
More information about the neomutt-users
mailing list