After a bit of wailing and gnashing of teeth, I got gmail working to relay my email from my freePBX server but I am not comfortable with the way I had to configure gmail to allow a “less secure app”
Is there a good alternative to using gmail or what can I do to use my own smtp server?
The doco from AWS is very clear. Just need to create a verified identify. In my case, I created a domain identify, which creates three CNAME records for DKIM. If your using Route 53, it may add the records to your zone file. That was the tricky part.
You need to create a sasl_passwd.db file and refer to that in the main.cf file.
The sasl_passwd file will contain the smtp endpoint on port 587 with the username and password you set up in the AWS SES console. You then run postmap on that file to create the hashed sasl_passwd.db file.
I’ll send my main.cf later. I need to see if there is anything I need to redact.
One thing I noticed after switching to AWS was that I’m getting many more fail2ban emails than I was when I was using Gmail as the relay. AWS seems more reliable.
Note, the smtp server name must match the relayhost
When you create your domain identity, it will create 3 CNAME records which you will put in your zone file. I used AWS Route 53 for my DNS server so it added them automatically.