test-current-date-custom-ref.siv 516 Bytes
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1 2 3 4
require "date";
require "variables";
require "fileinto";
require "mailbox";
Laurent Montel's avatar
Laurent Montel committed
5

Laurent Montel's avatar
Laurent Montel committed
6
#SCRIPTNAME: Script part 0
Laurent Montel's avatar
Laurent Montel committed
7
# Extract date info
Laurent Montel's avatar
Laurent Montel committed
8 9 10 11
if currentdate :matches "year" "*"
{
    set "year" "${1}";
} 
Laurent Montel's avatar
Laurent Montel committed
12

Laurent Montel's avatar
Laurent Montel committed
13 14 15 16 17 18 19
#SCRIPTNAME: Script part 1
if currentdate :matches "month" "*"
{
    set "month" "${1}";
} 

#SCRIPTNAME: Script part 2
Laurent Montel's avatar
Laurent Montel committed
20 21
# Archive Dovecot mailing list items by year and month.
# Create folder when it does not exist.
Laurent Montel's avatar
Laurent Montel committed
22 23 24
if header :is "list-id" "dovecot.dovecot.org"
{
    fileinto :create "INBOX.Lists.${year}.${month}.dovecot";
Laurent Montel's avatar
Laurent Montel committed
25
}