Commit b4a4c2e9 authored by Laurent Montel's avatar Laurent Montel 😁

Fix generated file

parent 737e85ae
...@@ -2,3 +2,4 @@ require "editheader"; ...@@ -2,3 +2,4 @@ require "editheader";
#SCRIPTNAME: Script part 0 #SCRIPTNAME: Script part 0
addheader "X-Sieve-Filtered" "kim@job.example.com"; addheader "X-Sieve-Filtered" "kim@job.example.com";
...@@ -13,4 +13,4 @@ if allof (header :contains "From" "mailer-daemon@foo.de" ...@@ -13,4 +13,4 @@ if allof (header :contains "From" "mailer-daemon@foo.de"
fileinto "folder"; fileinto "folder";
addflag [ "\\seen" ]; addflag [ "\\seen" ];
stop; stop;
} }
\ No newline at end of file
...@@ -25,4 +25,4 @@ rejected ...@@ -25,4 +25,4 @@ rejected
} else { } else {
keep :flags [ "\\Answered" ]; keep :flags [ "\\Answered" ];
} }
\ No newline at end of file
...@@ -4,4 +4,4 @@ require "variables"; ...@@ -4,4 +4,4 @@ require "variables";
#SCRIPTNAME: test1 #SCRIPTNAME: test1
if hasflag :is "foo" if hasflag :is "foo"
{ {
} }
\ No newline at end of file
...@@ -21,4 +21,4 @@ if virustest :value "gt" :comparator "i;ascii-numeric" "5" ...@@ -21,4 +21,4 @@ if virustest :value "gt" :comparator "i;ascii-numeric" "5"
. .
; ;
} }
\ No newline at end of file
...@@ -2,3 +2,4 @@ require "enotify"; ...@@ -2,3 +2,4 @@ require "enotify";
#SCRIPTNAME: Script part 0 #SCRIPTNAME: Script part 0
notify :importance "1" :message "You got mail" "xmpp:tim@example.com?message;subject=SIEVE"; notify :importance "1" :message "You got mail" "xmpp:tim@example.com?message;subject=SIEVE";
...@@ -3,3 +3,4 @@ require "editheader"; ...@@ -3,3 +3,4 @@ require "editheader";
#SCRIPTNAME: Script part 0 #SCRIPTNAME: Script part 0
# " create a problem during parsing # " create a problem during parsing
addheader "X-Sieve-Filtered" "<kim@job.example.com>"; addheader "X-Sieve-Filtered" "<kim@job.example.com>";
...@@ -3,7 +3,6 @@ if false # allof(not header :contains "X-Spam-Flag" "YES") ...@@ -3,7 +3,6 @@ if false # allof(not header :contains "X-Spam-Flag" "YES")
{ {
} }
#SCRIPTNAME: Script part 1 #SCRIPTNAME: Script part 1
if true # allof(not header :contains "X-Spam-Flag" "YES") if true # allof(not header :contains "X-Spam-Flag" "YES")
{ {
......
...@@ -22,4 +22,4 @@ if currentdate :matches "month" "*" ...@@ -22,4 +22,4 @@ if currentdate :matches "month" "*"
if header :is "list-id" "dovecot.dovecot.org" if header :is "list-id" "dovecot.dovecot.org"
{ {
fileinto :create "INBOX.Lists.${year}.${month}.dovecot"; fileinto :create "INBOX.Lists.${year}.${month}.dovecot";
} }
\ No newline at end of file
...@@ -20,3 +20,4 @@ if address :all :is "X-Delivered-To" "alias1@fastmail.fm" ...@@ -20,3 +20,4 @@ if address :all :is "X-Delivered-To" "alias1@fastmail.fm"
#SCRIPTNAME: Script part 1 #SCRIPTNAME: Script part 1
redirect "another@account.net"; redirect "another@account.net";
...@@ -12,4 +12,4 @@ if envelope :user :is "to" "postmaster" ...@@ -12,4 +12,4 @@ if envelope :user :is "to" "postmaster"
{ {
fileinto "inbox.postmaster"; fileinto "inbox.postmaster";
stop; stop;
} }
\ No newline at end of file
...@@ -10,3 +10,4 @@ foreverypart :name "foreach1" { ...@@ -10,3 +10,4 @@ foreverypart :name "foreach1" {
stop; stop;
} }
} }
...@@ -33,3 +33,4 @@ Thanks. ...@@ -33,3 +33,4 @@ Thanks.
keep; keep;
} }
} }
...@@ -9,3 +9,4 @@ if header :is [ "X-DSPAM-Result", "X-DSPAM-Reclassified" ] [ "Spam", "Virus" ] ...@@ -9,3 +9,4 @@ if header :is [ "X-DSPAM-Result", "X-DSPAM-Reclassified" ] [ "Spam", "Virus" ]
#SCRIPTNAME: Script part 1 #SCRIPTNAME: Script part 1
redirect "user@domain.com"; redirect "user@domain.com";
...@@ -19,3 +19,4 @@ John Doe ...@@ -19,3 +19,4 @@ John Doe
. .
; ;
...@@ -23,4 +23,4 @@ dsfgsdfgsdfg ...@@ -23,4 +23,4 @@ dsfgsdfgsdfg
if false if false
{ {
keep; keep;
} }
\ No newline at end of file
...@@ -20,4 +20,4 @@ dsfgsdfgsdfg ...@@ -20,4 +20,4 @@ dsfgsdfgsdfg
#SCRIPTNAME: Script part 2 #SCRIPTNAME: Script part 2
if false if false
{ {
} }
\ No newline at end of file
...@@ -363,6 +363,7 @@ QString SieveScriptListBox::generatedScript(QString &requires) const ...@@ -363,6 +363,7 @@ QString SieveScriptListBox::generatedScript(QString &requires) const
resultScript += QLatin1Char('#') + defaultScriptName() + item->text() + QLatin1Char('\n'); resultScript += QLatin1Char('#') + defaultScriptName() + item->text() + QLatin1Char('\n');
resultScript += item->generatedScript(lstRequires); resultScript += item->generatedScript(lstRequires);
} }
resultScript += QLatin1Char('\n');
QStringList endRequires; QStringList endRequires;
for (const QString &r : qAsConst(lstRequires)) { for (const QString &r : qAsConst(lstRequires)) {
......
...@@ -153,8 +153,6 @@ void SieveScriptPage::generatedScript(QString &script, QStringList &requires) ...@@ -153,8 +153,6 @@ void SieveScriptPage::generatedScript(QString &script, QStringList &requires)
} }
if (inForEveryPartLoop) { if (inForEveryPartLoop) {
script += QStringLiteral("\n}\n"); script += QStringLiteral("\n}\n");
} else {
script += QLatin1Char('\n');
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment