FreePBX 13 - Email connectivity troubleshooting

I’m having problems understanding why a FreePBX 13 install (from an ISO) won’t successfully send emails.

Here is what I see in /var/log/maillog (i’ve X’d out the actual valid email address / domains). Both from and to email addresses are google hosted, one is gmail, the other a registered domain. As you can see IP6 is disabled, only IP4 is setup and working.

Sep 5 15:40:33 localhost
postfix/pickup[15094]: 40ABF1216B1: uid=499 from=[email protected]

Sep 5 15:40:33
localhost postfix/cleanup[5912]: 40ABF1216B1: message-id=[email protected]

Sep 5 15:40:33
localhost postfix/qmgr[1589]: 40ABF1216B1: from=[email protected], size=981,
nrcpt=1 (queue active)

Sep 5 15:40:33
localhost postfix/smtp[5914]: connect to
gmail-smtp-in.l.google.com[2607:f8b0:400d:c07::1b]:25: Network is unreachable

Sep 5 15:41:03
localhost postfix/smtp[5914]: connect to gmail-smtp-in.l.google.com[173.194.204.27]:25:
Connection timed out

Sep 5 15:41:03
localhost postfix/smtp[5914]: connect to
alt1.gmail-smtp-in.l.google.com[2800:3f0:4003:c00::1a]:25: Network is
unreachable

Sep 5 15:41:03
localhost postfix/smtp[5914]: connect to alt1.gmail-smtp-in.l.google.com[64.233.190.27]:25:
Network is unreachable

Sep 5 15:41:03
localhost postfix/smtp[5914]: connect to
alt2.gmail-smtp-in.l.google.com[2a00:1450:400b:c03::1b]:25: Network is
unreachabletimed out

Sep 5 15:41:03
localhost postfix/smtp[5914]: connect to alt1.gmail-smtp-in.l.google.com[64.233.190.27]:25:
Network is unreachable

Sep 5 15:41:03
localhost postfix/smtp[5914]: connect to
alt2.gmail-smtp-in.l.google.com[2a00:1450:400b:c03::1b]:25: Network is
unreachable

Sep 5 15:41:03
localhost postfix/smtp[5914]: 40ABF1216B1: to=[email protected], relay=none,
delay=31, delays=0.01/0/30/0, dsn=4.4.1, status=deferred (connect to
alt2.gmail-smtp-in.l.google.com[2a00:1450:400b:c03::1b]:25: Network is
unreachable)

I can ping and nslookup all day long with no failures identified.

DNS entries in System Admin are
127.0.0.1, 8.8.8.8, 192.168.1.1 (last is my local gateway DNS)

System Admin - Hostname is the default ‘localhost.localdomain’

System Admin ‘From Address’ is set to the valid email address that I see in the maillog file as the ‘from’ address.

The firewall in FreePBX is currently disabled.

I tried temporarily DMZ’ing my FreePBX box IP address for a test to transmit a message thinking something might be getting blocked on the way in but that had no effect.

I’m not sure what the next step is to troubleshoot the timeouts. Any help would be greatly appreciated.

Are you using a free gmail account or paid gmail service.

It looks to me like it is trying to use port 25.

The email I’m trying to send to is a ‘free’ gmail account. Most of the accounts are a non-profile hosted domain on google. Yes, it does look to be attempting delivery on 25 but I can’t find any settings in FreePBS to change how email works.

are you using the Paid System Admin

No, this is the default FreePBX without any commercial modules.

ah ok… I recommend you purchase the sys admin module. It makes it a hell of a lot easier.

But why is this not working? I’ve had this working with previous versions without having to buy extra modules.

Is there a way to setup the config scripts to do this?

try this

By default the SMTP protocol runs at port no. 25.
You can change the port no. to any port no. other than below 2048.
0 to 2048 are IANA authorized known port no.but we have some other port no. also which are bydefault used by manyapplication for. eg. port no. 8080 for tomcat.
To know more about port number click this wikipedia UR

Here we are using Postfix as our MTA.
To change the smtp port no. in postfix,edit the master.cf file and change the given below value

vi /etc/postfix/master.cf
smtp inet n – n – – smtpd

change smtp word to your desired port no. Here I am changing it to 9267

9267 inet n – n – – smtpd

Now restart the postfix

/etc/init.d/postfix restart

Check the port no. status with netstat command

[root@localhost postfix]# netstat -tanp|grep 9267
tcp 0 0 0.0.0.0:9267 0.0.0.0:* LISTEN 9788/master
[root@localhost postfix]#

You can also try this

or Like Tony Lewis said in that post

Or for 25.00 you can buy sysadmin pro which will do all this for you with just defining your gmail info in the GUI.

Thanks for the link on the gmail relay. Seems like it is simple enough. I was looking at the # INTERNET OR INTRANET section of the main.cf earlier today bug wasn’t able to put the pieces together to get anything to work. The article seems to fill in the missing pieces I believe.

I am testing is as we speak. But honestly I would just spend the 25$ and buy the module.

It is well worth the money and helps keep the Distro Going.

Just got it working after working through the first article. Was able to send a couple emails from the command line. Tested from the user manager page and received a voicemail attachment. All looks good!

Thanks a ton for the information.

And its still working through a backlog of test messages :wink:

Great and No Problem Glad I could help