mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 23:51:13 +01:00
log total number of email log for an alias when it is rate limited
This commit is contained in:
parent
17c13ee37f
commit
f6fd97ef05
1 changed files with 11 additions and 0 deletions
|
@ -1850,6 +1850,17 @@ def handle(envelope: Envelope) -> str:
|
|||
|
||||
if rate_limited(mail_from, rcpt_tos):
|
||||
LOG.w("Rate Limiting applied for mail_from:%s rcpt_tos:%s", mail_from, rcpt_tos)
|
||||
|
||||
# add more logging info. TODO: remove
|
||||
if len(rcpt_tos) == 1:
|
||||
alias = Alias.get_by(email=rcpt_tos[0])
|
||||
if alias:
|
||||
LOG.w(
|
||||
"total number email log on %s is %s",
|
||||
alias,
|
||||
EmailLog.query.filter(EmailLog.alias_id == alias.id).count(),
|
||||
)
|
||||
|
||||
if should_ignore_bounce(envelope.mail_from):
|
||||
return status.E207
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue