<div dir="ltr">Yeah they already have a script made in tools or something like that. You just need to configure it and then set it up to auto run.<div><br></div><div>Jason</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 4, 2017 at 11:44 AM, Miguel van Loon <span dir="ltr"><<a href="mailto:m.van.loon@ictvanloon.nl" target="_blank">m.van.loon@ictvanloon.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="NL" link="blue" vlink="purple">
<div class="m_4747274373965131078WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I guess I can use a script like this..?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">#!/usr/bin/perl<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">#<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"># IMPORTANT NOTE:<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">#<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"># Change the next line to 0 instead of 1 to enable this script.<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"># By default it will be disabled and will not do anything.<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">#<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">$disabled = 1;<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">$quarantine_dir = '/var/spool/MailScanner/<wbr>quarantine';<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span style="font-size:10.0pt;font-family:Consolas;color:#555555">$days_to_keep = 30;<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span style="font-size:10.0pt;font-family:Consolas;color:#555555"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">exit if $disabled;<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"># Standardise the format of the directory name<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">die 'Path for quarantine_dir must be absolute' unless $quarantine_dir =~ /^\//;<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">$quarantine_dir =~ s/\/$//; # Delete trailing slash<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"># Now get the content list for the directory.<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">opendir(QDIR, $quarantine_dir) or die "Couldn't read directory $quarantine_dir";<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"># Loop through this list looking for any *directory* which hasn't been<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"># modified in the last $days_to_keep days.<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"># Unfortunately this will do nothing if the filesystem is backed up using tar.<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555">while($entry = readdir(QDIR)) {
<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"> next if $entry =~ /^\./;<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"> $entry = $quarantine_dir . '/' . $entry;<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"> system("rm -rf $entry") if -d $entry &&<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#555555"> -M $entry > $days_to_keep;<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span style="font-size:10.0pt;font-family:Consolas;color:#555555">}<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:19.5pt;background:#edf5f8"><span style="font-size:10.0pt;font-family:Consolas;color:#555555">closedir(QDIR);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I also remembered I can put it in crontab –e<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thanks for so far!
<u></u><u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Van:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> MailScanner [mailto:<a href="mailto:mailscanner-bounces%2Bm.van.loon" target="_blank">mailscanner-bounces+m.<wbr>van.loon</a>=<a href="mailto:ictvanloon.nl@lists.mailscanner.info" target="_blank">ictvanloon.nl@lists.<wbr>mailscanner.info</a>]
<b>Namens </b>Jason Wat</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">ers<br>
<b>Verzonden:</b> woensdag 4 januari 2017 16:57<br>
<b>Aan:</b> MailScanner Discussion <<a href="mailto:mailscanner@lists.mailscanner.info" target="_blank">mailscanner@lists.<wbr>mailscanner.info</a>><br>
<b>Onderwerp:</b> Re: mailscanner quarantine items<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">type crontab -e then hit enter. Then setup your job there. I think that should work for you.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Jan 4, 2017 at 7:37 AM, Miguel van Loon <<a href="mailto:m.van.loon@ictvanloon.nl" target="_blank">m.van.loon@ictvanloon.nl</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I’m running mailscanner on freebsd and I am trying to create a cron job to delete emails out of the /var/spool/mailscanner/<wbr>quarantine log.<u></u><u></u></p>
<p class="MsoNormal">However you can’t do it this way because there is no cron.daily..<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Does someone know how to add or config this?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks for help!<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<img border="0" width="1" height="1" id="m_4747274373965131078_x0000_i1025" src="http://g3hx.mjt.lu/oo/ADsAAF7LnpgAAAAAAAAAAGoWcEUAARpY35AAAAAAAAci1wBYbOx9TGpzQGobRpW6AwexHwHIAwAGzxo/a73229c0/e.gif"><u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<br>
--<br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info" target="_blank">mailscanner@lists.mailscanner.<wbr>info</a><br>
<a href="http://g3hx.mjt.lu/lnk/AEQAHJsjlnQAAAAAAAAAAGoWcEUAARpY35AAAAAAAAci1wBYbSZ7wbsuKwgmT0mrkbj9K3JGaAAGzxo/1/sLNMTszXzErzUzbUUnHUtA/aHR0cDovL2xpc3RzLm1haWxzY2FubmVyLmluZm8vbWFpbG1hbi9saXN0aW5mby9tYWlsc2Nhbm5lcg" target="_blank">http://lists.mailscanner.info/<wbr>mailman/listinfo/mailscanner</a><br>
<br>
<u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
<br><img src="http://g3hx.mjt.lu/oo/AEQAHJsjlnQAAAAAAAAAAGoWcEUAARpY35AAAAAAAAci1wBYbSZ7wbsuKwgmT0mrkbj9K3JGaAAGzxo/3c1a14fe/e.gif" height="1" width="1" alt="" border="0" style="height:1px;width:1px;border:0">
</div>
<br><br>
<br>
--<br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.<wbr>info</a><br>
<a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" rel="noreferrer" target="_blank">http://lists.mailscanner.info/<wbr>mailman/listinfo/mailscanner</a><br>
<br>
<br></blockquote></div><br></div>