diff --git a/internal/mail/router.go b/internal/mail/router.go index eb20b71a..e2481b50 100644 --- a/internal/mail/router.go +++ b/internal/mail/router.go @@ -141,11 +141,22 @@ func (r *Router) Send(msg *Message) error { } // Notify recipient if they have an active session - _ = r.notifyRecipient(msg) + // Skip notification for self-mail (handoffs to future-self don't need present-self notified) + if !isSelfMail(msg.From, msg.To) { + _ = r.notifyRecipient(msg) + } return nil } +// isSelfMail returns true if sender and recipient are the same identity. +// Normalizes addresses by removing trailing slashes for comparison. +func isSelfMail(from, to string) bool { + fromNorm := strings.TrimSuffix(from, "/") + toNorm := strings.TrimSuffix(to, "/") + return fromNorm == toNorm +} + // GetMailbox returns a Mailbox for the given address. // Routes to the correct beads database based on the address. func (r *Router) GetMailbox(address string) (*Mailbox, error) {