diff --git a/internal/imap/mailbox_append.go b/internal/imap/mailbox_append.go index 6cbb68fe..829e36e6 100644 --- a/internal/imap/mailbox_append.go +++ b/internal/imap/mailbox_append.go @@ -132,6 +132,10 @@ func (im *imapMailbox) createDraftMessage(kr *crypto.KeyRing, email string, body return err } + if m.Sender == nil { + m.Sender = &mail.Address{} + } + m.Sender.Address = pmapi.ConstructAddress(m.Sender.Address, email) draft, _, err := im.user.storeUser.CreateDraft(kr, m, readers, "", "", "") diff --git a/test/features/bridge/imap/message/import.feature b/test/features/bridge/imap/message/import.feature index e3c9334e..b8960044 100644 --- a/test/features/bridge/imap/message/import.feature +++ b/test/features/bridge/imap/message/import.feature @@ -19,6 +19,7 @@ Feature: IMAP import messages """ Then IMAP response is "OK" + # I could not find any RFC why this is not valid. But for now our parser is not able to process it. @ignore Scenario: Import message with attachment name encoded by RFC 2047 without quoting When IMAP client imports message to "INBOX" @@ -118,6 +119,25 @@ Feature: IMAP import messages And API mailbox "INBOX" for "user" has 0 message And API mailbox "Sent" for "user" has 1 message + Scenario Outline: Import message without sender + When IMAP client imports message to "" + """ + To: Lionel Richie + Subject: RE: Hello, is it me you looking for? + + Nope. + + """ + Then IMAP response is "OK" + And API mailbox "" for "user" has 1 message + + Examples: + | mailbox | + | Drafts | + | Archive | + | Sent | + + Scenario: Import embedded message When IMAP client imports message to "INBOX" """