Delete outgoing emails

I have a discourse site that is only used for one month twice each year, therefore once that one month is over we save an image of the slice and shut everything down. Every time we boot up it attempts to send out a mass blast of digest emails to all the previous users, even though they’re well past the “hasn’t been seen in 20 days” setting to disable digest mail.

Thankfully during the switch from Mandrill to Mailgun on this last bootup because of a DNS problem it didn’t send out the digests, but now I’m stuck with thousands of unsent digests piling up in the log. I’ve fixed the DNS issue and have all emails disabled until I can get things cleaned up.

Is there any way to delete these messages that are sitting in the outbound queue? I certainly don’t need to spam thousands of people with digests that are from topics 6 months ago. I DO need to use digests for the new users.

1 Like

Easiest way to remove emails from the outbound queue is to flush redis

# ssh into your server
cd /var/discourse
./launcher enter app
redis-cli flushall
7 Likes

Fantastic, thank you!

2 Likes