KMime
Go to the documentation of this file.
22 #include "kmime_version.h"
23 #include "kmime_util.h"
24 #include "kmime_codecs_p.h"
25 #include "kmime_debug.h"
27 #include <KLocalizedString>
31 #ifdef Q_OS_WIN // gethostname
32 # include <winsock2.h>
36 #include <KLazyLocalizedString>
48 } dispositionTypes[] = {{Displayed,
50 kli18n(
"The message sent on ${date} to ${to} with subject "
51 "\"${subject}\" has been displayed. This is no guarantee that "
52 "the message has been read or understood.")},
55 kli18n(
"The message sent on ${date} to ${to} with subject "
56 "\"${subject}\" has been deleted unseen. This is no guarantee "
57 "that the message will not be \"undeleted\" and nonetheless "
61 kli18n(
"The message sent on ${date} to ${to} with subject "
62 "\"${subject}\" has been dispatched. This is no guarantee "
63 "that the message will not be read later on.")},
66 kli18n(
"The message sent on ${date} to ${to} with subject "
67 "\"${subject}\" has been processed by some automatic means.")},
70 kli18n(
"The message sent on ${date} to ${to} with subject "
71 "\"${subject}\" has been acted upon. The sender does not wish "
72 "to disclose more details to you than that.")},
75 kli18n(
"Generation of a Message Disposition Notification for the "
76 "message sent on ${date} to ${to} with subject \"${subject}\" "
77 "failed. Reason is given in the Failure: header field below.")}};
79 static const int numDispositionTypes =
80 sizeof dispositionTypes /
sizeof *dispositionTypes;
82 static const char *stringFor(DispositionType d)
84 for (
int i = 0 ; i < numDispositionTypes ; ++i) {
85 if (dispositionTypes[i].dispositionType == d) {
86 return dispositionTypes[i].string;
98 } dispositionModifiers[] = {
101 { Superseded,
"superseded" },
102 { Expired,
"expired" },
103 { MailboxTerminated,
"mailbox-terminated" }
106 static const int numDispositionModifiers =
107 sizeof dispositionModifiers /
sizeof *dispositionModifiers;
109 static const char *stringFor(DispositionModifier m)
111 for (
int i = 0 ; i < numDispositionModifiers ; ++i) {
112 if (dispositionModifiers[i].dispositionModifier == m) {
113 return dispositionModifiers[i].string;
123 static const struct {
127 { ManualAction,
"manual-action" },
128 { AutomaticAction,
"automatic-action" }
131 static const int numActionModes =
132 sizeof actionModes /
sizeof *actionModes;
134 static const char *stringFor(ActionMode a)
136 for (
int i = 0 ; i < numActionModes ; ++i) {
137 if (actionModes[i].actionMode == a) {
138 return actionModes[i].string;
148 static const struct {
152 { SentManually,
"MDN-sent-manually" },
153 { SentAutomatically,
"MDN-sent-automatically" }
156 static const int numSendingModes =
157 sizeof sendingModes /
sizeof *sendingModes;
159 static const char *stringFor(SendingMode s)
161 for (
int i = 0 ; i < numSendingModes ; ++i) {
162 if (sendingModes[i].sendingMode == s) {
163 return sendingModes[i].string;
169 static QByteArray dispositionField(DispositionType d, ActionMode a,
175 result += stringFor(a);
177 result += stringFor(s);
179 result += stringFor(d);
184 mt != m.
end(); ++mt) {
191 result += stringFor(*mt);
193 return result +
'\n';
201 return "Final-Recipient: rfc822; "
211 return "Original-Recipient: " + recipient +
'\n';
220 return "Original-Message-ID: " + msgid +
'\n';
227 if (gethostname(hostName, 255)) {
230 hostName[255] =
'\0';
233 QByteArray(
"; KMime " KMIME_VERSION_STRING
"\n");
243 spec = special.left(special.length() - 1);
250 result += orginalRecipient(o);
251 result += finalRecipient(r);
252 result += originalMessageID(omid);
253 result += dispositionField(d, a, s, m);
268 for (
int i = 0 ; i < numDispositionTypes ; ++i) {
269 if (dispositionTypes[i].dispositionType == d) {
270 return dispositionTypes[i].description.toString();
273 qCWarning(KMIME_LOG) <<
"KMime::MDN::descriptionFor(): No such disposition type:"
274 <<
static_cast<int>(d);
ActionMode
The following disposition modes are defined:
const KIMAP2_EXPORT QByteArray encodeRFC2047String(const QByteArray &str)
bool contains(const T &value) const const
Provides support for Message Disposition Notifications.
bool isEmpty() const const
DispositionType
The following disposition-types are defined:
const AKONADI_MIME_EXPORT char Deleted[]
DispositionModifier
The following disposition modifiers are defined:
bool isEmpty() const const
QByteArray dispositionNotificationBodyContent(const QString &r, const QByteArray &o, const QByteArray &omid, DispositionType d, ActionMode a, SendingMode s, const QList< DispositionModifier > &m, const QString &special)
Generates the content of the message/disposition-notification body part.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 03:53:31 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.