We help IT Professionals succeed at work.
Get Started

Need to modify a new cpanel exim mail filter

113 Views
Last Modified: 2015-11-25
Hi,
I am modifying a new exim mail filter as per below, all works well but.

1. wondering how to log the output to logfile /var/log/filter.log which has been created with permission 0644?

2. How would I just fail the message and not send a reply back to the spammer?

3. is there a $header_to option to stop mail sent to a specific addresses

Thanks in advance.

/etc/cpanel_exim_system_filter_new


# Filters all incoming an outgoing mail logfile /var/log/filter.log 0644
# reject spam based on email body
# logfile /var/log/filter.log 0644 

if
    $message_body contains "Good Day" or
    $message_body contains "Hello PayPal" or
    $message_body contains "Dear valued PayPal" or
    $message_body contains "forward to your positive reply"
then
    fail text "This message has been rejected because it looks like you are spamming us."
endif

if
    $header_from contains "rezult" or 
    $header_from contains "secret"  
then
    fail text "Your email has been rejected because it looks like you are spamming us."
endif

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 2 Answers and 4 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE