skip to Main Content

I’m trying to set a cron-job for sending mail attachments from my cpanel server.
I found that Mutt is a great option.
However, I’m having difficulty due to this one error that keeps occurring again and again.

Whenever I try sending a mail I get this:

SASL authentication failed.
Could not send the message.

The following is my .muttrc file.

set from = [email protected]
set realname = "NAME"

#set smtp_url = smtp://[email protected]:587/
set smtp_url = "smtps://[email protected]:465/"
set smtp_pass = PASS
set imap_user = [email protected]
set imap_pass = PASS

set folder = imaps://imap.gmail.com:993
set spoolfile = imaps://imap.gmail.com/INBOX

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

# Etc
set mail_check = 100
set move = no
set imap_keepalive = 900
set sort = threads
set editor = "vim"

#source ~/.mutt/gpg.rc
set ssl_starttls=no
set ssl_force_tls=yes
set smtp_authenticators = "login"

set ssl_verify_host = no
set ssl_verify_dates = no

This may take a long time (probably won’t be solvable) and there might not be many people with this problem. But I feel that this thread might help others in the future

I’ve installed gnutils-bin and openssl

which gnutls-bin
/usr/bin/which: no gnutls-bin in (/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/cpanel/composer/bin:/usr/local/python3.6/bin:/usr/local/bin:/home/covid/.local/bin:/home/USERNAME/bin)

which openssl
/usr/bin/openssl

2

Answers


  1. I ran into the same thing, I had to change my muttrc config so that set realname=’name’ was exactly the same as the Name in that is in gmails Personal Info for the account.

    Also in Gmails Security “Less secure app access” needs to be set to ON

    Login or Signup to reply.
  2. Just a quick update, according to google support for security reasons "Allow less secure apps" is no longer availabe (see here), however, there is still a workaround, please see below:

    You might need to first enable MFA and then in your google account setting, under "Sign in to Google" select "App Passwords" (check out this google article if you don’t see this option on your google account: 185833)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search