Exim SMTP Filters

Add custom SMTP filters to Exim domains and email accounts

Domain Filter

Filter emails with Exim for a domain

Eenos  Exim smtp server is a powerful email servers. You can add  SMTP email filter  per domain so that all emails coming to the domain will go through this filter.

This sections need good technical knowledge on Exim filter coding. If you make error on  Exim filters which will affect the email server.

Location of Filter folder : 

 /var/eenos/userdata/USER/mail/domainfilter/DOMAIN_NAME   ,  where

Example Domain filter in Eenos

We are creating an smtp filter for the Eenos user foo with domain name fun.com  , the domain filter file need to be placed on the following location

/var/eenos/userdata/foo/mail/domainfilter/fun.com

Sample command as follows,

touch /var/eenos/userdata/foo/mail/domainfilter/fun.com
chown eenos:eenos /var/eenos/userdata/foo/mail/domainfilter/fun.com

Now add the following sample exim filter code . This filter will block all email from a domain  blocker.com

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

All exim filter must start with the  following line,

# Exim filter

 

 

 

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

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,

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