tl;dr: make sure smtp_url definition starts as smtps.
I needed to set up access to a paid-for email provider, mailfence.com via mutt. Yes, they do have a web-based access, but real email users use mutt (and I’ve been using it since about 1998).
At least they are providing standard IMAP services which is the Right Thing and also support GPG signing and encryption built-in. I have not checked other providers, but for an email service to offer up standard GPG is a Big Win in my books.
I am writing this down more an as reminder to myself as well as a means of documenting how I got mutt to work with mailfence.
The most important thing to have set up right is the .muttrc file. Here’s what I’ve created for accessing mailfence.com.
### Hosts # set hostname=<MY NEW DOMAIN> ### Paths set mailcap_path="~/.mutt/mailcap-for-mutt:/etc/mailcap" set mbox=+read set record=+out set postponed=+postponed set signature="~/.mutt/signature" set tmpdir="/tmp" set alias_file=~/.mutt/aliases set header_cache="$HOME/.mutt/.mutt_header_cache-mailfence" ### IMAP Stuff set imap_user="<USERNAME>@mailfence.com" set imap_idle=yes set imap_pass="<PASSWORD>" #--- SSL Specific Settings set ssl_force_tls = yes ### External commands # set editor="vi" set visual="vi" set smtp_url = "smtps://<USERNAME>@email@example.com:465" set smtp_pass = "<PASSWORD>" set shell="/bin/sh" set use_from=yes set realname="Harish Pillay" set from=harish@<MY NEW DOMAIN> set envelope_from=yes ### PGP stuff # source ~/.mutt/pgp2.rc set pgp_auto_decode ### Save hooks # save-hook . +read ### Aliases / Addressbook # source ~/.mutt/aliases
Note carefully the “smtp_url” showing as “smtps://<USERNAME>@firstname.lastname@example.org:465”
It WILL NOT WORK if the url is “smtp://…”.
Only thing still pending is how the ‘b'(ounce) command works. Hitting ‘b’ to an email does pull in the mail and does send it out, but fails at the end of the sending. I use ‘b'(ounce) a lot so that the email remains intact in headers and is not one that is ‘f'(orwarded).