0

I configure ipfw for a local mail server. Everything works fine, but after a while (from one and a half days to a couple of hours) incorrect work is observed: mail from other domains comes, but mail does not go from my mailer to another domain. Overloading or shutting down ipfw immediately solves the problem. Mail inside my domain works good. My mailer is postfix, dovecot, MySQl Here are my rules:

#!/bin/sh
cmd="/sbin/ipfw -q"
${cmd} -f flush
#loopback
${cmd} add 10 allow ip from any to any via lo0
${cmd} add 11 deny ip from any to 127.0.0.1/8
${cmd} add 12 deny ip from 127.0.0.1/8 to any 
#
${cmd} add 20 allow tcp from any to any established

#table ssh 22
table_ssh=22
${cmd} table $table_ssh flush
${cmd} table $table_ssh add 192.168.0.48

#icmp
${cmd} add 30 allow icmp from 192.168.0.0/24 to me
${cmd} add 30 allow icmp from me to 192.168.0.0/24 

#ssh
${cmd} add 40 allow tcp from "table(22)" to me 22 in via em0 
${cmd} add 41 deny log tcp from any to me 22 in via em0
#mail, web
${cmd} add 50 deny tcp from 192.168.1.0/24 to me 25,110,143,80 in via em0
${cmd} add 51 allow tcp from any to me 25,110,143,80 in via em0

#servers rules
${cmd} add 60 allow ip from me to any out via em0
#UDP Server
${cmd} add 61 allow udp from me to any dst-port 53 out via em0
${cmd} add 62 allow udp from any to me src-port 53 in via em0
New contributor
Artem Khmil is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • yes, but this mistake is error when i wrote text. I edit question without mistake – Artem Khmil May 13 at 9:27
  • Your ruleset looks fine for me. What is in your /var/log/maillog when problem occurs? – user1700494 May 13 at 10:11
  • when problem repeat, i will show log – Artem Khmil May 13 at 14:41

Your Answer

Artem Khmil is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.