Page 1 of 1

Lots and lots of emails in queue

Posted: 01 Oct 2018 11:43
by modcar
It seems something created an email loop, and I've ended up with eFa and my main mail server unable to process so many emails.

I'm unsure how many emails are in the eFa queue, last time I was able to get a count, it was around 350,000

I've fixed up my main mail server, removing 400,000 emails from the queue. But I can't seem to move eFa's queue. I've tried a few methods found on google, but after leaving it for 24 hours, it removed "only" 70,000 emails.

I need to get the eFa queue processed, as there's a few hundred real emails in there. There are lots from double-bounce@domain.com

Re: Lots and lots of emails in queue

Posted: 01 Oct 2018 21:25
by shawniverson
Check your bounce notifications in /etc/postfix/main.cf

Particularly 2bounce in the notify classes.

Remove it, at least until you get your mail loop resolved.

Re: Lots and lots of emails in queue

Posted: 03 Oct 2018 20:54
by modcar
I've commented out 2bounce, bounce and delay. Its been 4 days now, and I still can't access eFa, or the postfix queue through Webmin

Re: Lots and lots of emails in queue

Posted: 03 Oct 2018 20:58
by modcar
I'm not getting this when accessing the web page (previously, the page would timeout)

Error: Database connection failed

It is possible that the database is overloaded or otherwise not running properly

Contact the system administrator if the problem persists

Re: Lots and lots of emails in queue

Posted: 03 Oct 2018 22:20
by shawniverson
Is the database (mariadb) running?

Re: Lots and lots of emails in queue

Posted: 04 Oct 2018 09:18
by modcar
No its not - and starting it returns "......................... ERROR!"

I can't see anything useful in logs either

Re: Lots and lots of emails in queue

Posted: 04 Oct 2018 09:43
by shawniverson
What is your available disk space?

Code: Select all

df -h

Re: Lots and lots of emails in queue

Posted: 05 Oct 2018 08:20
by modcar
30% used. I rebooted the server and sql started,

I've removed abother 140,000 double bounce emails from the queue, and counting.

Still cant access efa web page, and cant load postfix in webmin - Im guessing theres still allot in the queue.

Re: Lots and lots of emails in queue

Posted: 09 Oct 2018 07:44
by pdwalker
What's the output of

Code: Select all

mailq |wc -l

Re: Lots and lots of emails in queue

Posted: 09 Oct 2018 20:34
by modcar
I've been running this:

Code: Select all

mailq | tail -n +2 | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == "double-bounce@domain.com")
print $1 }
' | tr -d '*!' | postsuper -d -
and

Code: Select all

mailq | tail -n +2 | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($7 == "double-bounce@domain.com")
print $1 }
' | tr -d '*!' | postsuper -d -
I left it running for a day while I went and did something else, it had removed 3.8 million emails from the queue - within 5 minutes, there were 5000 emails in the queue again

For the past 24 hours, I've had this bash script running:

Code: Select all

#!/bin/bash
for (( ; ; ))
do

mailq | tail -n +2 | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == "double-bounce@domain.com")
print $1 }
' | tr -d '*!' | postsuper -d -

mailq | tail -n +2 | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($7 == "double-bounce@domain.com")
print $1 }
' | tr -d '*!' | postsuper -d -

sleep 5
done
on each loop its deleting 400-800 emails from the queue.

I don't understand where these double bounces are coming from, 10 days ago I commented out the 2bounce line in main.cf

Re: Lots and lots of emails in queue

Posted: 10 Oct 2018 04:23
by pdwalker
What do your log files say? Surely there is a reason given for the double bounces.

Dumb question, but I need to ask: after changing the configuration, did you restart postfix/mailscanner?

Re: Lots and lots of emails in queue

Posted: 10 Oct 2018 04:40
by modcar
No question is a dumb one!

Yes, restarted postfix & mail scanner and also the server many many times.

I was going to look through the mail log, but it was 4.2gb. There's no way I can open a 4gb txt file in any sort of reader, so rather than worrying what was in there and never being able to read it, I trashed it

Now I don't know what I did, but 45 mins after my last post, it all settled down, no more double bounces

eFa sat there idle for an hour or so, so I started pushing mail through it, all seems well, so I directed all mail through it again.

All still seems well - like nothing ever happened, so I dunno? time of the month maybe?