mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 11:44:38 +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:
@ -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');
|
||||
|
Reference in New Issue
Block a user