After having looked on the web and on this forum for similar cases, and not having found a solution, I am writing this hoping for some help or indication on how to fix this issue.
For the test domain ckg.in, I activated two rules:
1) if any Recipient does not contain "@ckg.in", Fail with message "rejected"
2) if From does not contain "@ckg.in", Fail with message "rejected"
Basically, only messages sent from that domain, or addressing an account on that domain are not rejected.
The Filter Test box have both rules works as expected.
If a message is sent to "test1@ckg.in" from an account not @ckg.in, that message never reach the mailbox, although no "Fail" message is ever received. That is (almost) all right.
But if a message is sent from "test1@ckg.in" to any account, for example, test@example.net, the message is delivered, against the first rule.
This is the content of /etc/vfilters/chk.in:
This is the related content of /var/log/exim_mainlogCode:# Exim filter # Auto Generated by cPanel. Do not manually edit this file as your changes will be overwritten. If you must edit this filter, ed if not first_delivery and error_message then finish endif #Recipients-are-not-ckg.in if foranyaddress $h_to:,$h_cc:,$h_bcc: ( $thisaddress does not contain "@ckg.in" ) then fail "Message rejected." endif #From-is-not-ckg.in if $header_from: does not contain "@ckg.in" then fail "Message rejected." endif
(test@example.net is in place of the real address I used)
Code:> tail -f /var/log/exim_mainlog 2011-06-08 13:48:09 H=localhost (208.86.00.00) [127.0.0.1] Warning: Sender rate 2.6 / 1h 2011-06-08 13:48:09 1QUMrR-00016N-Na <= test1@ckg.in H=localhost (208.86.00.00) [127.0.0.1] P=esmtpa A=dovecot_login:test1@ckg.in S=544 id=9a4a702d8b4a79d72c5be92b7756b457@ckg.in T="test" 2011-06-08 13:48:09 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1QUMrR-00016N-Na 2011-06-08 13:49:42 1QUMrR-00016N-Na => test@example.net R=lookuphost T=remote_smtp H=mail.server.org [208.116.00.00] X=TLSv1:DES-CBC3-SHA:168 2011-06-08 13:49:42 1QUMrR-00016N-Na Completed
How can the filter be fixed so that no messages are delivered if they do not contain "@ckg.in" in the Recipients?



LinkBack URL
About LinkBacks
Reply With Quote






