Email settings for freepbx

I am unable to get voicemail to email to work. Emails are sent by the system but are not received at my email address. My email provider is who tell me that the Internal SMTP details are blocked because of the following reason
" I have taken a look and can see that the sending IP is listed on SpamHaus, which is a spam blacklist that we use."
I therefore tried to setup the external server but I am unable to obtain the reverse DNS of my system using hostname.
Hover further recommend setting an SPF record on my DNS but where in the settings can I do that?
I have checked several other sites for help but no-one else seems to have this difficulty.
A search for email here produces no results.
Any advise please.

Here, it’s a Dutch article. But it’s pretty clear (use Google translate)

I can help you if necessary

Thank you for your reply. The SPF material is helpful but my problem starts more basic than that.
Trying to set up email external server. I purchased the System ADmin module for a small fee thinking it would be easier to use. I am unable to get a response for Reverse DNS from the CLI trying hostname produces no output.
Any suggestions?

What is your actual SMTP setup for the PBX right now? What is currently configured. You need to provide some details.

Thanks for your interest
SMTP External
Hostname empty
Origin freepbx.local
Provider Other
SMTP Server
Use Authentication
SASL Disable security
Username [email protected] (one of my email addresses
Password xxxxxxxx
Emails reported by debug as sent but never arrive as normal, junk or spam

Many thanks

Well your server setup is a bit of a mess. The hostname should be set properly, the origin as well.

In regards to your DNS, you need to have proper rDNS for this. So if the hostname is then you need a proper rDNS entry. If you’re hosting a VM with someone they should allow you to set this on the IP they supplied you because if your rDNS is set to the default ARPA address the hosts set on their IPs that is a red flag to blacklist systems like SpamHaus.

You should also have a proper SPF record to match said DNS entry and IP for sending mail from. Improper or missing SPF is also a red flag. Right now your SMTP setup is a red flag raising mofo for places like SpamHaus.

Finally, once you have all this in place and confirmed it’s resolving/working right (you can use for that) you will need to request removal of your IP from SpamHaus. You may also want to check if you are listed anywhere else. Again, can help you check this.

1 Like

Thanks for reply. I am struggling with this as these settings are all new to me. I checked on mxtoolbox and I have no spam listing at all. The internal server settings are though so listed that is
the default internal settings.
Anyway moving on 1 Can I just choose as hostname? Then how do I get the rDNS?
My email web address is should that be the server hostname?
Even with the Dutch article I am not able to know how to set SPF record so any help there would also be valuable.

Many thanks

Alright, so here’s what I suggest

  1. Set the hostname of the PBX to

  2. Create A Record in DNS to point that to the PBX’s IP
    pbx IN A xx.xx.xx.xx

  3. Create TXT Record in DNS (for SPF) which looks like this: IN TXT "v=spf1 ip4:xx.xx.xx.xx/32 -all"
    or you can make it more global and add multiple IPs from all the systems that can send email as your domain. As this example shows three IP listings. IN TXT "v=spf1 ip4:xx.xx.xx.xx/32 ip4:xx.xx.xx.xx/32 ip4:xx.xx.xx.xx/32 -all"

  4. This one depends on who you get your IP from. Only the owner or a “delegate” can update the PTR record for the IP to have it point to Now if you’re using someone like Vultr, Lindoe, Digital Ocean, etc. they have options for this under the server settings that you can edit and set yourself. Otherwise you’ll need to request they create it if they are willing to.

I am very grateful for your help and considerations of my difficulty.
Unfortunately I lack the knowledge to implement your suggestions. How do I create a recod in DNS to point etc?
Your points in 3 are fine but you have lost me as to what I am trying to do.
Sorry to be so unknowledgeable but more detail would help.
If you think this enquiry is outside your obligations I would understand

Much obliged Tom, email working.
I was able to follow to set up 1,2,3 in your instructions and all OK.
$ is currently not possible as I am a BT home customer and they only use dynamic ip so I can not set ptr record.
If I have understood correctly if I lose my BT connection I will get a new ip address and will have to edit dns to that address with my email host so that emails get through.
Costs of static ip are high as they only do this for a business account which would triple my costs. I will look for a cheaper solution.
Many thanks again

Normally, with authenticated SMTP the sending IP address shouldn’t matter. For example, you can send email from your PC on a dynamic IP without issue.

Try setting SMTP server to

and confirm (from the mail log or with tcpdump) that the authentication is working correctly.

Otherwise, your DNS provider may have a ‘dynamic DNS’ setup which will follow a changing IP address. Or, you could have a script that monitors for an IP address change and updates your DNS programmatically.

Another possibility is sending via an email provider that specializes in these applications such as . Assuming that your PBX will send fewer than 100 messages daily, you would qualify for their free tier.

All working email at the moment. Thanks Stewart1 for your advice. The emails arrive without the port added and I will see what happens after loss of service and a new IP allocation. I agree my normal emails from Outlook all work with dynamic IP.
I have traced a broadband provider which supplies fixed ip for small annual fee but their download speed is half my current level. With help from forum my problem is solved.
Many thanks

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.