Skip to main content

Email Filter

Create SMTP Filter for Email accounts in Exim

You can create  Exim filter on per account base. So that the emails on that account will be filtered or Exim. 

You may need good knowledge on Exim filter to create an smtp level filters.  Creating wrong filters may affect your exim mail server. 

We recommend to  use filter on Round Cuber Webmail .  Please read more about from  Round cube filters

Location of Account Filter:

/var/eenos/userdata/USER/mail/accountfilter/DOMAIN/EMAIL_NAME , where

  • USER, is the Eenos user
  • DOMAIN , is the website 
  • EMAIL_NAME , is the name   of email, which is the part before @ symbol

Example Create an Email SMTP Filter in Eenos

We are  going to  create and  smtp filter for the email account  myemail@foo.com whch is owned by the Eenos user fun. So the data is as follows,

  •  USER = fun
  • DOMAIN = foo.com
  • EMAIL_NAME = myemail

Location of Account filter  :   /var/eenos/userdata/fun/mail/accountfilter/foo.com/myemail

Now create the  Filter as follows: 

mkdir -pv /var/eenos/userdata/fun/mail/accountfilter/foo.com
touch /var/eenos/userdata/fun/mail/accountfilter/foo.com/myemail
chown -R eenos:eenos /var/eenos/userdata/fun/mail/accountfilter

Now add the following  example exim filter code to block all email from a domain  blockthis.com

# Exim filter
if
    $header_from: contains "@blockthis.com"
then
    testprint "Messages from this domain is blocked." 
    seen finish
endif

Remember all Exim filters need to start with the following line

# Exim filter