修复按收件用户拦截黑名单邮件并补齐历史邮件警示
This commit is contained in:
1 parent
05947180d8
commit
2026816369
10 files changed
+136
-10
No files matched your search
@@ -73,6 +73,7 @@ func NewEmailAuthentication(spfPassed, dkimPassed bool) *EmailAuthentication {
|
||||
|
||||
// Email is the type used for email messages
|
||||
type Email struct {
|
||||
EnvelopeFrom string
|
||||
ReplyTo []*User
|
||||
From *User
|
||||
To []*User
|
||||
@@ -93,6 +94,20 @@ type Email struct {
|
||||
Authentication *EmailAuthentication
|
||||
}
|
||||
|
||||
func (e *Email) SenderFilterAddresses() []string {
|
||||
if e == nil {
|
||||
return nil
|
||||
}
|
||||
addresses := []string{e.EnvelopeFrom}
|
||||
if e.From != nil {
|
||||
addresses = append(addresses, e.From.EmailAddress)
|
||||
}
|
||||
if e.Sender != nil {
|
||||
addresses = append(addresses, e.Sender.EmailAddress)
|
||||
}
|
||||
return addresses
|
||||
}
|
||||
|
||||
type StoredEmailFields struct {
|
||||
ReplyTo string
|
||||
To string
|
||||
|
||||
@@ -3,12 +3,13 @@ package response
|
||||
import "git.pcux.cn/xuans/Smail/models"
|
||||
|
||||
type EmailResponseData struct {
|
||||
models.Email `xorm:"extends"`
|
||||
IsRead int8 `json:"is_read"`
|
||||
IsDeleted int8 `json:"-"`
|
||||
UserStatus int8 `xorm:"user_status" json:"-"`
|
||||
SerialNumber int `json:"serial_number"`
|
||||
UeId int `json:"ue_id"`
|
||||
models.Email `xorm:"extends"`
|
||||
IsRead int8 `json:"is_read"`
|
||||
IsDeleted int8 `json:"-"`
|
||||
UserStatus int8 `xorm:"user_status" json:"-"`
|
||||
SerialNumber int `json:"serial_number"`
|
||||
UeId int `json:"ue_id"`
|
||||
IsBlacklisted bool `xorm:"-" json:"is_blacklisted"`
|
||||
}
|
||||
|
||||
type UserEmailUIDData struct {
|
||||
|
||||
Reference in new issue
Block a user