[Tickets #7023] Wrong "Received:" regexp used in vacation date with sieve
bugs at horde.org
bugs at horde.org
Fri Jul 4 10:14:04 UTC 2008
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/7023
------------------------------------------------------------------------------
Ticket | 7023
Created By | bb at apc.ag
Summary | Wrong "Received:" regexp used in vacation date with
| sieve
Queue | Ingo
Version | 1.2
Type | Bug
State | Unconfirmed
Priority | 2. Medium
Milestone |
Patch | 1
Owners |
+New Attachment | sieve-vacation-date.patch
------------------------------------------------------------------------------
bb at apc.ag (2008-07-04 06:14) wrote:
The sieve module of Ingo creates date matching rules if a vacation
date (start and end) is specified. These rules work correctly from the
10th to the 31st of each month but not from the 1st until the 9th.
The reason is that the generated regex searches for dates like '04 Jul
2008'. However, each server I've seen (Postfix, MS Exchange) inserts
this date as '4 Jul 2008', without a leading zero.
The following diff seems to fix this issue.
# diff --normal lib/Script/sieve.php.ori lib/Script/sieve.php
2753c2753
< $code = 'if header :regex "Received" "^.*(' .
str_pad($begin, 2, '0', STR_PAD_LEFT);
---
> $code = 'if header :regex "Received" "^.*(' .
> str_pad($begin, 2, ' ', STR_PAD_LEFT);
2755c2755
< $code .= '|' . str_pad($i, 2, '0', STR_PAD_LEFT);
---
> $code .= '|' . str_pad($i, 2, ' ', STR_PAD_LEFT);
If there are mail servers that use the 04 format, maybe we should use
"[0 ]$i" instead of the str_pad stuff in the regexp.
More information about the bugs
mailing list