mirror of
https://github.com/mjl-/mox.git
synced 2025-06-28 05:48:15 +03:00
webmail: when forwarding, include the subject,date,from,reply-to,to,cc headers in the message
mentioned some time ago by ilijamt
This commit is contained in:
parent
4765bf3b2c
commit
1c4bf8909c
@ -3687,7 +3687,15 @@ const newMsgView = (miv, msglistView, listMailboxes, possibleLabels, messageLoad
|
||||
body = body.replace(/\r/g, '').replace(/\n\n\n\n*/g, '\n\n').trim();
|
||||
let editOffset = 0;
|
||||
if (forward) {
|
||||
body = '\n\n---- Forwarded Message ----\n\n' + body;
|
||||
let prefix = `\n\n---- Forwarded Message ----\n`;
|
||||
const keys = ['Subject', 'Date', 'From', 'Reply-To', 'To', 'Cc'];
|
||||
const padspace = (s, size) => s + ' '.repeat(size - s.length);
|
||||
for (const k of keys) {
|
||||
for (const v of (pm.Headers?.[k] || [])) {
|
||||
prefix += padspace(k + ':', 10) + v + '\n';
|
||||
}
|
||||
}
|
||||
body = prefix + '\n' + body;
|
||||
}
|
||||
else {
|
||||
body = body.split('\n').map(line => '> ' + line).join('\n');
|
||||
|
@ -2943,7 +2943,15 @@ const newMsgView = (miv: MsgitemView, msglistView: MsglistView, listMailboxes: l
|
||||
body = body.replace(/\r/g, '').replace(/\n\n\n\n*/g, '\n\n').trim()
|
||||
let editOffset = 0
|
||||
if (forward) {
|
||||
body = '\n\n---- Forwarded Message ----\n\n'+body
|
||||
let prefix = `\n\n---- Forwarded Message ----\n`
|
||||
const keys = ['Subject', 'Date', 'From', 'Reply-To', 'To', 'Cc']
|
||||
const padspace = (s: string, size: number) => s + ' '.repeat(size-s.length)
|
||||
for (const k of keys) {
|
||||
for (const v of (pm.Headers?.[k] || [])) {
|
||||
prefix += padspace(k + ':', 10) + v+'\n'
|
||||
}
|
||||
}
|
||||
body = prefix+'\n'+body
|
||||
} else {
|
||||
body = body.split('\n').map(line => '> ' + line).join('\n')
|
||||
let sig = accountSettings?.Signature || ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user