Author Topic: How to Change your mail port (Some ISP Block 25, 26 port)  (Read 24273 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How to Change your mail port (Some ISP Block 25, 26 port)
« on: March 10, 2015, 07:14:55 AM »
Hello Friends
Some ISP s is blocked 25 and 26 port ( i am from Turkiye, Blocked port 25)
solve this issue:
1-  you change your master.cf     path: /etc/postfix/master.cf

Quote
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
#  -o content_filter=smtp-amavis:127.0.0.1:10024
#  -o receive_override_options=no_address_mappings

TO :
Quote
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
587     inet  n       -       n       -       -       smtpd
26      inet  n       -       n       -       -       smtpd
#  -o content_filter=smtp-amavis:127.0.0.1:10024
#  -o receive_override_options=no_address_mappings


2- add this 587  and 26 ports in  your firewall incoming and outgoing ports
Your CWP panel --->> Security --> CSF Firewall
                                                 after click First Blue button Firewall Configuration
             find ports line and add your ports. if you use ipv6 add your ports there line too.
Quote
# Allow incoming TCP ports
TCP_IN = "20,21,2222,25,26,53,80,110,143,443,465,587,993,995,2030,2031,10011,30033"

# Allow outgoing TCP ports
TCP_OUT = "20,21,2222,25,26,53,80,110,113,443,2030,2031,587,993,995,10011,30033"
Note: i am not sure for add both in and out lines, but i use both

and finally you restart your services or restart your server
good luck ;)
« Last Edit: March 10, 2015, 12:05:57 PM by muhittin »
Wants $10 bonus for FREE on VPS DigitalOcean

https://www.digitalocean.com/?refcode=4f7603c80195
-----------------------------------------------

Offline
***
Re: How to Change your mail port (Some ISP Block 25, 26 port)
« Reply #1 on: April 13, 2015, 04:00:58 AM »
Thank you for share ;)

You can also use iptables or CSF for simply redirect the inbound/outbound connections to that ports to the one you need.  Without touch the config files but the CSF ports obviously. This is the perfect example for you (http://www.cyberciti.biz/faq/linux-port-redirection-with-iptables/)

About the inbound and outbound decision, you must add both.

Even if you think the port 25 for SMTP is a sending port, is not.
If you wanna send a email from that SMTP server, you must connect to the port 25 then pass the HELO commands and so on... so,

All the ports are usually inbound/outbound even if the service looks like just 1 way.

About smtp(25)/pop3(110) ports, one is the email, the other is the service for the users/accounts. Both of them uses inbound/outbound data.

You login to the pop3 to receive emails, and you connect to same machine at port 25 to connect the smtp port then send them.

Always there are a negotiation, so you must allow both directions.

« Last Edit: April 13, 2015, 04:04:06 AM by erm3nda »
8==D it's a function that try to compare 8 (int) against D (string) which returns True or False depending on the asker.

Offline
*
Re: How to Change your mail port (Some ISP Block 25, 26 port)
« Reply #2 on: April 14, 2018, 10:11:36 PM »
Hello Friends
Some ISP s is blocked 25 and 26 port ( i am from Turkiye, Blocked port 25)
solve this issue:
1-  you change your master.cf     path: /etc/postfix/master.cf

Quote
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
#  -o content_filter=smtp-amavis:127.0.0.1:10024
#  -o receive_override_options=no_address_mappings

TO :
Quote
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
587     inet  n       -       n       -       -       smtpd
26      inet  n       -       n       -       -       smtpd
#  -o content_filter=smtp-amavis:127.0.0.1:10024
#  -o receive_override_options=no_address_mappings


2- add this 587  and 26 ports in  your firewall incoming and outgoing ports
Your CWP panel --->> Security --> CSF Firewall
                                                 after click First Blue button Firewall Configuration
             find ports line and add your ports. if you use ipv6 add your ports there line too.
Quote
# Allow incoming TCP ports
TCP_IN = "20,21,2222,25,26,53,80,110,143,443,465,587,993,995,2030,2031,10011,30033"

# Allow outgoing TCP ports
TCP_OUT = "20,21,2222,25,26,53,80,110,113,443,2030,2031,587,993,995,10011,30033"
Note: i am not sure for add both in and out lines, but i use both

and finally you restart your services or restart your server
good luck ;)
Will it work for Google Cloud?

Offline
*
Re: How to Change your mail port (Some ISP Block 25, 26 port)
« Reply #3 on: December 07, 2018, 09:32:40 AM »
it doesn't work. mail still tries to go out using port 25. anyone has this working ? I dont want to use gmail as relay.

Offline
*
Re: How to Change your mail port (Some ISP Block 25, 26 port)
« Reply #4 on: August 08, 2020, 02:02:28 AM »
Hello Friends
Some ISP s is blocked 25 and 26 port ( i am from Turkiye, Blocked port 25)
solve this issue:
1-  you change your master.cf     path: /etc/postfix/master.cf

Quote
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
#  -o content_filter=smtp-amavis:127.0.0.1:10024
#  -o receive_override_options=no_address_mappings

TO :
Quote
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
587     inet  n       -       n       -       -       smtpd
26      inet  n       -       n       -       -       smtpd
#  -o content_filter=smtp-amavis:127.0.0.1:10024
#  -o receive_override_options=no_address_mappings


2- add this 587  and 26 ports in  your firewall incoming and outgoing ports
Your CWP panel --->> Security --> CSF Firewall
                                                 after click First Blue button Firewall Configuration
             find ports line and add your ports. if you use ipv6 add your ports there line too.
Quote
# Allow incoming TCP ports
TCP_IN = "20,21,2222,25,26,53,80,110,143,443,465,587,993,995,2030,2031,10011,30033"

# Allow outgoing TCP ports
TCP_OUT = "20,21,2222,25,26,53,80,110,113,443,2030,2031,587,993,995,10011,30033"
Note: i am not sure for add both in and out lines, but i use both

and finally you restart your services or restart your server
good luck ;)

it doesn't work for me too. anyone find the solution?