updated layout for webmail
This commit is contained in:
@@ -68,7 +68,7 @@ func TestEmailLogBodyKeptWhenQuarantined(t *testing.T) {
|
||||
t.Fatalf("send: %v", err)
|
||||
}
|
||||
|
||||
spamMsgs, err := backend.DB.ListMessagesInFolder(mailboxID, "Spam")
|
||||
spamMsgs, err := backend.DB.ListMessagesInFolder(mailboxID, "Junk")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ func TestAllowListBypassesSpamQuarantine(t *testing.T) {
|
||||
if err := send(t); err != nil {
|
||||
t.Fatalf("expected delivery accepted (quarantined) with a zero reject threshold and no allow-list entry, got: %v", err)
|
||||
}
|
||||
spamMsgs, err := backend.DB.ListMessagesInFolder(mailboxID, "Spam")
|
||||
spamMsgs, err := backend.DB.ListMessagesInFolder(mailboxID, "Junk")
|
||||
if err != nil || len(spamMsgs) != 1 {
|
||||
t.Fatalf("expected 1 quarantined message in Spam, got %d (err=%v)", len(spamMsgs), err)
|
||||
}
|
||||
@@ -170,7 +170,7 @@ func TestFilterRuleMarkReadSetsSeenFlag(t *testing.T) {
|
||||
|
||||
func TestFilterRuleMoveToFolderStoresInNamedFolder(t *testing.T) {
|
||||
backend, mailboxID := newTestBackendWithMailbox(t)
|
||||
if _, err := backend.DB.CreateRule(mailboxID, 0, "subject", "contains", "spam", "move_to_folder", "Spam"); err != nil {
|
||||
if _, err := backend.DB.CreateRule(mailboxID, 0, "subject", "contains", "spam", "move_to_folder", "Junk"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
addr := startTestServer(t, backend)
|
||||
@@ -205,7 +205,7 @@ func TestFilterRuleMoveToFolderStoresInNamedFolder(t *testing.T) {
|
||||
if len(inbox) != 0 {
|
||||
t.Fatalf("expected nothing in INBOX, found %d", len(inbox))
|
||||
}
|
||||
spam, err := backend.DB.ListMessagesInFolder(mailboxID, "Spam")
|
||||
spam, err := backend.DB.ListMessagesInFolder(mailboxID, "Junk")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ func TestRspamdExplicitRejectActionStillHardRejects(t *testing.T) {
|
||||
t.Fatal("expected delivery to be hard-rejected when rspamd's action is \"reject\"")
|
||||
}
|
||||
inboxMsgs, _ := backend.DB.ListMessagesInFolder(mailboxID, "INBOX")
|
||||
spamMsgs, _ := backend.DB.ListMessagesInFolder(mailboxID, "Spam")
|
||||
spamMsgs, _ := backend.DB.ListMessagesInFolder(mailboxID, "Junk")
|
||||
if len(inboxMsgs) != 0 || len(spamMsgs) != 0 {
|
||||
t.Fatalf("expected nothing stored anywhere for a hard reject, got INBOX=%d Spam=%d", len(inboxMsgs), len(spamMsgs))
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func TestRspamdScoreThresholdQuarantinesInsteadOfRejecting(t *testing.T) {
|
||||
if err := sendTestMessage(t, addr, "hi"); err != nil {
|
||||
t.Fatalf("expected delivery accepted (quarantined), got: %v", err)
|
||||
}
|
||||
spamMsgs, err := backend.DB.ListMessagesInFolder(mailboxID, "Spam")
|
||||
spamMsgs, err := backend.DB.ListMessagesInFolder(mailboxID, "Junk")
|
||||
if err != nil || len(spamMsgs) != 1 {
|
||||
t.Fatalf("expected 1 quarantined message in Spam, got %d (err=%v)", len(spamMsgs), err)
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ func (s *Session) Data(r io.Reader) error {
|
||||
// Privacy default: only headers (and the Subject field, logged separately below
|
||||
// regardless) go into the admin-visible log, never the message itself — unless this
|
||||
// sender/IP explicitly opted in via "Store Full Message Content" (storeMessage
|
||||
// above), or the message was quarantined to Spam for at least one recipient, in
|
||||
// above), or the message was quarantined to Junk for at least one recipient, in
|
||||
// which case an admin genuinely needs to see it to judge a spam/abuse report. When
|
||||
// stored, it's the *entire* raw message (not a plain-text extraction) so the log
|
||||
// viewer can render the real HTML body, inline images, and attachments — re-parsed
|
||||
@@ -447,7 +447,7 @@ func (s *Session) deliverLocally(rcpts, types []string, signedContent, messageID
|
||||
// (DNSBL hit, greylisting, etc.) worth still hard-rejecting at
|
||||
// SMTP time to avoid backscatter; a bare score threshold hit
|
||||
// (from either scorer) is quarantined instead of rejected, so a
|
||||
// false positive is recoverable from the Spam folder rather than
|
||||
// false positive is recoverable from the Junk folder rather than
|
||||
// silently bounced with no trace.
|
||||
if rAction == "reject" {
|
||||
hardReject = true
|
||||
@@ -463,14 +463,14 @@ func (s *Session) deliverLocally(rcpts, types []string, signedContent, messageID
|
||||
continue
|
||||
}
|
||||
if quarantine {
|
||||
folder = "Spam"
|
||||
folder = "Junk"
|
||||
spamGated = true
|
||||
}
|
||||
}
|
||||
|
||||
// Filter rules organize legitimate mail the recipient already trusts arriving
|
||||
// in their INBOX — a quarantined message skips them entirely and always lands
|
||||
// in Spam, rather than a rule accidentally routing spam back into view.
|
||||
// in Junk, rather than a rule accidentally routing spam back into view.
|
||||
if !spamGated {
|
||||
action, err := s.backend.Mailstore.ApplyRules(mbox.ID, map[string]string{"from": s.mailFrom, "to": rcpt, "subject": subject})
|
||||
if err != nil {
|
||||
@@ -503,7 +503,7 @@ func (s *Session) deliverLocally(rcpts, types []string, signedContent, messageID
|
||||
}
|
||||
serverResponse := "Delivered to local mailbox"
|
||||
if spamGated {
|
||||
serverResponse = "Quarantined to Spam folder"
|
||||
serverResponse = "Quarantined to Junk folder"
|
||||
}
|
||||
results = append(results, relay.Result{Recipient: rcpt, RecipientType: types[i], Status: "success", ServerResponse: serverResponse, Quarantined: spamGated})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user