Subject: [os2genau_digest] No. 1402
From: Digest <deadmail>
To: "OS/2GenAu Digest"<deadmail>
Date: Fri, 22 Dec 2006 00:00:41 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600

**************************************************
Thursday 21 December 2006
 Number  1402
**************************************************

Subjects for today
 
1  Re:  rexx/enviroment problem ? : David Forrester" <davidfor at internode.on dot net>
2  Re:  rexx/enviroment problem ? : Ian Manners" <deadmail>
3  Re:  rexx/enviroment problem ? : Ed Durrant <edurrant at bigpond dot net dot au>
4  Re:  rexx/enviroment problem ? : Ian Manners" <deadmail>

**= Email   1 ==========================**

Date:  Wed, 20 Dec 2006 23:57:08 +1100
From:  "David Forrester" <davidfor at internode.on dot net>
Subject:  Re:  rexx/enviroment problem ?

On Wed, 20 Dec 2006 22:40:20 +1100 (EDT), Ian Manners wrote:

>That actually works fine, tried that previously and did a dir/s copy.*
>on 3 main drives with no results BUT you got me thinking, I think
>it may have happened about the time I took weasel out of the startup.cmd
>and left it in the startup folder, quick test by using your file, both as a cmd
>and after using rexx2exe, and double clicked on it from the desktop, and
> ..... bugger, it worked, ruled that one out but just incase I started weasel
>from the command prompt with 
>
> at start /min weasel.exe  still no luck with that.
>
>Weasel hasnt changed for a couple of years now but clamav has, so
>I'm left with the possibility that ClamAV demon is flushing the enviroment
>once its finished, or some wierd thing.
>
>I might have to setup a test weasel and clamav on another PC, as I dont
>want to start messing with live email on the server, and try putting some
>env test redirects to a log file in it.

The first thing I would do would be to remove the " at " and see exactly
what command is being executed.  The  at  prevents the command from being
echoed to the screen when it is being run.

Is this script being run from inside Weasel?  If try changing the copy
statement to:

     Address CMD ' at copy 'messagefile' \tmp'

This tells the REXX interpreter that the the command is to the passed
to the CMD interpreter instead of being handled by another environment.

Another change would be to use a REXX Utility Function.  In this case
the line would be:

   Call SysCopyObject messagefile '\tmp'

More details of these function are in the REXX help.  If you don't use
this, you can remove the two lines loading the REXX utility functions
as they are not being used.

--
David Forrester
davidfor at internode.on dot net
http://www.os2world dot com/djfos2/

----------------------------------------------------------------------------------

**= Email   2 ==========================**

Date:  Thu, 21 Dec 2006 01:20:39 +1100 (EDT)
From:  "Ian Manners" <deadmail>
Subject:  Re:  rexx/enviroment problem ?

Hi David

>> at start /min weasel.exe  still no luck with that.
(cut n paste direct from startup.cmd)

>The first thing I would do would be to remove the " at " and see exactly
>what command is being executed.  The  at  prevents the command from being
>echoed to the screen when it is being run.

Already done that in checking what and were the error was coming from
in the clamfilt.cmd, as I now know its the copy command that is returning
the 'unknown command' error, I put the  at  back to keep the log file size
down 6-8M a day or bigger is common without adding more to it.

>Is this script being run from inside Weasel?  If try changing the copy

yes, called by weasel after the entire mail is received, as a filter.

>statement to:
>     Address CMD ' at copy 'messagefile' \tmp'

Will give it a go, thanks.

I've established that is were the problem is, just wish I know why
it stopped working, ie, was it something I've done, or related to
the various clamav updates. 

>Another change would be to use a REXX Utility Function.  In this case
>the line would be:
>
>   Call SysCopyObject messagefile '\tmp'

This one sounds move in keeping, also not using cmd.exe maybe safer.

>More details of these function are in the REXX help.  If you don't use
>this, you can remove the two lines loading the REXX utility functions
>as they are not being used.

I think the original author simply used a standard header, and I also
removed some redundant stuff.

CALL RxFuncAdd SysLoadFuncs, rexxutil, sysloadfuncs
CALL SysLoadFuncs

One day (think I've been saying that for 6-8 years now) I
must site down and start to learn more rexx functions etc,
as I keep meaning to do something else with clamfilt.cmd

Cheers
Ian Manners
Tech Fossil (Often  called a Dinosaur) - ancient animal that gets things done
http://www.os2site dot com/

Don't eat yellow snow!
----------------------------------------------------------------------------------

**= Email   3 ==========================**

Date:  Thu, 21 Dec 2006 07:18:05 +1100
From:  Ed Durrant <edurrant at bigpond dot net dot au>
Subject:  Re:  rexx/enviroment problem ?

Ian Manners wrote:
> Hi Ed
> 
>> Ok, having removed the quirky error possibility.
>> Create a brand new cmd file as below:
>>
>> /* test rexx */
>> see what is displayed - perhaps there's something strange with copy - 
>> have you got a copy.cmd or copy.exe or copy dot com on the system that 
>> you're picking up rather than the inbuilt copy command ?
> 
> That actually works fine, tried that previously and did a dir/s copy.*
> on 3 main drives with no results BUT you got me thinking, I think
> it may have happened about the time I took weasel out of the startup.cmd
> and left it in the startup folder, quick test by using your file, both as a cmd
> and after using rexx2exe, and double clicked on it from the desktop, and
>  ..... bugger, it worked, ruled that one out but just incase I started weasel
> from the command prompt with 
> 
>  at start /min weasel.exe  still no luck with that.
> 
> Weasel hasnt changed for a couple of years now but clamav has, so
> I'm left with the possibility that ClamAV demon is flushing the enviroment
> once its finished, or some wierd thing.
> 
> I might have to setup a test weasel and clamav on another PC, as I dont
> want to start messing with live email on the server, and try putting some
> env test redirects to a log file in it.
> 
> Cheers
> Ian Manners
> Tech Fossil (Often  called a Dinosaur) - ancient animal that gets things done
> http://www.os2site dot com/
> 
> 
> "I'm not the one that misplaced the Deltivid asteroid belt!" - Q

>  

> 
Ok, next thing is to take a copy of your rexx file and add "say" 
commands in it to display what the variables actually are that may well 
point to where the problem is coming from - if clamav is no longer 
outputting the file you expect, then copy has nothing to copy.

Cheers/2

Ed.
----------------------------------------------------------------------------------

**= Email   4 ==========================**

Date:  Thu, 21 Dec 2006 23:33:17 +1100 (EDT)
From:  "Ian Manners" <deadmail>
Subject:  Re:  rexx/enviroment problem ?

Hi David /Ed

    Address CMD 'copy 'messagefile' \tmp'
or
   Call SysCopyObject messagefile '\tmp'

Not working :-(

I've established that 'messagefile' is still there but there is wierdness
going on. It's like clamav has eaten the enviromental settings etc.

I'll mess around with otherways of calling clamd, one I've already done
was to give clamd the switch settings to move any infected files to /tmp
but.....

----------- SCAN SUMMARY -----------
Infected files: 0
Time: 0.052 sec (0 m 0 s)
D:\MailRoot\os2 dot org dot au\os2genau\0001MIDJ.###: HTML.Phishing.Bank-817 FOUND
ERROR: cannot move 'D:\MailRoot\os2 dot org dot au\os2genau\0001MIDJ.###' to '\tmp/D:\Ma
ilRoot\os2 dot org dot au\os2genau\0001MIDJ.###': No such file or directory

----------- SCAN SUMMARY -----------

So I now need to slice up messagefile to leave only the filename but when
you actually take in the above error, clamav is trying to move the file
to the full path, which means I need to change to that directory as well, and
so a larger cmd file appears to be on its way....

I can remember trying the clamd move option ages ago but it didnt work
then, looks like Yuri's fixed that somewere along the line.

Ed, tried the say's but they only tell me the same thing, anything after
running clamav in the cmd file does seem to work as expected, and
its the 'copy' that generates the error about unknown command, it
hasnt even got to the file :-(

echoing 'set' to as debug log tells me the actual paths etc are all intact.
It makes life so much quicker having a few virus around to test it
with.

Will have to get back to this over the weekend, life calls :-)

Cheers
Ian Manners
Tech Fossil (Often  called a Dinosaur) - ancient animal that gets things done
http://www.os2site dot com/

File names are infinite in length where infinity is set to 255 characters.   	-- Peter Collinson, "The Unix File System"
----------------------------------------------------------------------------------