Return Permanent Failure when dealing with undeliverable mail
This commit is contained in:
parent
c1d9210c5e
commit
1a7c83d565
1 changed files with 6 additions and 2 deletions
|
@ -71,13 +71,17 @@ class MailEncryptionProxy:
|
|||
else:
|
||||
LOG.exception('Unexpected exception caught, bouncing message')
|
||||
|
||||
return xport.RESULT_TRANS_FAIL
|
||||
return xport.RESULT_PERM_FAIL
|
||||
|
||||
return xport.RESULT_OK
|
||||
|
||||
def _send_unencrypted(self, operation, envelope: Envelope, send: xport.SendFrom):
|
||||
# Do not parse and re-generate the message, just send it as it is.
|
||||
send(envelope.original_content, operation.recipients())
|
||||
try:
|
||||
send(envelope.original_content, operation.recipients())
|
||||
except:
|
||||
LOG.exception('Unencrypted delivery failed, returning PERMANENT FAILURE to sender')
|
||||
raise xport.PermanentFailure()
|
||||
|
||||
def _beginning(self, e: Envelope) -> bytes:
|
||||
double_eol_pos = e.original_content.find(DOUBLE_EOL_BYTES)
|
||||
|
|
Loading…
Reference in a new issue