Control Web Panel

WebPanel => How to => Topic started by: muhittin on March 10, 2015, 07:14:55 AM

Title: How to Change your mail port (Some ISP Block 25, 26 port)
Post by: muhittin 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 ;)
Title: Re: How to Change your mail port (Some ISP Block 25, 26 port)
Post by: erm3nda 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/ (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.

Title: Re: How to Change your mail port (Some ISP Block 25, 26 port)
Post by: kashifkiduniya 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?
Title: Re: How to Change your mail port (Some ISP Block 25, 26 port)
Post by: tastebud 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.
Title: Re: How to Change your mail port (Some ISP Block 25, 26 port)
Post by: CWP Lovers 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?