Menu

#28 Problems recognizing $base path within logfiles

ASSP V2
closed
None
2014-11-16
2014-11-14
Robert Orso
No

Installation at "C:\ASSP\" on Windows 32-Bit (note the uppercase)

Problem: stored files (ham, spam, okmail) are "sometimes" logged as "C:\ASSP\spam...." and most of the time "c:\assp\spam...". Case is no case within windows, but it is within PERL.

To have the files linked in the maillog browser the file URLs are compared against the installation base directory which is internally determined as "c:\assp" (note the lowercase).

Some of the search and replace patterns that utilize the $base variable are not case insensitive and the search fails on these log lines. Due to this the respective entries in the maillog view are not converted to hyperlinks.

These entries also show up in the BLOCKREPORT as entries without a file link.

I managed do pinpoint three lines in the code that correct this behaviour and result in a correct display within the maillog browser. I did NOT find the reason why the paths are logged differently.

Working on the code for "ASSP version 2.4.3(14313)" from 2014-11-09 the following lines were changed:

45024: if (/(.)?($base\/(($spamlog|$discarded|$notspamlog|$incomingOkMail|$viruslog|$correctedspam|$correctednotspam|$resendmail|$rspamlog|$rnotspamlog|$rcorrectedspam|$rcorrectednotspam)\/[^\s]+(?:\Q$maillogExt\E|$reportExt)))(.)/)
-->
45024: if (/(.)?($base\/(($spamlog|$discarded|$notspamlog|$incomingOkMail|$viruslog|$correctedspam|$correctednotspam|$resendmail|$rspamlog|$rnotspamlog|$rcorrectedspam|$rcorrectednotspam)\/[^\s]+(?:\Q$maillogExt\E|$reportExt)))(.)/i)

45305: if ($iline =~ /$base\/(?:$spamlog|$discarded|$notspamlog|$incomingOkMail|$viruslog|$correctedspam|$correctednotspam|$resendmail|$rspamlog|$rnotspamlog|$rcorrectedspam|$rcorrectednotspam)\/[^\s]+(?:\Q$maillogExt\E|\Q$reportExt\E)/) {
-->
45305: if ($iline =~ /$base\/(?:$spamlog|$discarded|$notspamlog|$incomingOkMail|$viruslog|$correctedspam|$correctednotspam|$resendmail|$rspamlog|$rnotspamlog|$rcorrectedspam|$rcorrectednotspam)\/[^\s]+(?:\Q$maillogExt\E|\Q$reportExt\E)/i) {

45313: if (/^(<[^<>]+>)(.?)($base\/(($spamlog|$discarded|$notspamlog|$incomingOkMail|$viruslog|$correctedspam|$correctednotspam|$resendmail|$rspamlog|$rnotspamlog|$rcorrectedspam|$rcorrectednotspam)\/[^\s]+(?:\Q$maillogExt\E|\Q$reportExt\E)))(.)$/)
-->
45313: if (/^(<[^<>]+>)
(.?)($base\/(($spamlog|$discarded|$notspamlog|$incomingOkMail|$viruslog|$correctedspam|$correctednotspam|$resendmail|$rspamlog|$rnotspamlog|$rcorrectedspam|$rcorrectednotspam)\/[^\s]+(?:\Q$maillogExt\E|\Q$reportExt\E)))(.)$/i)

However I was not able to locate the problem with the BLOCKREPORT. However it must be the same reason. The $filename variable is empty when the check for the left and right button is due.

I finally renamed my directory to lowercase "c:\assp" which seems to prevent the problem. I'm not sure about the possibility that ASSP starts again to log the drive letter as "C:" instead of "c:", so probably it's necessary to pin THAT down.

Discussion

  • Robert Orso

    Robert Orso - 2014-11-14

    ups.. it is C:/ASSP/spam/... certainly. Sample attached.

     
  • Thomas Eckardt

    Thomas Eckardt - 2014-11-15
    • status: open --> accepted
    • assigned_to: Thomas Eckardt
     
  • Thomas Eckardt

    Thomas Eckardt - 2014-11-15

    making the $base caseinsenitive in the regex is not a solution - assp has to work also on linux, where 'assp' and 'ASSP' are not the same.

    it may take a while to fix this issue (IMHO a minor one)
    simply install assp in a lower case folder (assp).

    Thomas

     
  • Thomas Eckardt

    Thomas Eckardt - 2014-11-16
    • status: accepted --> closed
     
  • Thomas Eckardt

    Thomas Eckardt - 2014-11-16

    Problem: stored files (ham, spam, okmail) are "sometimes" logged as "C:\ASSP\spam...." and most of the time "c:\assp\spam...". Case is no case within windows, but it is within PERL.

    • $base is set at startup an never changed after that
    • the name of the logged file is generated in a single code line in sub maillogFilename

    my $ret = "$base/$maillog/$sub$maillogExt";

    • it is simply impossible that this happens

    NOTICE:

    if you pass the base folder in the OS progam call - pass it case sensitive !

    eg:

    perl assp.pl C:\ASSP

    something like (in your case):

    perl assp.pl c:\assp

    will start the script, will store all files on windows - but the internal processing will fail!

    Thomas

     

Log in to post a comment.