if contact is blocked, do not forward email
This commit is contained in:
parent
507d10cd89
commit
a4dbbb6ac2
|
@ -564,7 +564,7 @@ def handle_forward(envelope, msg: Message, rcpt_to: str) -> List[Tuple[bool, str
|
||||||
else:
|
else:
|
||||||
reply_to_contact = get_or_create_reply_to_contact(reply_to, alias)
|
reply_to_contact = get_or_create_reply_to_contact(reply_to, alias)
|
||||||
|
|
||||||
if not alias.enabled:
|
if not alias.enabled or contact.block_forward:
|
||||||
LOG.d("%s is disabled, do not forward", alias)
|
LOG.d("%s is disabled, do not forward", alias)
|
||||||
EmailLog.create(
|
EmailLog.create(
|
||||||
contact_id=contact.id,
|
contact_id=contact.id,
|
||||||
|
@ -574,7 +574,7 @@ def handle_forward(envelope, msg: Message, rcpt_to: str) -> List[Tuple[bool, str
|
||||||
commit=True,
|
commit=True,
|
||||||
)
|
)
|
||||||
Session.commit()
|
Session.commit()
|
||||||
# do not return 5** to allow user to receive emails later when alias is enabled
|
# do not return 5** to allow user to receive emails later when alias is enabled or contact is unblocked
|
||||||
return [(True, status.E200)]
|
return [(True, status.E200)]
|
||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
|
|
Loading…
Reference in New Issue