Lots and lots of emails in queue

General E.F.A. discussion
Post Reply
modcar
Posts: 7
Joined: 05 Jul 2018 00:53

Lots and lots of emails in queue

Post by modcar » 01 Oct 2018 11:43

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

User avatar
shawniverson
Posts: 2605
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Lots and lots of emails in queue

Post by shawniverson » 01 Oct 2018 21:25

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.
Version 3.0.2.6 released! Update now to keep your eFa secure!

modcar
Posts: 7
Joined: 05 Jul 2018 00:53

Re: Lots and lots of emails in queue

Post by modcar » 03 Oct 2018 20:54

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

modcar
Posts: 7
Joined: 05 Jul 2018 00:53

Re: Lots and lots of emails in queue

Post by modcar » 03 Oct 2018 20:58

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

User avatar
shawniverson
Posts: 2605
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Lots and lots of emails in queue

Post by shawniverson » 03 Oct 2018 22:20

Is the database (mariadb) running?
Version 3.0.2.6 released! Update now to keep your eFa secure!

modcar
Posts: 7
Joined: 05 Jul 2018 00:53

Re: Lots and lots of emails in queue

Post by modcar » 04 Oct 2018 09:18

No its not - and starting it returns "......................... ERROR!"

I can't see anything useful in logs either

User avatar
shawniverson
Posts: 2605
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Lots and lots of emails in queue

Post by shawniverson » 04 Oct 2018 09:43

What is your available disk space?

Code: Select all

df -h
Version 3.0.2.6 released! Update now to keep your eFa secure!

modcar
Posts: 7
Joined: 05 Jul 2018 00:53

Re: Lots and lots of emails in queue

Post by modcar » 05 Oct 2018 08:20

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.

User avatar
pdwalker
Posts: 1116
Joined: 18 Mar 2015 09:16

Re: Lots and lots of emails in queue

Post by pdwalker » 09 Oct 2018 07:44

What's the output of

Code: Select all

mailq |wc -l

modcar
Posts: 7
Joined: 05 Jul 2018 00:53

Re: Lots and lots of emails in queue

Post by modcar » 09 Oct 2018 20:34

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

User avatar
pdwalker
Posts: 1116
Joined: 18 Mar 2015 09:16

Re: Lots and lots of emails in queue

Post by pdwalker » 10 Oct 2018 04:23

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?

modcar
Posts: 7
Joined: 05 Jul 2018 00:53

Re: Lots and lots of emails in queue

Post by modcar » 10 Oct 2018 04:40

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?

Post Reply