[exim] using an ACL to check for a Content-type header

Top Page
Delete this message
Reply to this message
Author: Oliver Howe
Date:  
To: exim-users
Subject: [exim] using an ACL to check for a Content-type header
I have this set in my config file -

acl_smtp_data = acl_check_data

and then in the ACL section I check each message to see if it has a
Content-type header present by doing this -

accept condition = ${if def:header_Content-Type:}
         set acl_c_ctnm = yes
accept



Then a specific router will fire if the message has a Content-type header.
If not then the message will pass through to the next router.

This seems to have been working fine so far, in that if the message has a
Content-type header then the acl_c_ctnm value will show up when I do exim
-Mvh message_id, or when I look at the file directly in the spool directory
-

-aclc _ctnm 3
yes

But I have recently found a message where acl_c_ctnm is showing up as yes
but there is definitely no Content-type header when I view the message
header.

Does anyone know why this might happen? Could it happen if a batch of
messages were received and one of them had the content-type header set
which then caused it to be written to all messages in the same batch?

Or is there a better way I can check for a Content-type header? i.e if
there is a Content-type header then the message should get processed by
router_a otherwise it will get ignored by router_a

Thanks