[Users] Filter->Condition: test for missing Date header?

Pierre Fortin pf at pfortin.com
Mon Mar 24 23:54:27 UTC 2025


On Tue, 25 Mar 2025 00:40:02 +0100 wwp wrote:

>Hello Pierre,
>
>
>On Mon, 24 Mar 2025 19:22:30 -0400 Pierre Fortin via Users <users at lists.claws-mail.org> wrote:
>
>[snip]
>> Didn't have to wait long for one of these messages.
>> However, this rule didn't trigger; so I opened the Filter Log, cleared
>> it, and manually filtered which gave:
>> [2025-03-24 19:08:36] filtering message (manually)
>>                        message file: /home/pfortin/Mail.pfortin/inbox/72296
>>                        Date: (null)
>>                        From: 楽天証券からのお知らせ  <supportcontact at glaq.com>
>>                        To: pfortin at pfortin.com
>>                        Subject: 【楽天証券】株式取引手数料最大50%OFF!期間限定スペシャルオファー
>> [2025-03-24 19:08:36] processing rule 'No Date' [ ~header "Date" regexpcase "." color 2 ]  
>> > rule is not account-based    
>> [2025-03-24 19:08:36] checking if message matches [ ~header "Date" regexpcase "." ]  
>> > message does not match    
>> 
>> Also tried: header "Date" regexpcase "."  (contains)
>> 
>> So it appears there's no way to check for a missing header...
>> 
>> I suspect the "juice ain't worth the squeeze" to add Header "is missing" as a 3rd choice to "contains"/"doesn't contain".  
>
>I also thought of: ~headers_part regexp "^Date: ", but it's maybe too
>late this evening for me to think clearly :-/.

Clearly enough!!  :)

Looks like a hidden feature as I couldn't find a way to set this up with
the GUI; so I edited the rule directly and success!

[2025-03-24 19:50:23] filtering message (manually)
                       message file: /home/pfortin/Mail.pfortin/inbox/72296
                       Date: (null)
                       From: 楽天証券からのお知らせ  <supportcontact at glaq.com>
                       To: pfortin at pfortin.com
                       Subject: 【楽天証券】株式取引手数料最大50%OFF!期間限定スペシャルオファー
[2025-03-24 19:50:23] processing rule 'No Date' [ ~headers_part regexp "^Date: " color 2 ]
> rule is not account-based
[2025-03-24 19:50:23] checking if message matches [ ~headers_part regexp "^Date: " ]
[2025-03-24 19:50:23] header line value [ Return-Path: <supportcontact at glaq.com> ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ Delivered-To: pfortin at pfortin.com ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ Received: from ecngx348.inmotionhosting.com by ecngx348.inmotionhosting.com with LMTP id sCScJcTN4We5KBYA2TcAQw (envelope-from <supportcontact at glaq.com>) for <pfortin at pfortin.com>; Mon, 24 Mar 2025 17:25:24 -0400 ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ Return-path: <supportcontact at glaq.com> ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ Envelope-to: pfortin at pfortin.com ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ Delivery-date: Mon, 24 Mar 2025 17:25:24 -0400 ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ Received: from [101.47.40.72] (port=42942 helo=[172.31.8.108]) by ecngx348.inmotionhosting.com with esmtp (Exim 4.98.1) (envelope-from <supportcontact at glaq.com>) id 1twpIS-000000066Oy-1Msj for pfortin at pfortin.com; Mon, 24 Mar 2025 17:25:24 -0400 ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ Content-Type: multipart/mixed; boundary="===============6381443703626451878==" ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ MIME-Version: 1.0 ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ Subject: 【楽天証券】株式取引手数料最大50%OFF!期間限定スペシャルオファー ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ From: 楽天証券からのお知らせ  <supportcontact at glaq.com> ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
[2025-03-24 19:50:23] header line value [ To: pfortin at pfortin.com ] does NOT match regular expression [ ^Date:  ] (Case sensitive)
> message matches

THANKS!!!

>Regards,
>


More information about the Users mailing list