roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.65k stars 1.61k forks source link

Not remove comments from sieve scripts when editing #9231

Open hdijkema opened 7 months ago

hdijkema commented 7 months ago

managesieve removes all comments from sieve scripts and replaces them with one per rule:

rule:

sieveeditor (KDE) uses

SCRIPTNAME:

sieveeditor does not remove the 'rule' comment, but managesieve does remove the SCRIPTNAME comment.

Please correct this behaviour of managesieve.

alecpl commented 7 months ago

Could you provide a sample script? Is it in the file head or what exactly?

hdijkema commented 7 months ago

Yes I can, see e.g. below my spam rules in addition to what spamassassin does.

require "body";
require "imap4flags";
require "fileinto";

#SCRIPTNAME: Deel 0 van script
# rule:[DMARC]
if anyof (header :contains "from" "DMARC Report"
, header :contains "subject" "Dmarc Aggregate Report"
, header :contains "from" "noreply-dmarc-support@google.com"
, header :contains "from" "dmarc.yahoo.com"
, header :contains "subject" "DMARC Forensic Report"
, header :contains "from" "dmarcreport@microsoft.com"
, header :contains "from" "postmaster@s02.spamexperts.axc.nl"
, header :contains "from" "postmaster@srv2a.flexfilter.nl"
, body :text :contains "This is a DMARC aggregate report for nvkh.nl"
)
{
    setflag [ "\\Seen" ];
    fileinto "Trash";
} 

#SCRIPTNAME: Deel 1 van script
# rule:[Request for quotation Industrial Automation]
if header :contains "subject" "Request for quotation Industrial Automation"
{
    setflag [ "\\Seen" ];
    fileinto "Spam";
} 

#SCRIPTNAME: Deel 2 van script
# rule:[from filter]
if anyof (header :contains "from" "Vertaler apparaat"
, header :contains "from" "Male C+"
, header :contains "from" "Testosteronbooster"
, header :contains "from" "mazamins.uk"
, header :contains "from" "andersins.de"
, header :contains "from" "Delivery"
, header :contains "from" "falstione.gb.net"
, header :contains "from" "alfa-hotel.free.hr"
, header :contains "from" "@sharpcatch.info"
, header :contains "from" "Fijne Halloween"
, header :contains "from" "Removio"
, header :contains "from" "#1 FORMULA"
, header :contains "from" "Seat Cushion"
, header :contains "from" "Mail Server Authorization Maintenance"
, header :contains "from" "Prompt Authorization at"
, header :contains "from" "Huusk Japan"
, header :contains "from" "Portable WiFi"
, header :contains "from" "Synoshi"
, header :contains "from" "Legal Casino"
, header :contains "from" "Keto Dieet"
, header :contains "from" "Translator #1"
, header :contains "from" "Keto"
, header :contains "from" "Australian Market"
, header :contains "from" "@grindfood.info"
, header :contains "from" "Proctologie"
, header :contains "from" "Raptor"
)
{
    setflag [ "\\Seen" ];
    fileinto "Spam";
} 

#SCRIPTNAME: Deel 3 van script
# rule:[subject filter]
if anyof (header :contains "subject" "kalkvrij water"
, header :contains "subject" "10 Days Detoxication"
, header :contains "subject" "Dit is uw kans"
, header :contains "subject" "PEEK antiaanbaklaag"
, header :contains "subject" "spataderen kwijt zonder operatie"
, header :contains "subject" "Nespresso Vertuo"
, header :contains "subject" "Detox Programma Nuubu"
, header :contains "subject" "Ryoko Portable Wi-fi"
, header :contains "subject" "Derila Kussen"
, header :contains "subject" "Directe tweetalige taalvertaler"
, header :contains "subject" "Removio"
, header :contains "subject" "Online store for best price"
, header :contains "subject" "De beste pillen"
, header :contains "subject" "Renforce le système cardiovasculaire"
, header :contains "subject" "Individuele prognose voor gewichtsverlies"
, header :contains "subject" "De beste site om"
, header :contains "subject" "plannen om uw auto te verkopen"
, header :contains "subject" "je bent geselecteerd"
, header :contains "subject" "verhoog je huiswaarde"
, header :contains "subject" "Uw auto kwijtraken"
, header :contains "subject" "Zonnepanelen tegen bodemprijzen"
, header :contains "subject" "keukenmessen"
)
{
    setflag [ "\\Seen" ];
    fileinto "Spam";
} 

#SCRIPTNAME: Deel 4 van script
# rule:[vertaler filter]
if allof (header :contains "subject" "meertalig"
, header :contains "subject" "communiceren"
, header :contains "subject" "talen"
)
{
    setflag [ "\\Seen" ];
    fileinto "Spam";
} 

#SCRIPTNAME: Deel 5 van script
# rule:[invest filter]
if anyof (header :contains "subject" "Invest in Films"
, header :contains "subject" "Invest in Lithium Mining in Australia"
, header :contains "subject" "Invest in"
)
{
    setflag [ "\\Seen" ];
    fileinto "Spam";
} 

#SCRIPTNAME: Body Spam
# rule:[body filter]
if body :text :contains "www.carsmiddennederland.nl"
{
    setflag [ "\\Seen" ];
    fileinto "Spam";
} 
hdijkema commented 7 months ago

Please also have a look at: https://bugs.kde.org/show_bug.cgi?id=477755

They have decided to support your 'rule' way of naming scripts.