Fix for X-Priority

This commit is contained in:
Winni Neessen 2022-03-13 19:28:40 +01:00
parent 06aff07a03
commit 8e31cf0133
Signed by: wneessen
GPG key ID: 5F3AF39B820C119D
2 changed files with 17 additions and 1 deletions

View file

@ -106,6 +106,22 @@ func (i Importance) NumString() string {
}
}
// XPrioString returns the X-Priority number string based on the Importance
func (i Importance) XPrioString() string {
switch i {
case ImportanceNonUrgent:
return "5"
case ImportanceLow:
return "5"
case ImportanceHigh:
return "1"
case ImportanceUrgent:
return "1"
default:
return ""
}
}
// String returns the importance string based on the Importance
func (i Importance) String() string {
switch i {

2
msg.go
View file

@ -308,7 +308,7 @@ func (m *Msg) SetImportance(i Importance) {
}
m.SetHeader(HeaderImportance, i.String())
m.SetHeader(HeaderPriority, i.NumString())
m.SetHeader(HeaderXPriority, i.NumString())
m.SetHeader(HeaderXPriority, i.XPrioString())
m.SetHeader(HeaderXMSMailPriority, i.NumString())
}