[Users] Filter->Condition: test for missing Date header?
Pierre Fortin
pf at pfortin.com
Mon Mar 24 23:22:30 UTC 2025
On Mon, 24 Mar 2025 17:01:59 -0400 Pierre Fortin via Users wrote:
>On Mon, 24 Mar 2025 17:39:04 +0100 wwp wrote:
>
>>Hello Pierre,
>>
>>
>>On Mon, 24 Mar 2025 12:18:57 -0400 Pierre Fortin via Users <users at lists.claws-mail.org> wrote:
>>
>>> On Mon, 24 Mar 2025 12:16:14 -0400 Pierre Fortin via Users wrote:
>>>
>>> >On Mon, 24 Mar 2025 15:38:51 +0100 wwp wrote:
>>> >
>>> >>Hello Pierre,
>>> >>
>>> >>
>>> >>On Mon, 24 Mar 2025 08:39:24 -0400 Pierre Fortin via Users <users at lists.claws-mail.org> wrote:
>>> >>
>>> >>> Hi,
>>> >>>
>>> >>> Does anyone have a Filter Condition to test for a missing Date header?
>>> >>>
>>> >>> Asian spammers have tendency to send messages without a Date header which
>>> >>> makes these messages appear as the oldest date and requiring scrolling to
>>> >>> the other end of the message list to access/delete them.
>>> >>>
>>> >>> Just wanting to trash any messages not containing a Date header.
>>> >>
>>> >>~header "Date" regexpcase "."
>>> >>
>>> >>maybe? That would not cover non-valid (but still existing) date values.
>>> >
>>> >Thanks, missed trying that variant. Can't test right now... I clicked
>>> >Trash on a couple of these messages; but now can't find them in the Trash
>>> >folder.
>>> >
>>> >POP3S, no filter affects these messages, so they stay in the Inbox on
>>> >receipt. However, I expected to find them in the Trash folder intending
>>> >to use them to test; but nope...
>>> >
>>> >Two possible reasons:
>>> >- No-date message is totally deleted on Trash click
>>> >- No-date message has a Date header added upon Trashing
>>> >Other?
>>>
>>> Doh! This must've been deleted completely due to no-date being older
>>> than my 30 retention period.
>>>
>>> >The next time I get one of these messages, my current rule will only
>>> >change its color as a test.
>>
>>Once filtered and in, such message with missing or broken Date: header
>>can be 'fixed' by calling one of our tools available online (that you
>>can invoke through an action). Check the fix_date.sh one at
>>https://www.claws-mail.org/tools.php.
>
>Appreciate that info; but for over a year, all the missing date messages
>were chinese, japanese, other spam, so I was looking for a filter
>condition that would trigger any action; in this case, delete which will
>be immediate regardless of the 30 day retention (see "Doh!" above). :)
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".
Thanks for trying,
Pierre
>>Regards,
>>
>
More information about the Users
mailing list