mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-07 13:44:13 +08:00
Merge pull request #1843 from edlerd/add-spf-dmarc
Add dmarc and spf indicators in mail view
This commit is contained in:
commit
7eaa065d76
2 changed files with 39 additions and 2 deletions
|
@ -130,6 +130,8 @@ export class MailMessageView extends AbstractViewRight {
|
|||
// viewer
|
||||
viewFromShort: '',
|
||||
dkimData: ['none', '', ''],
|
||||
spfData: ['none', '', ''],
|
||||
dmarcData: ['none', '', ''],
|
||||
nowTracking: false
|
||||
});
|
||||
|
||||
|
@ -194,7 +196,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
dkimIcon: () => {
|
||||
switch (this.dkimData()[0]) {
|
||||
case 'none':
|
||||
return '';
|
||||
return '🚫︎';
|
||||
case 'pass':
|
||||
return '✔';
|
||||
default:
|
||||
|
@ -202,12 +204,43 @@ export class MailMessageView extends AbstractViewRight {
|
|||
}
|
||||
},
|
||||
dkimIconClass: () => 'pass' === this.dkimData()[0] ? 'iconcolor-green' : 'iconcolor-red',
|
||||
|
||||
dkimTitle:() => {
|
||||
const dkim = this.dkimData();
|
||||
return dkim[0] ? dkim[2] || 'DKIM: ' + dkim[0] : '';
|
||||
},
|
||||
|
||||
spfIcon: () => {
|
||||
switch (this.spfData()[0]) {
|
||||
case 'none':
|
||||
return '🚫︎';
|
||||
case 'pass':
|
||||
return '✔';
|
||||
default:
|
||||
return '✖';
|
||||
}
|
||||
},
|
||||
spfIconClass: () => 'pass' === this.spfData()[0] ? 'iconcolor-green' : 'iconcolor-red',
|
||||
spfTitle:() => {
|
||||
const spf = this.spfData();
|
||||
return spf[0] ? spf[2] || 'SPF: ' + spf[0] : '';
|
||||
},
|
||||
|
||||
dmarcIcon: () => {
|
||||
switch (this.dmarcData()[0]) {
|
||||
case 'none':
|
||||
return '🚫︎';
|
||||
case 'pass':
|
||||
return '✔';
|
||||
default:
|
||||
return '✖';
|
||||
}
|
||||
},
|
||||
dmarcIconClass: () => 'pass' === this.dmarcData()[0] ? 'iconcolor-green' : 'iconcolor-red',
|
||||
dmarcTitle:() => {
|
||||
const dmarc = this.dmarcData();
|
||||
return dmarc[0] ? dmarc[2] || 'DMARC: ' + dmarc[0] : '';
|
||||
},
|
||||
|
||||
showWhitelistOptions: () => 'match' === SettingsUserStore.viewImages(),
|
||||
|
||||
firstUnsubsribeLink: () => currentMessage()?.unsubsribeLinks()[0] || '',
|
||||
|
@ -230,6 +263,8 @@ export class MailMessageView extends AbstractViewRight {
|
|||
// TODO: make first param a user setting #683
|
||||
this.viewFromShort(message.from.toString(false, true));
|
||||
this.dkimData(message.dkim[0] || ['none', '', '']);
|
||||
this.spfData(message.spf[0] || ['none', '', '']);
|
||||
this.dmarcData(message.dmarc[0] || ['none', '', '']);
|
||||
this.nowTracking(false);
|
||||
} else {
|
||||
MessagelistUserStore.selectedMessage(null);
|
||||
|
|
|
@ -143,6 +143,8 @@
|
|||
<div class="informationShort">
|
||||
<span class="from" data-bind="html: viewFromShort, attr:{ title: message().from }"></span>
|
||||
<i class="fontastic" data-bind="text: dkimIcon, css: dkimIconClass, attr:{ title: dkimTitle }"></i>
|
||||
<i class="fontastic" data-bind="text: dmarcIcon, css: dmarcIconClass, attr:{ title: dmarcTitle }"></i>
|
||||
<i class="fontastic" data-bind="text: spfIcon, css: spfIconClass, attr:{ title: spfTitle }"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="messageItem">
|
||||
|
|
Loading…
Add table
Reference in a new issue