and configure SMTP options for Gmail, Yandex or custom SMTP server…

In this tutorial we will install latest mutt (on day: 31/03/2017) from source, configure it only for email sending (no receiving or other thing) over SMTP and with SSL and use it. We doing this in CentOS 7 Minimal Linux so maybe some of packages you already have.

# Install dependencies
yum install wget gcc ncurses-devel openssl-devel cyrus-sasl-devel perl cyrus-sasl-plain

############## Variables ##############
# (version of mutt-a) #
# http://www.mutt.org/download.html #
#######################################
MUTT_VERSION="1.8.0"
#######################################

# Download and prepare
cd /usr/src
wget ftp://ftp.mutt.org/pub/mutt/mutt-${MUTT_VERSION}.tar.gz
tar zxvf mutt-${MUTT_VERSION}.tar.gz
rm -f mutt-${MUTT_VERSION}.tar.gz
cd mutt-${MUTT_VERSION}/

# Start with install - and only with needed options for mail send over SMTP
./configure --prefix=/usr --sysconfdir=/etc \
--enable-smtp \
--with-ssl \
--with-sasl \
--with-gss \
--with-gnutls \
--with-docdir=/usr/share/doc/mutt-${MUTT_VERSION} \
--enable-debug
#
make
make install

Create new .muttrc config for email servers which you use

touch ~/.muttrc
chmod 700 ~/.muttrc
vi ~/.muttrc

Gmail/Google Apps .muttrc config

################ Config za Google / Google Apps SMTP ####################
set from = "your-email-on-google-appsu-or-gmail@your-domain-or-gmail.com"
set realname = "Full name"
set smtp_url = "smtp://your-email-on-google-appsu-or-gmail@your-domain-or-gmail.com@smtp.gmail.com:587/"
set smtp_pass = "Password for your Gmail/GoogleApps email account"

Yandex .muttrc config

###################### Config za Yandex SMTP ############################
set from = "your-email@yandex.com"
set realname = "Full name"
set smtp_url = "smtps://your-email@yandex.com@smtp.yandex.com:465/"
set smtp_pass = "Password for your Yandex email account"

Custom, Shared hosting, cPanel with SSL-om .muttrc config

########## Config za Shared hosting, cPanel, with SSL ###################
set from = "your-email@your-domain.com"
set realname = "Full name"
set smtp_url = "smtps://your-email@your-domain.com@tvoj-email-server:465/"
set smtp_pass = "Password for your cPanel email"
unset ssl_verify_host

Sending check
echo "Everything is OK" | mutt -s "TEST email - mutt SMTP" your-email@current-mail.com

Fuente: kompjuteras.com