Topic: cannot send email via roundcube when iptables are running
==== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu 14.04 LTS (trusty)
- Related log if you're reporting an issue:
====
I installed iRedMail on fresh ubuntu installation. That is VPS server. Configured domain and emails via web. iRedAdmin is working fine however there is and issue with RoundCube.
I can access roundcube from client webbrowser and see inbox/outbox however I cant send and receive email.
in /var/log/mail.err I get following message:
Aug 22 05:34:02 ***** roundcube: SMTP Error: SMTP error: Failed to add recipient '******@gmail.com' in /usr/share/apache2/roundcubemail-1.0.1/program/lib/Roundcube/rcube.php on line 1504 (POST /mail/?_task=mail&_unlock=loading1408700093446&_lang=pl?_task=mail&_action=send)
I've also noticed two strange behaviours.
1. When I run 'sudo iptables -F' it blocks my access and server does not respond - can anyone explain why? I was convinced that this is actually disabling any firewall rules and allows open access to the server. Only restart from HyperVM console helps here after that previous iptables rules loads and I can access server again.
2. When I run 'sudo service iptables stop' - this magically makes roundcube working fine and I can send and recieve emails.
here is /etc/default/iptables which is a standard one. I only changed SSH port from 22 to another one I use.
#---------------------------------------------------------------------
# This file is part of iRedMail, which is an open source mail server
# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
#
# iRedMail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# iRedMail is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iRedMail. If not, see <http://www.gnu.org/licenses/>.
#---------------------------------------------------------------------
#
# Sample iptables rules. It should be localted at:
# /etc/sysconfig/iptables
#
# Shipped within iRedMail project:
# * http://iRedMail.googlecode.com/
#
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# http/https, smtp/smtps, pop3/pop3s, imap/imaps, ssh
-A INPUT -p tcp -m multiport --dport 80,443,25,465,110,995,143,993,587,465,60222 -j ACCEPT
# Loop device.
-A INPUT -i lo -j ACCEPT
# Allow PING from remote hosts.
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
# ejabberd
#-A INPUT -p tcp -m multiport --dport 5222,5223,5280 -j ACCEPT
# http/https
#-A INPUT -p tcp -m multiport --dport 80,443 -j ACCEPT
# smtp/smtps
#-A INPUT -p tcp -m multiport --dport 25,465 -j ACCEPT
# pop3/pop3s
#-A INPUT -p tcp -m multiport --dport 110,995 -j ACCEPT
# imap/imaps
#-A INPUT -p tcp -m multiport --dport 143,993 -j ACCEPT
# ldap/ldaps
#-A INPUT -p tcp -m multiport --dport 389,636 -j ACCEPT
# ftp.
#-A INPUT -p tcp -m multiport --dport 21,20 -j ACCEPT
# ssh
#-A INPUT -p tcp --dport 22 -j ACCEPT
COMMIT
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.