[URGENT] Requeue (process again) all the email blocked in the last 12 hours

General E.F.A. discussion
Post Reply
fbessone
Posts: 10
Joined: 18 Feb 2015 18:02

[URGENT] Requeue (process again) all the email blocked in the last 12 hours

Post by fbessone » 14 Sep 2018 09:23

Hello guys,

tonight my EFA blocked all emails with this error:
MailScanner: Message attempted to kill MailScanner

I solved the error, clamAV related: but now i want to process again all the blocked emails to deliver the legimit ones.
How can i do it? There are thousands of email, cant do it manually via web interface ..

Thank you in advance

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

Re: [URGENT] Requeue (process again) all the email blocked in the last 12 hours

Post by shawniverson » 14 Sep 2018 10:39

Hi,

You will need to use a script to accomplish this. The process..

1) Gather all messages and place in a directory
2) Use a script to iterate through the files, extract the original recipient address, and call /usr/sbin/sendmail to requeue the message.

Code: Select all

#!/bin/bash
pathname='/path/to/files/'
for filename in $pathname; do
   if [[ -f "$filename" ]]; then
       # extract orig recip
       recip=$(grep "^[[:space:]]*for" $pathname$filename | head -n1 | awk '{print $2}' | sed 's/^<//' | sed 's/>$//' | sed 's/>;$//')
       if [[ -n "$recip" ]]; then
         sendmail -G -i $recip < $pathname$filename
       fi
   fi
done
Version 3.0.2.6 released! Update now to keep your eFa secure!

Post Reply