Configuring MSMTP with gmail as a mail transfer agent
This is an easy-to-setup alternative to postfix or sendmail configuration. The instructions have been written for Debian but should be easy to adjust for other Linux distributions.
Instructions
Log in as root and issue the following command:
apt install msmtp-mta bsd-mailxCreate the file
.msmtprcinside home of asterisk usercat <<HERE > ~asterisk/.msmtprcaccount defaulthost smtp.gmail.comport 587protocol smtpauth onfrom YOUR_GMAIL_ACCOUNT@gmail.comuser YOUR_GMAIL_ACCOUNT@gmail.compassword YOUR_PASSWORDtls ontls_starttls ontls_certcheck offHERESet correct permissions
chown asterisk:asterisk ~asterisk/.msmtprcchmod 600 ~asterisk/.msmtprcSend a test email from CLI (under
asteriskuser)echo "test email" | mail -s test_email OTHER_EMAIL@SOME_PROVIDER.comTest sending email from FreePBX
Return to Documentation Home | Sangoma Support