TUTORIAL Install gMail as SMTP SmartHost for SendMail

biggy213

New Member
Joined
Jan 5, 2009
Messages
6
Reaction score
0
I followed the instruction but no joy. I am not getting any mail from Incredible PBX-FAX 13-12.2 for SL 6.7? Any suggestions?
 

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,629
Reaction score
520
NOTE: On Ubuntu, Debian, and Raspberry Pi, you may get errors restarting SendMail.
This code was needed because the 'sendmail-cf' directory is missing on these Debian/Ubuntu as sendmail/cf directory was used ; however
The 1st sed code line has a delimiter missing - substitute the following line and you're good:
Code:
sed -i 's|sendmail-cf|sendmail\/cf|' /etc/mail/sendmail.mc
 

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,629
Reaction score
520
make sure all of the prerequisite packages are in place
that also could be to do with permissions (chmod 640 ...) for the files referred to?
genericstable genericstable.db client-info client-info.db


makemap -r hash client-info.db < client-info
 

boilermanc

New Member
Joined
Jul 7, 2011
Messages
29
Reaction score
2
Thanks ward, i had to do a apt-get update and then reinstall sendmail. that got me back on track. i now find there is a file:

sendmail.mc.gmail

how does that play into the setup now?
 

rogerjbos

Member
Joined
Mar 27, 2015
Messages
46
Reaction score
5
Make sure and check your ports if you are on the cloud...

I had a working setup for testing, and then I went to deploy it a few months later, the emails had stopped working. I spent many hours trying to fix it by going through many tutorials before I went to the cloud provider and asked them if they were blocking port 587. They were. Once they opened it everything worked great, but it wasted a lot of my time... lesson learned.
 

JoeOIVOV

Member
Joined
Sep 14, 2018
Messages
55
Reaction score
15
Its easier to configure if you have your own SMTP relay, that way your not sending your data through Google. I use Microsoft Exchange Server and by default it will accept relayed mail from incrediblepbx without any modifications.

Add SMTP Relay
1. Edit Sendmail Make file /etc/mail/sendmail.mc:

nano /etc/mail/sendmail.mc

2. Edit the following line:

dnl define(`SMART_HOST', `MAIL.DOMAIN.COM')dnl

3. Remove the following lines as they are not needed, it defaults to port 25:

define(`RELAY_MAILER_ARGS', `TCP $h 587')
define(`ESMTP_MAILER_ARGS', `TCP $h 587')

4. Remove the following lines if Authentication is not needed for internal relay as in my case:

FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

5. Change the following lines:

MASQUERADE_AS('DOMAIN.com')dnl
dnl MASQUERADE_DOMAIN(DOMAIN.com)dnl
MASQUERADE_DOMAIN(DOMAIN.com)dnl

6. Save file and exit.

7. Regenerate SendMail Configuration File /etc/mail/sendmail.cf:

/etc/mail/make

After this you can send the test mail:

echo "test" | mail -s NotifyTest [email protected]

and instead of the mail arriving from [email protected] it arrives from root@{incrediblepbx.hostname.com} or asterisk@{DOMAIN.com}and never leaves your domain. This means that fax receipts and voicemails will also use this same mail server. I prefer to use my own mail server instead of GMAIL, here are the instructions I setup to apply after following the steps on the first page.
 
Last edited:

Members online

No members online now.

Forum statistics

Threads
25,812
Messages
167,763
Members
19,241
Latest member
bellabos
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.
Top