Libksieve

sievedefaulttemplate.cpp
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "sievedefaulttemplate.h"
8 #include "vacation/vacationutils.h"
9 
10 #include <KLocalizedString>
11 
12 QVector<PimCommon::defaultTemplate> KSieveUi::SieveDefaultTemplate::defaultTemplates()
13 {
15  PimCommon::defaultTemplate tmp;
16  tmp.name = i18n("Filter on Mailing List-ID");
17  tmp.text = QStringLiteral("require \"fileinto\";\n"
18  "if header :contains \"List-ID\" [ \"examples.com\", \"examples.mail.com\" ] {\n"
19  " fileinto \"list-example/examples\"; \n"
20  " stop;\n"
21  "}\n");
22  lst << tmp;
23 
24  tmp.name = i18n("Filter on Subject");
25  tmp.text = QStringLiteral("require \"fileinto\";\n"
26  "if header :contains \"Subject\" \"Foo Foo\" { \n"
27  " fileinto \"INBOX.Foo\"; \n"
28  "}\n");
29  lst << tmp;
30 
31  tmp.name = i18n("Filter on Spamassassin");
32  tmp.text = QStringLiteral("require \"fileinto\";\n"
33  "if header :contains \"X-Spam-Level\" \"*********\" { \n"
34  " fileinto \"Spam\";\n"
35  "}\n");
36  lst << tmp;
37 
38  tmp.name = i18n("Flag messages");
39  tmp.text = QStringLiteral("require \"imap4flags\";\n"
40  "if address \"From\" \"[email protected]\" { \n"
41  " setflag \"\\\\Seen\";\n"
42  "}\n");
43  lst << tmp;
44 
45  tmp.name = i18n("Forward Message");
46  tmp.text = QStringLiteral("require \"copy\";\n"
47  "if header :contains \"Subject\" \"foo\" { \n"
48  " redirect :copy \"[email protected]\";\n"
49  "}\n");
50  lst << tmp;
51 
52  tmp.name = i18n("Forward Message and add copy");
53  tmp.text = QStringLiteral("require [\"copy\", \"fileinto\"];\n"
54  "if header :contains \"Subject\" \"foo\" { \n"
55  " redirect :copy \"[email protected]\";\n"
56  " fileinto \"Forwarded Messages\"; \n"
57  "}\n");
58  lst << tmp;
59 
60  tmp.name = i18n("Destroy mail posted by...");
61  tmp.text = QStringLiteral("if header :contains [\"from\",\"cc\"]\n"
62  "[\n"
63  "\"[email protected]\",\n"
64  "\"[email protected]\"\n"
65  "]\n"
66  "{\n"
67  " discard;\n"
68  " stop;\n"
69  "}\n");
70  lst << tmp;
71 
72  tmp.name = i18n("Vacations");
73 
74  tmp.text = QStringLiteral("require \"vacation\";\n\n"
75  "if header :contains \"X-Spam-Flag\" \"YES\" { keep; stop; }\n"
76  "vacation :addresses [ \"[email protected]\", \"[email protected]\" ] :days 7 text: \n%1"
77  "\n.\n;\n").arg(VacationUtils::defaultMessageText());
78  lst << tmp;
79 
80  return lst;
81 }
QString i18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jan 21 2021 23:12:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.