Last active
May 4, 2020 07:26
-
-
Save blues911/ea2f75b01e2640ff3707bc4ac96c63b5 to your computer and use it in GitHub Desktop.
sendmail with mailtrap.io (linux)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -s | |
cd /etc/mail | |
mkdir /etc/mail/auth | |
cd /etc/mail/auth | |
echo 'AuthInfo: "U:root" "I:mailtrap-username" "P:mailtrap-password"' > mailtrap-info | |
makemap -r hash mailtrap-info.db < mailtrap-info | |
cd .. [cd /etc/mail] | |
cp sendmail.mc sendmail-mailtrap.mc | |
nano sendmail-mailtrap.mc | |
# Add next lines before MAILER_DEFINITIONS | |
dnl # MAILTRAP FORWARDING | |
define(`SMART_HOST',`[smtp.mailtrap.io]')dnl | |
define(`RELAY_MAILER_ARGS', `TCP $h 2525')dnl | |
define(`ESMTP_MAILER_ARGS', `TCP $h 2525')dnl | |
define(`confAUTH_OPTIONS', `A p')dnl | |
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl | |
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl | |
FEATURE(`authinfo',`hash -o /etc/mail/auth/mailtrap-info.db')dnl | |
m4 sendmail-mailtrap.mc > sendmail.cf | |
service sendmail restart | |
echo "test" | sendmail [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment