Hi,

thanks a lot for all the responses, you guys are very kind! Gary V, I copied 
your script to my server as follows:

---------------------
#!/bin/bash
# feeds local quarantined mail to amavisd-release for a given domain.
# please insure the same mail does not get quarantined again.
# assumes spam-u02EEf0XKsV5.gz style file names.

quarantine_dir=/var/amavis/quarantine/ # need the trailing slash
domain=mydomain.com
sent_log=/root/sent.log

dir_length=${#quarantine_dir}
#echo $dir_length

for f in `find $quarantine_dir -type f`; do
filename=$f
#echo $filename_length

if echo $filename | grep 'spam' # or banned
then
 string=`zgrep -m 1 'X-Envelope-To: ' $f`
 if echo $string | grep $domain
 then
  sleep 1 # slow it down if desired
  filename_length=${#filename}
  short_file_name=`echo $filename | cut -c $dir_length-$filename_length`
  #trim the leading slash:
  short_file_name=${short_file_name:1:20} # change 20 to 22 for banned
  echo $short_file_name
  echo $short_file_name | amavisd-release -
  echo $short_file_name >> $sent_log
 fi
fi
done
exit
---------------------

Now when I execute it, nothing happens (except that he lists the files and 
their X-Envelope-To setting):

# ./amavis.sh
/var/amavis/quarantine/spam-742mpcNejMVz.gz
X-Envelope-To: <[EMAIL PROTECTED]>
spam-742mpcNejMVz.gz

For some reason it appears that amavisd-release is not executed (although it 
is in the $path) or that the mail at least is not re-queued. Any ideas?

Cheers,
Werner.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to