Re-send emails in quarantine

Questions and answers about how to do stuff
Post Reply
kingramon0
Posts: 27
Joined: 28 Jun 2014 19:17

Re-send emails in quarantine

Post by kingramon0 »

I might be facing the need to restore our Exchange database from a backup. If that becomes necessary, is it possible to have all the stored messages in EFA after a certain date be redelivered so we don't lose a days worth of emails?
User avatar
shawniverson
Posts: 3649
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Re-send emails in quarantine

Post by shawniverson »

Yes, with a little effort.
kingramon0
Posts: 27
Joined: 28 Jun 2014 19:17

Re: Re-send emails in quarantine

Post by kingramon0 »

So, how would I do it?
User avatar
shawniverson
Posts: 3649
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Re-send emails in quarantine

Post by shawniverson »

Glad you asked ;)

1) Head over to /var/spool/MailScanner/quarantine

2) Look for the dir(s) you want, labeled by date

3) Find the nonspam dir

4) Copy the emails from the nonspam dir to /var/spool/postfix/incoming

5) Go grab a beer for a job well done.
kingramon0
Posts: 27
Joined: 28 Jun 2014 19:17

Re: Re-send emails in quarantine

Post by kingramon0 »

Wow, thanks!

I'm definitely going to need a lot of step 5's, but this will make it so much easier!

Thanks again!
kingramon0
Posts: 27
Joined: 28 Jun 2014 19:17

Re: Re-send emails in quarantine

Post by kingramon0 »

The files are just sitting there. Other mail is coming in but it doesn't grab the files I copied. I tried postqueue -f, but nothing. Any ideas?
kingramon0
Posts: 27
Joined: 28 Jun 2014 19:17

Re: Re-send emails in quarantine

Post by kingramon0 »

I figured out that I need to chmod u+x and remove everything trailling the period in the file name. However, the messages get put in the corrupted queue.

My Mailscanner.conf has:
# Do you want to quarantine the original *entire* message as well as
# just the infected attachments?
# This can also be the filename of a ruleset.
Quarantine Whole Message = yes

# When you quarantine an entire message, do you want to store it as
# raw mail queue files (so you can easily send them onto users) or
# as human-readable files (header then body in 1 file)?
Quarantine Whole Messages As Queue Files = no

I'm guessing that is why. Changing it now won't help me. Is there something else I can do to the files to make it accept them?
User avatar
shawniverson
Posts: 3649
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Re-send emails in quarantine

Post by shawniverson »

Well, crud, they aren't queue files. Let me do a little tinkering.

I think we can still do this, but it may require passing the emails through a little script.
kingramon0
Posts: 27
Joined: 28 Jun 2014 19:17

Re: Re-send emails in quarantine

Post by kingramon0 »

I found some ways around this that should be good enough, so don't worry about it. Fortunately, it's only a dozen or so users that I need to retrieve stuff for, and I only have two left.

Your SummitStor project is intriguing though. I might need to stalk you on that.
Post Reply