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:

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

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

${cmd} add 30 allow icmp from to me
${cmd} add 30 allow icmp from me to 

${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 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
  • yes, but this mistake is error when i wrote text. I edit question without mistake – Artem Khmil May 13 '19 at 9:27
  • Your ruleset looks fine for me. What is in your /var/log/maillog when problem occurs? – user1700494 May 13 '19 at 10:11
  • when problem repeat, i will show log – Artem Khmil May 13 '19 at 14:41

Your Answer

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.