Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Oneclick script to test if your server is blocked by worldwide email services
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Oneclick script to test if your server is blocked by worldwide email services

It turns out that sometimes email cannot be delivered due to server being blocked by some public or professional SMTP services. So I wrote a quick shell script to check whether or not your server IP is blocked by famous public SMTP mail services.

https://github.com/Har-Kuun/MailBlockCheck

If a server is blocked by many public SMTP servers, then it is better not to be used as a mail server.

Tests against the following public email servers are performed:

  • Famous free email services world, such as Gmail, Outlook, Yahoo.
  • Famous regional free email services, such as free.fr, inbox.eu, mail.ru.
  • Famous Chinese free email services, such as QQ, 163.com, Sohu, Sina.
  • Famous professional email services, such as MXRoute, NameCrane, FastMail, ProtonMail, Zoho.
  • You can customize the test list in the first few lines of the script, by yourself.

To use this script, simply run the following command in SSH.

bash <(curl https://raw.githubusercontent.com/Har-Kuun/MailBlockCheck/refs/heads/main/mailcheck.sh)

The script will do all relevant tests and generate a table for you at the end of its run.

Technically you want as many "220 OK" as possible. An "Error 554" typically means your server is blocked by this specific public SMTP service. A "timeout" or a "no response" could be due to temporary network issue, and you can try again later. Of course, a full "220 OK" does not guarantee successful email delivery. You still need to take care of all the authentications, as well as taking care of the mail content and following rules such as double opt-in.

Feel free to submit any issues that you may find during using. Happy mailing and Stars appreciated :)

Comments

  • lukast__lukast__ Member, Megathread Squad
    edited January 17

    Nice short and clean script!

    Thanked by 1dedipromo
  • Ow I needed this one. Thank you.

  • The script only seems to check that it can connect to the SMTP port - that tells you next to nothing. Most mail servers will only tell you that you are blocked after a "RCPT TO" or even after a "DATA" - and things like Reverse DNS records will also make a difference.

  • silunsilun Member
    edited January 17

    Mail deliverability is an issue for sure, a huge one. I don't really see how testing for IP connectivity alone will tell you much about what they're doing with your mail. They may receive it and just throw it in the bin. I have never been blocked at IP level even when a service absolutely didn't accept my emails. I think you'd need to go further. For example:

    • Do something like nc -zv <test-ip> 25on some known good target to check if the outbount port is even opened on the server. If you don't check this first, it'll just look like your IP is blocked everywhere
    • Have a baseline blacklist check, such as the one on mxtoolbox.com
    • Have an automated check at mail-tester.com
    • As a minimum, ask for the sending domain and check SPF, DMARC, PTR are set up and allow the server to be maily
    • Additionally, check as many points as you can from the email sender guideline
    • List whatever isn't set up, give some recommendations, etc.
  • @cmeerw said:
    The script only seems to check that it can connect to the SMTP port - that tells you next to nothing. Most mail servers will only tell you that you are blocked after a "RCPT TO" or even after a "DATA" - and things like Reverse DNS records will also make a difference.

    I agree that these are two different types of blocks. This SMTP connection test is still valid for many servers though, for example QQ is known to block SMTP connections.

    Thanked by 2eb1995 silun
  • @silun said:
    Mail deliverability is an issue for sure, a huge one. I don't really see how testing for IP connectivity alone will tell you much about what they're doing with your mail. They may receive it and just throw it in the bin. I have never been blocked at IP level even when a service absolutely didn't accept my emails. I think you'd need to go further. For example:

    • Do something like nc -zv <test-ip> 25on some known good target to check if the outbount port is even opened on the server. If you don't check this first, it'll just look like your IP is blocked everywhere
    • Have a baseline blacklist check, such as the one on mxtoolbox.com
    • Have an automated check at mail-tester.com
    • As a minimum, ask for the sending domain and check SPF, DMARC, PTR are set up and allow the server to be maily
    • Additionally, check as many points as you can from the email sender guideline
    • List whatever isn't set up, give some recommendations, etc.

    Thanks for the suggestions - You are right. The script was just meant for the basic SMTP connection block check, and did not provide much information for actual email delivery check; for that part, as you mentioned, better to use mail-tester.com or a similar service. I can try to figure out if there's any possibility to add an automated mail-tester.com and mxtoolbox check into the script though.
    Regarding your 1st point, The script does first check if server 25 port is opened :)

    Thanked by 1silun
  • And here are my results from my @ColoCrossing server that they said port 25 has been unblocked on:




    Checking dependencies...
    All dependencies are installed.


    Checking if outbound port 25 is open...
    Outbound port 25 is blocked.

    Please configure your firewall or contact your server provider to unblock it.

    Thanked by 1emgh
  • emghemgh Member, Megathread Squad

    @eb1995 said:
    And here are my results from my @ColoCrossing server that they said port 25 has been unblocked on:




    Checking dependencies...
    All dependencies are installed.


    Checking if outbound port 25 is open...
    Outbound port 25 is blocked.

    Please configure your firewall or contact your server provider to unblock it.

Sign In or Register to comment.