Skip to content

Commit

Permalink
Mail: Send all extra MIME headers (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilRashbrook authored Aug 12, 2024
1 parent 2ebbb3e commit 7ca7361
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/logic/Mail/EWS/EWSAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ export class EWSAccount extends MailAccount {
}))),
}, "item:Attachments");
}
for (let [header, value] of email.headers.entries()) {
request.addField("Message", "ExtendedProperty", {
if (email.headers.hasItems) {
request.addField("Message", "ExtendedProperty", [...email.headers.entries()].map(([header, value]) => ({
t$ExtendedFieldURI: {
PropertyName: header,
DistinguishedPropertySetId: "InternetHeaders",
PropertyType: "String",
// TODO Sends header names as all-lowercase. Should preserve casing.
},
t$Value: value,
}, null);
})), null);
}
if (email.inReplyTo) {
request.addField("Message", "InReplyTo", email.inReplyTo, "item:InReplyTo");
Expand Down
9 changes: 4 additions & 5 deletions app/logic/Mail/OWA/OWAAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,16 @@ export class OWAAccount extends MailAccount {
Content: await blobToBase64(attachment.content),
}))), "item:Attachments");
}
/* TODO FIXME Send additional headers
for (let [header, value] of email.headers.entries()) {
request.addField("Message", "ExtendedProperty", {
if (email.headers.hasItems) {
request.addField("Message", "ExtendedProperty", [...email.headers.entries()].map(([header, value]) => ({
ExtendedFieldURI: {
PropertyName: header,
DistinguishedPropertySetId: "InternetHeaders",
PropertyType: "String",
},
Value: value,
}, null);
}*/
})), null);
}
if (email.inReplyTo) {
request.addField("Message", "InReplyTo", email.inReplyTo, "item:InReplyTo");
}
Expand Down

0 comments on commit 7ca7361

Please sign in to comment.