My scripting talent is sadly failing...

Michael Baird mike at tc3net.com
Tue Jan 23 14:52:38 CET 2007


On Tue, 2007-01-23 at 12:59 +0000, Nigel Kendrick wrote:
> Hi Folks,
> 
> I have put together the following one-liner to re-submit all emails sent to
> me from an archive folder - it works EXCEPT that the 'echo/cut' command is
> not removing the file extension from the file name and so the emails are not
> processed in the queue. Would someone kindly have a look and educate me!! 
> 
> grep -l 'To: <nigel.kendrick' * | xargs -t -i bash -c "chmod 700 {} ; cp {}
> /var/spool/postfix/hold/`echo {} | cut -d . -f 1` "

The syntax I use for a restore is the following (within a perl script),
and using sendmail.

system("find $line -name 'q*'| xargs grep -w $username | awk -F :
'{print $1}' | sort -u | sed 's/\\/qf/\\/?f/' > /tmp/queuefiles");

This gives me a list of the queuefile names, which I read within another
loop in the script and submit to the queue.

Regards
Michael Baird




More information about the MailScanner mailing list