mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 11:44:38 +03:00
webmail: fix for ignoring error about sending to invalid address
before, an error about an invalid address was not used, causing a delivery attempt to an empty address (empty localpart/domain). delivery to that address would fail, but we should've prevented that message from being queued at all. additionally, an error in adding the message to the queue was ignored too.
This commit is contained in:
@ -253,6 +253,14 @@ func Add(ctx context.Context, log mlog.Log, senderAccount string, msgFile *os.Fi
|
||||
if qm.ID != 0 {
|
||||
return fmt.Errorf("id of queued messages must be 0")
|
||||
}
|
||||
if qm.RecipientDomainStr == "" {
|
||||
return fmt.Errorf("recipient domain cannot be empty")
|
||||
}
|
||||
// Sanity check, internal consistency.
|
||||
rcptDom := formatIPDomain(qm.RecipientDomain)
|
||||
if qm.RecipientDomainStr != rcptDom {
|
||||
return fmt.Errorf("mismatch between recipient domain and string form of domain")
|
||||
}
|
||||
}
|
||||
|
||||
if Localserve {
|
||||
|
Reference in New Issue
Block a user