[Users] Delete receiving emails if date > now

pf at pfortin.com pf at pfortin.com
Thu May 28 01:16:58 CEST 2015


On Wed, 27 May 2015 08:52:49 -0700 sylpheed at 911networks.com wrote:

>Hi,
>
>I'm under constant bombardment of spam whose date/time is more than
>current time.

Can you provide sample headers along with date/time actually received?
These may be needed if my below solution needs a date/time other than is
available in CM's %d.

Filtering on negative "age" is not implemented... 

However...  here's a starting point... assumes your system time is
correctly setup *and* CM's %d is the date we need.

Create a "futuremail" folder

Create pre-processing ([preglobal] in ~/.claws-mail/matcherrc) rule (one
or both) -- sorry for line wraps:
enabled rulename "futnew" new & test "/home/userid/bin/cmdate %d" move
"futuremail" 
enabled rulename "futunr" unread & test "/home/userid/bin/cmdate %d" move
"futuremail"

Save as /home/userid/bin/cmdate and make executable the attached python3
script. If you have python; but not python3, you may be able to convert
the script to python by:
- changing the first line to remove the "3"
- changing "print(...)" to "print ..."
- hope that the needed 'import' modules are available

>Is there a way of deleting them, not trash but just delete upon
>receipt?

Once you're satisfied that the rule is working correctly, replace
  move "futuremail"
with
  delete

HTH,
Pierre

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmdate
Type: application/octet-stream
Size: 1209 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20150527/b2d5d0df/attachment.obj>


More information about the Users mailing list