Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Mail Server Test Fails

I've NEVER been able to configure a working mail server. I've followed the knowlege base document for setting-up a GMail account to perfection. Ubiquiti chat support is WORTHLESS as usual. They can't troubleshoot, only reference the knowlegebase article.

 

Things I have done:

 

1. I have tried both Outlook 365 as well as GMail SMTP settings. 

2. Most of my troubleshooting has been spent with GMail as that is the ONLY mail client Ubiquiti admits to support. 

3. I have 2-part authentication disabled on GMail to prevent the need for an App Password. 

4. I've tried with POP and IMAP both enabled. 

5. I've been using smtp.gmail.com as the mail server name. 

6. I've tried ports 465, 587, 25.

7. I've tried the Authentication Username as the entire GMail address, and just the first part in all lowercase. 

8. I've tried every combination of the above. 

9. I've tried multiple email addresses to send the test email to. 

10. I've tried with and without SSL checked with all combinations of the above. 

11. I left the "specify senders address" unchecked as per the KB article. 

 

I have NO IDEA why this is so hard. I'm missing something simple I'm sure, but I setup SMTP relays all day on different systems without issue. Not sure why this is so hard with Ubiquiti.  

 

HELP

Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails

[ Edited ]

I just tested this from a spare controller and Google blocked the controller from authenticating.

 

You need to enable "Less secure apps" (https://myaccount.google.com/lesssecureapps) on your google email account. (Or look in "Recent Devices" (https://myaccount.google.com/device-activity)  - it should list your controller as blocked - just tell it "That was me" and it'll unblock it)

 

For reference I used smtp.gmail.com as the server, <username>@gmail.com as the user name, and port 465 SSL

If you found this post helpful feel free to sprinkle some Kudos!
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

Thanks for your reply, but this doesn't seem to be the reason for my failures. 

 

I already had "Allow Less Secure Apps" enabled, and while I had a suspicious activity notification under devices and activity, if I click on that activity (which is my Mac Pro, not the Ubiquiti Cloud Controller) there is nowhere to grant access and I don't have issues accessing from my Mac Pro. I don't see any attempted authentication requests from Ubiquiti within GMail, so I'm assuming that the settings are still wrong somewhere. I am using the same settings presently that you tested with. 

Screenshot 2018-07-27 13.28.41.png
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

 
Screenshot 2018-07-27 13.28.32.png
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

 
Screenshot 2018-07-27 13.36.25.png
Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails

Yes those settings look identical to mine.

 

Can you try 'telnet smtp.gmail.com 465' from your controller to make sure nothing's blocked?

 

This controller is v5.9.16 - not sure if they've fixed anything lately regarding smtp.

If you found this post helpful feel free to sprinkle some Kudos!
Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails

You might have already tried this but you could create a new gmail account - leave it at default settings and as soon as you try to send from Unifi you should get a notification from Google. My iPhone popped up a message the instant I tried this on my account. If nothing else it should at least prove the Unifi controller is able to contact gmail's servers.

If you found this post helpful feel free to sprinkle some Kudos!
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

I have 10 sites, presently half on 5.7.23 and the other half on 5.8.24, but this has been an ongoing problem for over a year with no success on any site or version. 

 

I'm not sure how you run that command from the cloud controller. Can you direct me to the correct spot on the controller to perform this test? 

Emerging Member
Posts: 85
Registered: ‎01-27-2018
Kudos: 66
Solutions: 1

Re: Mail Server Test Fails

I had issues as well. I had to enable "Specify sender address" and enter the same as the username (ex. xxx@domain.com).

 

It's also worth mentioning that the Controller needs internet access and you have to make sure the Java app isn't being blocked. Are you running Windows or linux?

 

Good Luck!

Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails

I'm assuming your "cloud controller" is Linux (is it a cloudkey?) - you'll need to SSH into it to get to a command prompt. If you're using Windows you can use putty.exe, then type the telnet command into that. 

If you found this post helpful feel free to sprinkle some Kudos!
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

[ Edited ]

I tried enabling "Specify Sender", but still got error message. 

 

I use a CLoud Key at each site and use UniFi.UBNT.com (Cloud Cntroller) to access. 

 

 

Thanks

Screenshot 2018-07-27 14.17.54.png
Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails


@JMForster wrote:

 

I use a CLoud Key at each site and use UniFi.UBNT.com (Cloud Cntroller) to access. 

 


ok, that rules out connecting to the controller...

 

Instead, can you open a remote console on one of the APs - click the IP address in the controller's device list and it should open a console, then enter the telnet command I gave.

If you found this post helpful feel free to sprinkle some Kudos!
Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails

[ Edited ]

Another idea...

 

You could probably send smtp direct to the MX server for your domain;

 dig -t mx forster.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.47.rc1.el6_8.3 <<>> -t mx forster.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34947
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;forster.com.                   IN      MX

;; ANSWER SECTION:
forster.com.            300     IN      MX      20 mx.netidentity.com.cust.hoste                                         demail.com.
forster.com.            300     IN      MX      10 mx.netidentity.com.cust.hoste                                         demail.com.

Try entering  "mx.netidentity.com.cust.hostedemail.com" as the mail server, port 25, no SSL, no authentication and leave your destination address as the forster.com one.

 

If you found this post helpful feel free to sprinkle some Kudos!
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

Sorry this is being so difficult. I logged into a site, went to devices, clicked on ALL the IP addresses of the devices, that only produces "Property" panels to the right. 

Screenshot 2018-07-27 14.42.00.png
Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails

[ Edited ]

Looks like SSH isn't enabled.

 

Go to Settings, Site, and tick "Enable SSH authentication" - bear in mind it'll trigger a reprovision on all the devices. The ip addresses will turn blue when SSH is enabled on them after provisioning.

 

edit : you might want to try my other idea of sending direct to your domain's MX server first rather than messing with the SSH config of a site...

If you found this post helpful feel free to sprinkle some Kudos!
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

It's already enabled. 

 

 

 

Screenshot 2018-07-27 14.51.05.png
Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails

Sorry, my mistake - it actually "Enable advanced features" that you need enabling to get console access. Settings, Site, Services, Advanced Features.

If you found this post helpful feel free to sprinkle some Kudos!
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

That was already enabled too. 

 

FYI, I used the same credentials to setup the GMail account on Apple mail without issue. 

Screenshot 2018-07-27 15.01.00.png
Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 393
Solutions: 51

Re: Mail Server Test Fails

I bet you're on one of the old controller versions there? Advanced Settings lists "opening terminal after clicking on device's ip" in newer ones.

 

Can you try on one of your 5.8.24 controllers, or even better just try the direct-to-mx idea I detailed earlier?

If you found this post helpful feel free to sprinkle some Kudos!
Emerging Member
Posts: 83
Registered: ‎12-01-2017
Kudos: 4

Re: Mail Server Test Fails

Yes, you are correct. The site was only one version behind, but the newer 5.8.24 did support the one-click telnet. Super cool trick! 

 

See attached screen shot. I'm assuming that theirs no communication with the GMail server? 

 

I don't get it. I've done everything to enable the GMail account to work with SMTP. Apple mail can use the credentials. 

Screenshot 2018-07-27 15.11.46.png