Permission on the quarantine directories

Ken Anderson ka at PACIFIC.NET
Wed Jul 23 21:31:05 IST 2003


Chris-Bellsouth wrote:
>>A good job for sudo.
>>Just put a line in /etc/sudoers file:
>>user ALL = NOPASSWD: /usr/local/bin/letgo.pl
>>Then a user named 'user' can run the command letgo.pl as root.
>>letgo.pl just puts the qf* and df* files back into the outgoing queue.
>>This also allows you to webify the thing and have apache (using suexec
>>to be safer) handle the operation from this machine (or another machine
>>over ssh).
>
>
> This is good stuff...now where can one find this storied "letgo.pl"  Or
> would one have to write it themselves?
>
> CT
>
>


Nothing fancy...

------------- snip ----------

#!/usr/bin/perl
#
# the fullpath can be obtained
# from the email sent to the customer
# based on reports/en/stored.filename.message.txt
# using $quarantinedir/$datenumber/$id
#

die "Usage: $0 [full path to msgid directory]\n" if ($#ARGV < 0);
$fullpath = $ARGV[0];
if($fullpath !~
/^\/var\/spool\/MailScanner\/quarantine\/\d\d\d\d\d\d\d\d\/[a-zA-Z0-9]+$/){
        print "Bad Input";
}
else{   # path looks okay
  $res = system("cp $fullpath/qf* $fullpath/df* /var/spool/mqueue/");
  if($res != 0) { print "No such message found"; }
  else { print "$fullpath has been released from quarantine"; }
}

------- snip ---------

(note email client wraps long lines)
Ken



More information about the MailScanner mailing list