Re: [exim] Invalid or null subject header

Pàgina inicial
Delete this message
Reply to this message
Autor: Mike Cardwell
Data:  
A: exim-users
Assumpte: Re: [exim] Invalid or null subject header
James Price wrote:

> Hi, I'm looking for a control within an ACL to handle invalid or null
> subject headers, more specifically a null subject header. It would also be
> nice to know how to look for an malformed subject header as well. I believe
> the variable I'm looking at is $h_Subject. I'm not sure how to approach
> this and I could not locate anything of the sort in the specs or in the FAQ.
>
>
> I'm sure this simply matching a condition true or false, I'm just not sure
> how to look for the null value. Once I know how to write this condition
> properly I can then figure out how to handle the message depending on the
> situation. I'd also like to use this with possibly matching against a word
> file.
>
> This is probably very simple, but I figured I'd ask.


In data acl:

1.) Check for missing Subject header:
     condition = ${if def:h_Subject:{false}{true}}


2.) Check for either missing or empty Subject header:
     condition = ${if eq{$h_Subject:}{}{true}{false}}


As for looking for a "malformed subject header", I'm not sure how you'd
fiddle with checking for valid encoding. SpamAssassin flags up stuff
like this for me:

MISSING_SUBJECT
SUBJECT_ENCODED_TWICE

Mike