How to get e-mail messages from Mail Scanner?
Steve Freegard
steve.freegard at fsl.com
Mon Jul 16 23:04:54 IST 2007
Hi Glenn/Jason,
Glenn Steen wrote:
> On 16/07/07, Jason Gottschalk <Jason at syo.com> wrote:
> "Archive of quarantine"? Sounds a bit like you are using MailWatch and
> have store set on the non-spam action... In whiich case this beconmes
> a problem of:
> a) Finding the relevant messages, and
> b) sending them to the recipient.
>
> If you indeed use MailWatch, then a) is fixed by a simple SQL query...
> All you really need is to construct a file containing all the message
> IDs and possibly all the dates... Heck, why not let the SQL scriptlet
> construct a file of filenames (one/line) with the absolute path to the
> message file (which is in RFC822 format), then simply loop over that
> and use yourMTAs sendmail command (for i in $(cat filenames); do
> sendmail recipient at add.ress<$i; done) ... Simple as that:-).
> I'm on vacation, so will not be writing that scriptlet for you anytime
> this week... perhaps when I'm back to the grindstone...:-)
I wrote something similar for a customer with a similar problem which is
attached.
You will need to edit it and change 'mysql -N mailscanner' to 'mysql
-u<username> -p -N mailscanner' where <username> is your MailWatch MySQL
user. It will prompt you for the password when you run it.
It is run like:
resend.sh 2007-06-01 2007-06-16 fsl.com
The first argument is the date from, second is the date to and third is
used to match all or part of a destination address (e.g. domain or full
e-mail address), it will then find all messages for matching those
criteria and resend them from the quarantine.
Hope it helps.
Kind regards,
Steve.
--
Steve Freegard
Development Director
Fort Systems Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resend.sh
Type: application/x-shellscript
Size: 602 bytes
Desc: not available
Url : http://lists.mailscanner.info/pipermail/mailscanner/attachments/20070716/32d888c2/resend.bin
More information about the MailScanner
mailing list