GODT-1189 GODT-1190 GODT-1191 Fix missing sender while creating draft.

This commit is contained in:
Jakub
2021-06-08 09:09:32 +02:00
parent 21cf7459c9
commit c482f768d9
2 changed files with 24 additions and 0 deletions

View File

@ -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, "", "", "")

View File

@ -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 "<mailbox>"
"""
To: Lionel Richie <lionel@richie.com>
Subject: RE: Hello, is it me you looking for?
Nope.
"""
Then IMAP response is "OK"
And API mailbox "<mailbox>" for "user" has 1 message
Examples:
| mailbox |
| Drafts |
| Archive |
| Sent |
Scenario: Import embedded message
When IMAP client imports message to "INBOX"
"""