Libksieve

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

KDE's Doxygen guidelines are available online.