Skip to main content

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

  •  USER , is the Eenos user name , and
  • DOMAIN_NAME  , is the  domain name under the corrusponding userr

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