SQL command for deleting returned emails

Hello everyone.

I am recently using phpList version 3.6.8, with MySQL 8. After my first newsletter send to an old list of 200,000 Yahoo email addresses, about 25,000 wrong addresses resulted. For all these addresses the message was:

Subject: Undelivered Mail Returned to Sender

554 30 Sorry, your message to user_name@yahoo.com cannot be delivered. This mailbox is disabled (554.30). (in reply to end of DATA command)

I would like to remove all these addresses from the database so that the next time the newsletter is sent, only the correct addresses will be sent.

Can I do this directly from MySQL? Or do I have to take each error message and delete from the phpList GUI one by one each wrong email address?

What could be the SQL command that I should run in the MySQL database to delete all these wrong addresses at once? Or else, what is the table and columns in the database where these wrong e-mails are registered.

Such a solution would be of great use to me (and I hope for others too). Thanks.

@florin You should look at setting-up bounce handling so that phplist will deal with bounces automatically, see the online manual Bounce Management | phpList manual

Unless the returned emails are in phplist, then it won’t be able to help in identifying the email addresses. If you can do that manually then the Subscribers plugin has a command to delete a set of subscribers. See plugin:subscribers [phpList Resources]

Thank you @ducanc for your answer.
I installed the subscribers plugin you mentioned and it was very helpful.
After processing the bounces, I used the report area of the subscribers plugin and filtered the addresses according to the count number of bounces. The result was a list of 25,000 wrong email addresses. Then I used the delete option in the plugin to remove all these addresses.
Problem solved.