Re: [exim] Parse custom headers in email

Top Page

Reply to this message
Author: Andrew C Aitchison
To: Emanuel Gonzalez via Exim-users
Subject: Re: [exim] Parse custom headers in email
On Thu, 11 Oct 2018, Emanuel Gonzalez via Exim-users wrote:

> Hello,
> in my local antispam service I have a large list of email marketing
> providers, to which I assign 30 points, my question is, it is
> possible to analyze the email in search of a personalized header
> (called msgid_mkt_domain) and move the mail to a specific folder?
> I have read that it can be done through python but my knowledge of
> that language is very basic.

Use a filter - see the filter.txt file that came with exim, also at

For a single (unix) user this is usually .forward in home directory.
but it is also possible to enable a "system filter" which all mail
passes through. User filters can be in the internet standard "sieve"
format or the exim filter language; system filters must be in the
exim language.

Here is a possible, untested, filter file for a single user.

------- 8< ------------ 8< ------------ 8< ------------ 8< -----
#exim filter

if $header_msgid_mkt_domain: is not ""
     seen save $home/specificfolder

------- 8< ------------ 8< ------------ 8< ------------ 8< -----

Andrew C. Aitchison                    Cambridge, UK