stash
This commit is contained in:
parent
4fbfaf3062
commit
39ac8e0522
|
@ -298,11 +298,15 @@ class LMTPHandler:
|
|||
|
||||
return '250 Message accepted for delivery'
|
||||
except SpecialMailException as e:
|
||||
log.warning(f"Special mail exception: {e}")
|
||||
return '250 Message accepted for delivery'
|
||||
except Exception as e:
|
||||
import uuid
|
||||
random_filename = 'mail-' + str(uuid.uuid4())
|
||||
with open(random_filename, 'wb') as f:
|
||||
f.write(content)
|
||||
log.warning(f"Special mail exception: {e}")
|
||||
return '250 Message accepted for delivery'
|
||||
except Exception as e:
|
||||
from hashlib import sha256
|
||||
random_filename = 'mail-' + sha256(content).hexdigest()
|
||||
with open(random_filename, 'wb') as f:
|
||||
f.write(content)
|
||||
log.error(f"Saved email to {random_filename} because of error %s (%s)", e, type(e))
|
||||
|
|
Loading…
Reference in a new issue