mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-25 07:54:11 -05:00
FIX: receiving a bounce from a deleted user
This commit is contained in:
parent
d0a51df4d0
commit
8c51d34100
1 changed files with 10 additions and 8 deletions
|
@ -150,15 +150,17 @@ module Email
|
||||||
bounce_key = verp[/\+verp-(\h{32})@/, 1]
|
bounce_key = verp[/\+verp-(\h{32})@/, 1]
|
||||||
if bounce_key && (email_log = EmailLog.find_by(bounce_key: bounce_key))
|
if bounce_key && (email_log = EmailLog.find_by(bounce_key: bounce_key))
|
||||||
email_log.update_columns(bounced: true)
|
email_log.update_columns(bounced: true)
|
||||||
|
email = email_log.user.try(:email) || @from_email
|
||||||
if @mail.error_status.present?
|
if email.present?
|
||||||
if @mail.error_status.start_with?("4.")
|
if @mail.error_status.present?
|
||||||
Email::Receiver.update_bounce_score(email_log.user.email, SOFT_BOUNCE_SCORE)
|
if @mail.error_status.start_with?("4.")
|
||||||
elsif @mail.error_status.start_with?("5.")
|
Email::Receiver.update_bounce_score(email, SOFT_BOUNCE_SCORE)
|
||||||
Email::Receiver.update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE)
|
elsif @mail.error_status.start_with?("5.")
|
||||||
|
Email::Receiver.update_bounce_score(email, HARD_BOUNCE_SCORE)
|
||||||
|
end
|
||||||
|
elsif is_auto_generated?
|
||||||
|
Email::Receiver.update_bounce_score(email, HARD_BOUNCE_SCORE)
|
||||||
end
|
end
|
||||||
elsif is_auto_generated?
|
|
||||||
Email::Receiver.update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue