Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

PHPMailer not working with Firewall

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
PHPMailer not working with Firewall
  • Quote

Post by mehargags » Tue Mar 24, 2015 8:30 am

On one of My Debian 7 installs, I'm not able to send mails through PHPMailer which sends mails via Google SMTP (regardless of EXIM on server)

If I stop Firewall -- it sends through but not when Firewall is active.

I have ACCEPT for 993,465,25,587 in the Rules.... anything ?

iptables -L

Code: Select all

Chain INPUT (policy DROP)
target     prot opt source               destination
fail2ban-VESTA  tcp  --  anywhere             anywhere             tcp dpt:8083
fail2ban-MAIL  tcp  --  anywhere             anywhere             multiport dports smtp,ssmtp,submission,2525,pop3,pop3s,imap2,imaps
fail2ban-SSH  tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:9562
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:5901
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:2257
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:9810
DROP       tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             multiport dports http,https
ACCEPT     tcp  --  anywhere             anywhere             multiport dports ftp-data,ftp,12000:12100
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             multiport dports smtp,ssmtp,submission,2525
ACCEPT     tcp  --  anywhere             anywhere             multiport dports pop3,pop3s
ACCEPT     tcp  --  anywhere             anywhere             multiport dports imap2,imaps
DROP       tcp  --  anywhere             anywhere             multiport dports mysql,postgresql
DROP       tcp  --  anywhere             anywhere             tcp dpt:8083
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     all  --  127.0.0.2            anywhere
ACCEPT     all  --  rn2g                 anywhere
ACCEPT     all  --  localhost.localdomain  anywhere
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:ftp-data
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:ftp
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:smtp
ACCEPT     udp  --  anywhere             anywhere             udp spt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:https
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:pop3
ACCEPT     udp  --  anywhere             anywhere             udp spt:ntp
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:imap2
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:mysql
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:postgresql
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:http-alt
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:8433
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:8083
ACCEPT     udp  --  google-public-dns-a.google.com  anywhere             udp spt:domain state ESTABLISHED
ACCEPT     tcp  --  google-public-dns-a.google.com  anywhere             tcp spt:domain state ESTABLISHED
ACCEPT     udp  --  google-public-dns-b.google.com  anywhere             udp spt:domain state ESTABLISHED
ACCEPT     tcp  --  google-public-dns-b.google.com  anywhere             tcp spt:domain state ESTABLISHED
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: PHPMailer not working with Firewall
  • Quote

Post by skurudo » Tue Mar 24, 2015 5:06 pm

Code: Select all

/etc/init.d/iptables-persistent restart
?
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: PHPMailer not working with Firewall
  • Quote

Post by mehargags » Tue Mar 24, 2015 5:32 pm

skurudo wrote:

Code: Select all

/etc/init.d/iptables-persistent restart
?
isn't that a CentOS command ? I'm on Debian7

Code: Select all

ah@2yg:~$ /etc/init.d/iptables-persistent restart
-bash: /etc/init.d/iptables-persistent: No such file or directory
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: PHPMailer not working with Firewall
  • Quote

Post by skurudo » Tue Mar 24, 2015 5:43 pm

iptables -A OUTPUT -p tcp --dport 25 -j ACCEPT
iptables save
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: PHPMailer not working with Firewall
  • Quote

Post by mehargags » Tue Mar 24, 2015 6:14 pm

doesn't help.

I think IP Tables are screwed.

I tested on CentOS with Firewall enabled, it works -

I think Vesta's Scripts do not configure Firewall properly on Debian systems.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: PHPMailer not working with Firewall
  • Quote

Post by skurudo » Wed Mar 25, 2015 10:09 am

Try to flush iptables and make you own rules
Top

mikho
Posts: 2
Joined: Sat Mar 14, 2015 10:55 am

Re: PHPMailer not working with Firewall
  • Quote

Post by mikho » Wed Mar 25, 2015 2:50 pm

put the rules in the custom.sh file and restart the firewall using vesta commands.
Should work.
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password