mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 08:13:16 +08:00
no need to create a copy of message when there's only 1 mailbox
This commit is contained in:
parent
5bb4c20fba
commit
2b2512e775
1 changed files with 13 additions and 2 deletions
|
@ -397,12 +397,23 @@ async def handle_forward(
|
|||
user = alias.user
|
||||
|
||||
ret = []
|
||||
for mailbox in alias.mailboxes:
|
||||
mailboxes = alias.mailboxes
|
||||
# no need to create a copy of message
|
||||
if len(mailboxes) == 1:
|
||||
mailbox = mailboxes[0]
|
||||
ret.append(
|
||||
await forward_email_to_mailbox(
|
||||
alias, copy(msg), email_log, contact, envelope, smtp, mailbox, user
|
||||
alias, msg, email_log, contact, envelope, smtp, mailbox, user
|
||||
)
|
||||
)
|
||||
# create a copy of message for each forward
|
||||
else:
|
||||
for mailbox in mailboxes:
|
||||
ret.append(
|
||||
await forward_email_to_mailbox(
|
||||
alias, copy(msg), email_log, contact, envelope, smtp, mailbox, user
|
||||
)
|
||||
)
|
||||
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Reference in a new issue