The maildrop rules are just :

import SENDER; SENDER=tolower($SENDER)
import RECIPIENT; RECIPIENT=tolower($RECIPIENT)
RECIP=substr($RECIPIENT, length($HOST)+1)
SHELL="/bin/sh"
logfile "maildrop.log"


# junk to:тест
if (/^subject:.*тест.*/:h)
{
  log "Matched"
}

exit

Mail is ( data is not actual :) ):

Received: (qmail 23913 invoked by uid 506); 18 Jul 2014 12:13:07 -0000
Received: from domain1.com (123.456.78.90)
  by domain1.com with SMTP; 18 Jul 2014 12:13:07 -0000
Received: (qmail 1172 invoked by uid 506); 18 Jul 2014 12:13:06 -0000
Received: from unknown (HELO ?123.456.78.90?) (ad...@domain1.com
@123.456.78.90)
  by domain1.com with ESMTPA; 18 Jul 2014 12:13:06 -0000
Message-ID: <52c90f52.4041...@domain1.com>
Disposition-Notification-To: =?UTF-8?B?0LTQtdC90LjRgQ==?=
 <ad...@domain1.com>
Date: Fri, 18 Jul 2014 15:13:05 +0300
From: =?UTF-8?B?0YLQtdGB0YI=?= <ad...@domain1.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101
Thunderbird/24.6.0
MIME-Version: 1.0
To: ad...@domain1.com
Subject: =?UTF-8?B?0YLQtdGB0YI=?=
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit


Then i test it with
cat mail2.eml |  /usr/local/bin/maildrop -V 4 -A "Return-Path:
ad...@domain.com" -A "Delivered-To: ad...@domain.com"
'.maildrop_prev_config'
And with this is ok - here is the debug output
Matching /^subject:.*тест.*/ against Subject: тест
maildrop_prev_config(8): Search of ^subject:.*тест.* = 1
maildrop_prev_config(8): IF evaluated, result=1

But when i add some sybols to maildrop options
cat mail2.eml |  /usr/local/bin/maildrop -V 4 -A "Return-Path:
ad...@domain22222222.com" -A "Delivered-To: ad...@domain22222222.com"
'.maildrop_prev_config'
It fails and log says
Not matched.
Matching /^subject:.*тест.*/ against Subject: =?UTF-8?B?0YLQtdGB0YI
Not matched.
maildrop_prev_config(8): Search of ^subject:.*тест.* = 0
maildrop_prev_config(8): IF evaluated, result=0

Then when i add 1 more symbol
cat mail2.eml |  /usr/local/bin/maildrop -V 4 -A "Return-Path:
ad...@domain22222222.com" -A "Delivered-To: ad...@domain222222221.com"
'.maildrop_prev_config'
Matching /^subject:.*тест.*/ against Subject: =?UTF-8?B?0YLQtdGB0Y
Not matched.
maildrop_prev_config(8): Search of ^subject:.*тест.* = 0
maildrop_prev_config(8): IF evaluated, result=0

In the last test we see that the last symbol in subject is missing (
compared to previous log ) and the string is not decoded
The pattern matching fails in last 2 tests. If the logging is the problem -
the pattern will match and evaluate code inside the condition .

I tested with the latest patches , but the result is the same ( with and
without mime encoded texts ). And thanks for the previous answer !

Regards,
Denis Kanchev


2014-07-21 13:55 GMT+03:00 Sam Varshavchik <mr...@courier-mta.com>:

> Denis Kanchev writes:
>
>
>> Matching /^subject:.*тест.*nst
>> / against Subject: =?UTF-8?B?0YLQtdGB0YI=
>>
>>
>> Nice - the subject is 3 symbols longer :) , then lets cut more symbols
>> from the headers in the options, then we remove 3 more symbols from the
>> options and finally maildrop matched the pattern
>>
>
> I can't reproduce this; something like this typically depends on the exact
> contents of the message, and the filtering recipe.
>
> However there is a logging bug in 2.7.1, which affects logging only, in
> this manner, and should not impact the actual searching; it's already been
> fixed.
>
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> courier-users mailing list
> courier-users@lists.sourceforge.net
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
>
>
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to