select puu.email, pm.sendstart, pb.status,
case
when instr(data, "Delivery to the following recipients failed.") > 0 then "Delivery failed."
when instr(data, "Unknown user") > 0 then "Unknown user"
when instr(data, "User unknown") > 0 then "Unknown user"
when instr(data, "malformed address") > 0 then "malformed address"
when instr(data, "No such user") > 0 then "No such user"
when instr(data, "mailbox unavailable") > 0 then "mailbox unavailable"
when instr(data, "retry timeout exceeded") > 0 then " retry timeout exceeded"
when instr(data, "Mailbox unknown or not accepting mail.") > 0 then "Mailbox unknown or not accepting mail."
else "General Failure ..."
end as reason,
substring(data,1,1000)
from phplist_user_message_bounce as pumb
join phplist_user_user as puu on pumb.user = puu.id
join phplist_bounce as pb on pb.id = pumb.bounce
join phplist_message as pm on pm.id = pumb.message
select puu.email,
case
when instr(data, "Unknown user") > 0 then "Unknown user"
when instr(data, "not listed") > 0 then "Unknown user"
when instr(data, "bad address") > 0 then "Unknown user"
when instr(data, "not a valid mailbox") > 0 then "Unknown user"
when instr(data, "User unknown") > 0 then "Unknown user"
when instr(data, "Does not exist") > 0 then "Unknown user"
when instr(data, "no mailbox here by that name") > 0 then "Unknown user"
when instr(data, "No such user") > 0 then "Unknown user"
when instr(data, "No such recipient") > 0 then "Unknown user"
when instr(data, "REJECT No user") > 0 then "Unknown user"
when instr(data, "Mailbox unknown or not accepting mail.") > 0 then "Unknown user"
when instr(data, "mailbox not available") > 0 then "Unknown user"
when instr(data, "mailbox unavailable") > 0 then "Unknown user"
when instr(data, "Unable to process recipient") > 0 then "Unknown user"
when instr(data, "unknown or illegal alias") > 0 then "Unknown user"
when instr(data, "571 spam source blocked") > 0 then "Spam Source Blocked"
when instr(data, "Rule imposed mailbox access") > 0 then "Spam Source Blocked"
when instr(data, "is restricted") > 0 then "Spam Source Blocked"
when instr(data, "This message appears to be unsolicited bulk mail") > 0 then "Spam Source Blocked"
when instr(data, "Requested action not taken: message refused") > 0 then "Spam Source Blocked"
when instr(data, "rejected for policy reasons") > 0 then "Spam Source Blocked"
when instr(data, "Access denied") > 0 then "Spam Source Blocked"
when instr(data, "Connection not authorized") > 0 then "Spam Source Blocked"
when instr(data, "Relaying denied. Proper authentication required") > 0 then "Spam Source Blocked"
when instr(data, "Recipient address rejected: Blocked") > 0 then "Spam Source Blocked"
when instr(data, "550 Mailbox unavailable or access denied") > 0 then "Spam Source Blocked"
when instr(data, "message refused") > 0 then "Spam Source Blocked"
when instr(data, "Message rejected") > 0 then "Spam Source Blocked"
when instr(data, "retry time not reached for any host after a long failure period") > 0 then "retry time not reached for any host after a long failure period"
when instr(data, "Address rejected") > 0 then "Address rejected"
when instr(data, "Delivery to the following recipients failed.") > 0 then "Delivery failed."
when instr(data, "malformed address") > 0 then "malformed address"
when instr(data, "retry timeout exceeded") > 0 then "retry timeout exceeded"
when instr(data, "mailbox name not allowed") > 0 then "553: mailbox name not allowed"
when instr(data, "554 transaction failed") > 0 then "554: transaction failed"
when instr(data, "554 TRANSACTION FAILED") > 0 then "554: transaction failed"
else "General Failure ..."
end as reason,
substring(data,1,2000)
from phplist_user_message_bounce as pumb
join phplist_user_user as puu on pumb.user = puu.id
join phplist_bounce as pb on pb.id = pumb.bounce
join phplist_message as pm on pm.id = pumb.message
-- bounces per domain
select SUBSTRING_INDEX(email, '@', -1) as domain, count(*) as bounces
from phplist_user_user PUU
join phplist_user_message_bounce PUMB on PUU.id = PUMB.user
group by domain order by bounces desc
Return to Advanced Answers, Howtos, Tips & Tricks
Users browsing this forum: No registered users and 2 guests