FOOD FOR THOUGHT Replacing sendmail with msmtp

kcallis

Member
Joined
Oct 23, 2007
Messages
180
Reaction score
8
I have been trying to get a message out from the PBX to no luck. I have been using the msmtp and mbsync for years on my machines with no problems in sending and receiving mail from gmail. If I moved over to msmtp would that cause any issues with other components that make up IPBX?
 
Never used msmtp on a FreePBX box, but should be fine. Normal caveats about msmtp not queuing apply - but assume your aware of such limitations if your using it.
 
After looking at my config file, I realized that I had misspelled my user name. Problem averted, but I still would rather use msmtp for a couple of reason, for instance being to encrypt my password in the msmtp config file.
 
After looking at my config file, I realized that I had misspelled my user name. Problem averted, but I still would rather use msmtp for a couple of reason, for instance being to encrypt my password in the msmtp config file.
Whatever makes you comfortable, but is there any real benefit over chmod 600 on the config file? If someone with access wants the password, they'll be able to get it.
 
message out from the PBX to no luck
I noted thaton the latest RPi IncrediblePBX2020.3 Tutorial uses Exim4 as the mta for sendmail. Followed those instructions worked a treat. the but is wards build setup includes the install and there is an update command script (for debian) /usr/sbin/update-exim4.conf

I havent tried msmtp but dont like sendmail much, and I assume you use other platform. Regards
 
Yes, exim4 ships with Raspbian 10, and it's very easy to set up compared to SendMail.

Configuring Gmail as Exim Smart Relay Host

Most Raspberry Pi implementations will be on networks managed by companies like Comcast, Spectrum, and AT&T that block downstream mail servers (that’s you) from sending email. The solution is to use Gmail or your local ISP as a smart relay host to send mail from your server. You’ll need this to deliver voicemails via email. Here’s how to set it up using a Gmail account without two-step authentication. Log into your server as root and run dpkg-reconfigure exim4-config. Choose "mail sent by smarthost; received via SMTP or fetchmail." Accept all the defaults until you get to Outgoing Smarthost prompt. Enter: smtp.gmail.com::587. At the following prompts, choose NO, NO, mbox, and NO. When the setup completes, edit /etc/exim4/passwd.client and insert the following line using your Gmail AcctName and AcctPW. NOTE: If you are using a Gmail account with 2-step verification enabled, you MUST use a Gmail App Key instead of your Gmail account password. You also must enable Less Secure Apps access to your Gmail account.

smtp.gmail.com:[email protected]:AcctPW

Save the file and then issue the following commands to complete the setup:

update-exim4.conf
systemctl restart exim4
exim4 -qff

Now send yourself a test email message to make sure things are working properly:

echo "test" | mail -s testmessage [email protected]
 
I believe I have followed the above exactly, but I am not able to send email using the gmail relay. Please let me know what I can do to provide more information to correct.

Receiving this in log:
Reporting-MTA: dns; TaxTimePBX

Action: failed
Final-Recipient: rfc822;k**.***@gmail.com
Status: 5.0.0
Remote-MTA: dns; smtp.gmail.com
Diagnostic-Code: smtp; 530-5.7.0 Authentication Required. Learn more at
530 5.7.0 https://support.google.com/mail/?p=WantAuthError 10sm1687232oip.2 -$

--1586546840-eximdsn-1487241256

I have disabled 2 part authentication and allowed less secure apps in my google account and have confirmed that passwd:client is correct.
 
Last edited:

Members online

Forum statistics

Threads
26,687
Messages
174,411
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top