R3dFox80
16.06.06, 08:50
Hallo miteinander!
Ich betreibe einen Root-Debian server im Netz.
Unter anderem laeuft dort auch ein IMAP-SSL server. Der funzt auch eigentlich einwandfrei und problemlos (courier).
Jetzt hab ich mir aber mal ne kleine firewall zusammengebastelt. Sobald die aktiv ist, passiert bei meinem emailclient NACH der Authentifizierung beim oeffnen der INBOX gar nichts mehr. auf dem Server seh ich in der /var/log/mail.log zuerst folgendes:
Jun 16 09:44:36 fibspara imapd-ssl: Connection, ip=[::ffff:84.153.118.109]
Jun 16 09:44:37 fibspara imapd-ssl: LOGIN, user=fibs, ip=[::ffff:84.153.118.109], protocol=IMAP
dann dauert es einen Moment und ich sehe fuer JEDE in der INBOX befindliche Mail folgenden fehler:
Jun 16 09:43:11 fibspara postfix/cleanup[4177]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (110)
Jun 16 09:43:11 fibspara postfix/cleanup[4177]: warning: 043701A9977: virtual_alias_maps map lookup problem for root@fibspara.de
Jun 16 09:43:11 fibspara postfix/pickup[3821]: warning: maildrop/F32CB1A9978: Error writing message file
Jun 16 09:43:11 fibspara postfix/pickup[3821]: 026AF1A9977: uid=107 from=<smmsp>
Jun 16 09:43:11 fibspara postfix/cleanup[4177]: warning: 026AF1A9977: virtual_alias_maps map lookup problem for root@fibspara.de
Jun 16 09:43:11 fibspara postfix/pickup[3821]: warning: maildrop/F32CB1A9978: Error writing message file
Jun 16 09:43:28 fibspara postfix/pickup[3821]: 030F61A9977: uid=107 from=<smmsp>
Jun 16 09:43:28 fibspara postfix/cleanup[4177]: warning: 030F61A9977: virtual_alias_maps map lookup problem for root@fibspara.de
Jun 16 09:43:28 fibspara postfix/pickup[3821]: warning: maildrop/F32CB1A9978: Error writing message file
Jun 16 09:44:28 fibspara postfix/pickup[3821]: 01A3B1A9977: uid=107 from=<smmsp>
ich bin total ratlos. Was muss ich denn noch nach aussen hin oeffnen? Sobald ich meine Firewall ausschalte funktioniert wieder alles einwandfrei..
#!/bin/bash
iptables -X
iptables -F
iptables -F -t nat
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
#### NAT rules ####
# 1st IP
# block SSH port
iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 22 -j DROP
# 2nd IP
# allow ssh
iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 22 -j ACCEPT
# drop HTTP,IMAPS and SMTP. all other will be droped in socket rules below
#iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 80 -j DROP
#iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 993 -j DROP
#iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 25 -j DROP
# 3rd IP
# block all incoming requests for 3rd IP
iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -j DROP
#### Socket rules####
# SSH
iptables -I INPUT -p tcp --sport 22 -j ACCEPT
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 22 -j ACCEPT
iptables -I OUTPUT -p tcp --sport 22 -j ACCEPT
# DNS
iptables -A INPUT -p udp --sport 53 -j ACCEPT
# ICMP
#iptables -A OUTPUT -p icmp -j ACCEPT
# APACHE
# HTTP
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
# EMAIL
#SMTP
iptables -A INPUT -i eth0 -p tcp --sport 25 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 25 -j ACCEPT
# IMAP-SSL
iptables -A INPUT -i eth0 -p tcp --dport 993 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 993 -j ACCEPT
# allow ev'thin from lo to lo
iptables -A INPUT -p all -s localhost -d localhost -j ACCEPT
Danke fuer eure Hilfe,
R3dFox
Ich betreibe einen Root-Debian server im Netz.
Unter anderem laeuft dort auch ein IMAP-SSL server. Der funzt auch eigentlich einwandfrei und problemlos (courier).
Jetzt hab ich mir aber mal ne kleine firewall zusammengebastelt. Sobald die aktiv ist, passiert bei meinem emailclient NACH der Authentifizierung beim oeffnen der INBOX gar nichts mehr. auf dem Server seh ich in der /var/log/mail.log zuerst folgendes:
Jun 16 09:44:36 fibspara imapd-ssl: Connection, ip=[::ffff:84.153.118.109]
Jun 16 09:44:37 fibspara imapd-ssl: LOGIN, user=fibs, ip=[::ffff:84.153.118.109], protocol=IMAP
dann dauert es einen Moment und ich sehe fuer JEDE in der INBOX befindliche Mail folgenden fehler:
Jun 16 09:43:11 fibspara postfix/cleanup[4177]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (110)
Jun 16 09:43:11 fibspara postfix/cleanup[4177]: warning: 043701A9977: virtual_alias_maps map lookup problem for root@fibspara.de
Jun 16 09:43:11 fibspara postfix/pickup[3821]: warning: maildrop/F32CB1A9978: Error writing message file
Jun 16 09:43:11 fibspara postfix/pickup[3821]: 026AF1A9977: uid=107 from=<smmsp>
Jun 16 09:43:11 fibspara postfix/cleanup[4177]: warning: 026AF1A9977: virtual_alias_maps map lookup problem for root@fibspara.de
Jun 16 09:43:11 fibspara postfix/pickup[3821]: warning: maildrop/F32CB1A9978: Error writing message file
Jun 16 09:43:28 fibspara postfix/pickup[3821]: 030F61A9977: uid=107 from=<smmsp>
Jun 16 09:43:28 fibspara postfix/cleanup[4177]: warning: 030F61A9977: virtual_alias_maps map lookup problem for root@fibspara.de
Jun 16 09:43:28 fibspara postfix/pickup[3821]: warning: maildrop/F32CB1A9978: Error writing message file
Jun 16 09:44:28 fibspara postfix/pickup[3821]: 01A3B1A9977: uid=107 from=<smmsp>
ich bin total ratlos. Was muss ich denn noch nach aussen hin oeffnen? Sobald ich meine Firewall ausschalte funktioniert wieder alles einwandfrei..
#!/bin/bash
iptables -X
iptables -F
iptables -F -t nat
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
#### NAT rules ####
# 1st IP
# block SSH port
iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 22 -j DROP
# 2nd IP
# allow ssh
iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 22 -j ACCEPT
# drop HTTP,IMAPS and SMTP. all other will be droped in socket rules below
#iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 80 -j DROP
#iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 993 -j DROP
#iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -p tcp --dport 25 -j DROP
# 3rd IP
# block all incoming requests for 3rd IP
iptables -t nat -A PREROUTING -i eth0 -d ***.***.***.*** -j DROP
#### Socket rules####
# SSH
iptables -I INPUT -p tcp --sport 22 -j ACCEPT
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 22 -j ACCEPT
iptables -I OUTPUT -p tcp --sport 22 -j ACCEPT
# DNS
iptables -A INPUT -p udp --sport 53 -j ACCEPT
# ICMP
#iptables -A OUTPUT -p icmp -j ACCEPT
# APACHE
# HTTP
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
#SMTP
iptables -A INPUT -i eth0 -p tcp --sport 25 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 25 -j ACCEPT
# IMAP-SSL
iptables -A INPUT -i eth0 -p tcp --dport 993 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 993 -j ACCEPT
# allow ev'thin from lo to lo
iptables -A INPUT -p all -s localhost -d localhost -j ACCEPT
Danke fuer eure Hilfe,
R3dFox