require [ "date" , "fileinto" , "mailbox" , "variables" ]; if currentdate :matches "year" "*" { set "year" "${1}"; } if currentdate :matches "month" "*" { set "month" "${1}"; } if exists "List-ID" { if header :matches "List-ID" "*<*.heureux-cyclage.org>*" { set "list" "${2}"; set "domain" "LHC"; } elsif header :matches "List-ID" "*<*.*.cyclocoop.org>*" { set "list" "${2}+${3}"; set "domain" "cyclocoop"; } elsif header :matches "List-ID" "*<*.cyclocoop.org>*" { set "list" "${2}"; set "domain" "cyclocoop"; } elsif header :matches "List-ID" "*<*.*.ptitvelo.net>*" { set "list" "${2}+${3}"; set "domain" "ptitvelo"; } elsif header :matches "List-ID" "*<*.ptitvelo.net>*" { set "list" "${2}"; set "domain" "ptitvelo"; } elsif header :matches "List-ID" "*<*.*.*.*>*" { set "list" "${2}"; set "domain" "${4}"; } elsif header :matches "List-ID" "*<*.*.*>*" { set "list" "${2}"; set "domain" "${3}"; } fileinto :create "Listes+${domain}+${list}+${year}+${month}"; stop; }