OS2World OLD-STATIC-BACKUP Forum

WebSite Information => Article Discussions => Topic started by: CDRWSel on 2011.02.09, 09:56:57

Title: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.09, 09:56:57
http://www.os2world.com/content/view/20544/2/ (http://www.os2world.com/content/view/20544/2/)
QuotePosted by Martin Iturbide - Tuesday, 08 February 2011


[a href. .. .

Currently, I'm working on next build and need feedbacks
    * Corrected a wrong "clamdscan" enable option
    * Changed internal scan procedure and timings
    * Added a stop button when allowed (not available when use of ClamDscan without verbose mode)
    * Changed / added a messages from online logs
    * Corrected invalid clamd.conf file used when working with clamdscan (no version displaied)
    * Changed some part of code when using "verbose" with clamdscan
    * With "verbose" on for clamdscan, only message field is updated while adding [ x ]++ will update the scanned list too.

For those interested in testing and report findings of this first test build could get it using following link (remove blanks in the linkname)
  http:// remydodin.levillage.org /outils/ClamAVGUI-2_1_0.wpi

** For test only **

Kind regards,
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.11, 01:28:40
2.0.0 (d) (2011/02/10)

     *Warning* latest v2.0.0 was wrongly package - New package created and corrected a WPI issue and added 2.0.0 (d) build (ClamAV 0.96.4.4 WPI corrected too) - both available from my web page


2.1.0 (2011/02/11) corrected a WPI script issue and always under test...
Use previous given link to get updated 2.1.0 (TEST package)

ClamAV 0.96.4.4 in WPI format (out of RPM/YUM) 
http:// remydodin.levillage.org /outils/ Clamav-0_96_4-4.wpi
(remove blanks in the link name)

Cheers
Remy      
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.12, 00:43:45
Some news *
- V2.1.0 TEST build refreshed with a new update
  (faster and added stop button except for clamdscan in no verbose mode)     

Kind regards,
Remy   
Title: Re: ClamAV GUI version 2.0.0
Post by: David McKenna on 2011.02.12, 01:41:30
Hi Remy,

  Thanks for continuing to develop ClamAVGUI. I tried the new version 2.1.0 and I like the ability to stop a manually started scan - that works well. Everything else I use seems to work good so far.

  One thing I just noticed (hadn't tried it before) - if I try to start ClamDaemon, it fails. Clamd.exe is in the directory /usr/sbin, but ClamAVGUI seems to look for it in /usr/bin and does not find it. This probably only applies to the RPM installed ClamAV.

Regards,

Dave McKenna
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.12, 11:33:32
Hi Dave,
thanks for your report.

Hmm ! Yes, this is a wrong setting and I have to correct it while I didn't care that RPM/YUM installs the Clamd (daemon) into a sbin (server bin directory)

I add an update here as soon I've changed it
Cheers
Remy   
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.13, 00:24:00
Hi Dave,

I was longer as expected due I found a bug when using Clamdscan which could result into a clamavgui hung.

Now, I change all parts of the buggy code (several numbers of lines...), removed the extra option to log all scanned files into the container (no need) and the process of clamdscan with "verbose on" is now more similar to clamscan.
With the new code, restriction about "verbose" mode with big amount of files is removed and I added following changes

    * Corrected path to ClamD when ClamAV was RPM/YUM installed.
    * Exclude list can be used with ClamDscan and verbose enabled

I refreshed the v2.1.0 test build on the same link as before.
This test build identifies as V2.1.0e under about

Kind regards,
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: David McKenna on 2011.02.13, 15:52:54
Remy,

  Thanks again! Everything is working well now...


Regards,

Dave McKenna
Title: Re: ClamAV GUI version 2.0.0
Post by: jep on 2011.02.13, 22:08:44
Feedback:
Clamav-0_96_4-4.wpi
Doesn't set the path to the wps object,
Reboot required after install = OK!
Doesn't run out of the box as *nix conf-files has to be copied and edited.

ClamAVGUI-2_1_0.wpi
Contain/write .conf-files on it own! Great work Remy as that make the scanner useful out of the box, right away!

The menu option to send email to the author doesn't work with PMMail as it require parameters to run, such as -cwd X:\Path\to\email\account
"Internet Application Integration" doesn't help with that either, guess we need a SOM class that resemble the url object.

The applications doees a great job, appear to be very well written and responsive all of the time even though one can't use anything wile a scan is in progress.

The features to add ClamAV to config.sys and to list running processes are very neat!
The extra bonus to add problematic programs can come in handy at times as well.




Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.14, 00:13:08
"The menu option to send email to the author doesn't work with PMMail as it require parameters to run, such as -cwd X:\Path\to\email\account
"Internet Application Integration" doesn't help with that either, guess we need a SOM class that resemble the url object."

I check ini file for DEFAULTMAILEXE
Than, I run the mail program with following parms  -compose to=my@webaddress,subject=ClamAV GUI *info*'

Does PMMail update DEFAULTMAILEXE ini entry ?
Does it understand -compose to=............,subject=.........  ?

Thanks
Kind regards,
Remy     
Title: Re: ClamAV GUI version 2.0.0
Post by: jep on 2011.02.14, 08:00:02
PMMail doesn't update that by itself, but "Internet Application Integration" (IAI) can do it for you, as for me.
One can also use IAI to set the parameters that has to be fed to the application, as mentioned earlier.

No, it understand the following parameters:
__________________
Appendix C - PMMail Command Line

An option may be indicated with either a hyphen ("-") or a slash ("/"). The whole option word is required. It is case insensitive.   

-cwd <dirpath>
Set the working directory to dirpath.

Any files with the .EXT extension in the new directory are deleted when the directory is changed. This is in addition to their removal when argument processing starts.   

-a <acctname>
-s <acctname>
Start the program with <acctname> opened and selected. <acctname> may be either the displayed account name, or the disk name used by the program. If the displayed account name contains spaces, place it in double quotes.

-a and -s are equivalent.   

-log <level>
Set the logging level. Level is a number from 0 through 4; other values are ignored. 0 disables logging altogether; increasing values increase the log output. The default value is 1 which outputs mostly error messages. The maximum level, 4, provides a lot of execution detail. The log file <logfile.log> is located in the directory where the program is started.

See Advanced Settings for more details.   

-disable-fetch
Disables Fetch Mail at Startup for all accounts. The Account Preference for Startup, Send Queued messages, is also disabled. The option is mainly a debugging aid should PMMail have a serious problem during startup and the cause is related to fetching or sending mail.   

-f
-fetch-all
-send-queued
-fetch-all enables "Unattended Fetch." PMMail initializes, no windows are opened, fetches mail for all accounts which have Fetch Mail at Startup enabled, and exits after all of those accounts have checked for messages. May used with -send-queued.   

-send-queued enables "Unattended Send." PMMail initializes, no windows are opened, sends mail queued in the Outbox for all accounts which have Send queued messages at Startup enabled, and exits after all of those accounts have sent the messages. May used with -fetch-all.   

Normally the -fetch-all and -send-queued options are used with a scheduler that invokes PMMail periodically to collect or send mail. If both options are indicated, PMMail waits until both services have completed before exiting.   

-send-shutdown
When PMMail starts with this option, it searches for another instance of PMMail running in the same accounts directory. If found, that instance is sent a shutdown signal to end the program session. Whether or not another instance is found, the current PMMail also shuts down.   

-min
Start the program minimized to the desktop.   

-nice-send
Reduce the CPU priority when sending messages by SMTP.   

-msg <message text>
Sends a message with the text "message text". It copies the text to CMDLINE.EXT for later processing
Title: Re: ClamAV GUI version 2.0.0
Post by: jep on 2011.02.14, 08:18:29
I have another problem now as well, that it doesn't scan all what I've asked for.
Set it to scan C:\ D:\ G:\ H:\ K:\ L:\
The first round it failed after it found 3 suspicious scripts on my C:\ drive, now it failed a bit futher down the path, though not that far as you can see. The bold text seem to be the common area. Is it rxu or rexx that may have problems?

LibClamAV Warning: cli_rmdirs: Can't locate C:/var/temp/clamav-f...../javascript: Not enough memory
Time: 06:52:13 - Clamscan.exe ProcessID not found, current ClamAVGUI process aborted !

----------
Compunter: AMD 2.3 GHz, QuadCore (Though run in single core mode until ACPI can support it)
Memory: 3072 Mb
-------------
LibClamAV Warning: cli_rmdirs: Can't locate C:/var/temp/clamav-f.....nocomment.html Not enough memory
C:/HOME/DEFAULT/Mozilla/FIrefox1/Profiles/xyz...default/extensions/firebug@software.joehewitt.com/Releasenotes_1.2.1.txt: Can't allocate memory ERROR
C:/HOME/DEFAULT/Mozilla/FIrefox1/Profiles/xyz...default/extensions/firebug@software.joehewitt.com/install.rdf: Can't allocate memory ERROR
Time: 07:10:03 - Clamscan.exe ProcessID not found, current ClamAVGUI process aborted !


Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.14, 10:14:54
Hi jep,

You can get again V2.1.0 (now (f).
I added PMMail support
PMMail is choiced if no "WPURLDEFAULTSETTINGS" - "DEFAULTMAIL" ini entry exist.
If you don't use this default entry, REMOVE IT

"LibClamAV Warning: cli_rmdirs: Can't locate C:/var/temp/clamav-f...../javascript: Not enough memory
Time: 06:52:13 - Clamscan.exe ProcessID not found, current ClamAVGUI process aborted !"

As soon clamscan isn't responding, I check if it's always running or if it crashes !
In your case and as you can see, Clamscan complains about "Not enough memory" and then it seems to be crashed because it's process id was no more available.

I would suggest you to do a try and reduces scan archives "recurs" from 16 to a lower value e.g. 5
And use "exclude list" for files which never will be infected. I would suggest you to disable warnings to have less messages into the online logs (it doesn't impact the file logs).

The first line in the online logs are the parms used with clamscan (your case).

When scanning a full partition, may be you can run more ClamAV-GUI
Try running in parallel  one scan on C:, an other on D: ..  

Kind regards,
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.14, 16:13:26
I'm thinking adding an other option when using PMMail.

If the default set browser isn't PMMail/2 while it is installed, I may add a question like:
"Would you like set PMMail/2 as default browser ?" with a checkobx option to always ask the question or to disable it...

working on...

Cheers   
Title: Re: ClamAV GUI version 2.0.0
Post by: jep on 2011.02.14, 19:26:13
Please do check and use "DefaultMailParameters" below.
/* ------------------------------------------------------------------ */
/*  Application: WPURLDEFAULTSETTINGS */

 i=i+1
 IniFileApps.i.__Application = "WPURLDEFAULTSETTINGS"
 IniFileApps.i.__Keys.0 = 0

 j = IniFileApps.i.__Keys.0

 j = j+1
 IniFileApps.i.__Keys.j.__Key = "DefaultMailExe"
 IniFileApps.i.__Keys.j.__Val = "C:\PROGRAMS\PMMail\BIN\pmmail.exe" || "00"x

 j = j+1
 IniFileApps.i.__Keys.j.__Key = "DefaultBrowserExe"
 IniFileApps.i.__Keys.j.__Val = "C:\PROGRAMS\ARORA\arora.exe" || "00"x

 j = j+1
 IniFileApps.i.__Keys.j.__Key = "DefaultWorkingDir"
 IniFileApps.i.__Keys.j.__Val = "C:\PROGRAMS\ARORA" || "00"x

 j = j+1
 IniFileApps.i.__Keys.j.__Key = "DefaultMailWorkingDir"
 IniFileApps.i.__Keys.j.__Val = "C:\PROGRAMS\PMMail\BIN" || "00"x

 j = j+1
 IniFileApps.i.__Keys.j.__Key = "DefaultMailParameters"
 IniFileApps.i.__Keys.j.__Val = "-cwd X:\path\2\eMail" || "00"x

 IniFileApps.i.__Keys.0 = j
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.15, 01:12:31
Thanks Jep,

I'm surprised about the accounts path !
I installed the WPI and it adds the acounts under C:\programs\PMMail\ACCOUNTS

I refreshed the V2.1.0 build (you can get it)
(the option to set PMMail as default is in EN language only and will popup if PMMail isn't the default client)

Cheers
Remy 
Title: Re: ClamAV GUI version 2.0.0
Post by: jep on 2011.02.15, 07:47:14
Quote from: CDRWSel on 2011.02.15, 01:12:31
I'm surprised about the accounts path !
I installed the WPI and it adds the acounts under C:\programs\PMMail\ACCOUNTS

Don't be surprised, because I don't use the default accounts path, I've placed mine on a server several years ago so that I can access my email from any of my computers.

I'll fetch and try the new version as time permit.

The problem with clamscan failing with memory problem still remain now that I've set it to recurse only 5 levels.
I tried even lower both levels and it succeded to scan C: with both options set to 1.  :-\
I also set some files in the exclude list and turend that option on, but no difference is notable.
Anyway the memory problem doesn't seem to appear at the exactly same spot every time... if that is a clue.

Thank you for uor help
//Jan-Erik

Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.15, 10:30:55
Hi Jep,

I found an error in my code !
I corrected it now and this affected clamscan process but not the "clamscan memory issue"
(please get the refeshed package and you should have v2.1.0k under about)

Of course, you can do a try using Clamdscan to check result (with and without "verbose")
note: You should have at least "clamscan_201" and "clamdscan_201" in the exclude list

Cheers
Remy

note: I could get the same memory issue now. I'll check if older clamscan version have the same problem or not !
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.15, 13:49:07
Changing clamscan version doesn't resolve this...
I could read on ClamAV reported bugs that they are working on a new process to unload memory !
I think that the best would be to contact Yuri which ported clamav to os/2 (eCS)
I did a test adding a debug option into clamscan but it writes not been supported...  

About clamd
Killed by SIGSEGV
pid=0x0246 ppid=0x0245 tid=0x0003 slot=0x00a9 pri=0x0200 mc=0x0001
E:\CLAMAV0964\BIN\CLAMD.EXE
CLAMAV 0:000d9315
cs:eip=005b:13709315      ss:esp=0053:026af688      ebp=026af6b4
ds=0053      es=0053      fs=150b      gs=0000     efl=00010206
eax=ffffffff ebx=98badcfe ecx=efcdab89 edx=67452301 edi=ffffffff esi=10325476
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.

I would suggest prevent specify full path and created lists with sensible path to test
Enable than "scan root+os" option    

I would be interested by Dave results which has ClamAV RPM/YUM installed.

and here the clamscan error when run out of GUI (command line)
...
C:\programs/python26/lib/stringprep.py: Can't allocate memory ERROR
scanning C:\programs/python26/lib/struct.py
LibClamAV Error: cli_malloc(): Can't allocate memory (131564 bytes).
malloc_problem: Not enough memory
C:\programs/python26/lib/struct.py: Can't allocate memory ERROR
Scanning C:\programs/python26/lib/struct.pyc
LibClamAV Error: cli_calloc(): Can't allocate memory (1792 bytes).
calloc_problem: Not enough memory
LibClamAV Error: cli_ac_init: Can't allocate memory for data->lsigsuboff[0]
C:\programs/python26/lib/struct.pyc: OK
Scanning C:\programs/python26/lib/subprocess.py

Killed by SIGSEGV
pid=0x00ad ppid=0x00ac tid=0x0001 slot=0x0086 pri=0x0200 mc=0x0001
C:\PROGRAMS\CLAMAV\BIN\CLAMSCAN.EXE
CLAMAV 0:000d9315
cs:eip=005b:1fdd9315      ss:esp=0053:0013d26c      ebp=0013d298
ds=0053      es=0053      fs=150b      gs=0000     efl=00010206
eax=ffffffff ebx=98badcfe ecx=efcdab89 edx=67452301 edi=ffffffff esi=10325476
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.18, 02:04:14
ClamAV-GUI V2.1.0 refreshed
(may be it is final V2.1.0 before release)   
Title: Re: ClamAV GUI version 2.0.0
Post by: jep on 2011.02.18, 08:03:58
Hello,

Quote from: CDRWSel on 2011.02.15, 13:49:07
Changing clamscan version doesn't resolve this...
I could read on ClamAV reported bugs that they are working on a new process to unload memory !
I think that the best would be to contact Yuri which ported clamav to os/2 (eCS)
I did a test adding a debug option into clamscan but it writes not been supported...

Do you contact Yuri about the clamscan memory problem that know what you're talking about?!

Thanks
//Jan-Erik
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.18, 09:48:38
I would suggest those having RPM/YUM installed to try getting feedback from him  ::)
I don't have it (not ok) and great thanks to Dave having tested the GUI for full compatibility with ClamAV using this process.  

For me, it looks like this was a known problem to ClamAV and found several post about changes into the code to use "NULL" in case of memory issue  (May it be possible he didn't correct the NULL syntax for Os/2 ? I don't know)

PS: Do you have ClamDscan errors into POPUPLOG.OS2 too ??

Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: jep on 2011.02.18, 12:19:55
Quote from: CDRWSel on 2011.02.18, 09:48:38
I would suggest those having RPM/YUM installed to try getting feedback from him  ::)
I don't have it (not ok) and great thanks to Dave having tested the GUI for full compatibility with ClamAV using this process.  

For me, it looks like this was a known problem to ClamAV and found several post about changes into the code to use "NULL" in case of memory issue  (May it be possible he didn't correct the NULL syntax for Os/2 ? I don't know)

I'll let Dave and Yuri sort that out on their own instead. :-X

Quote from: CDRWSel on 2011.02.18, 09:48:38
PS: Do you have ClamDscan errors into POPUPLOG.OS2 too ??

Remy
I have repeated entries in Popuplog.os2 that resemble this one
==========
02-14-2011  20:13:22  SYS2070  PID 01b6  TID 0001  Slot 00f5
C:\PROGRAMS\CLAMAV\BIN\CLAMDSCAN.EXE
CLAMDSCAN->MMAP._mcommit
127
------------------------------------------------------------
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.18, 12:37:08
Yes, same entries here

Look here =>  http://svn.netlabs.org/ports/timeline?from=2011-01-09&daysback=30  


note: "Clamav.dll and Clamd*" from latest RPM/YUM are not working despite all DLL's are installed (internal error). This is why clamav.dll and clamd* are from 0.96.4.1 in the WPI
Title: Re: ClamAV GUI version 2.0.0
Post by: David McKenna on 2011.02.20, 00:44:08
Hi Remy,

  I haven't had any trouble with running clamscan or clamdscan (I usually use clamscan). I can manually start clamd from the GUI, but I have had trouble booting with Run=clamd.exe in my config.sys. The trouble is that boot hangs on MPTSTART when it is present, so I'm not sure yet what the problem is (may be configuration). I'm new to ClamAV so I need to learn.

  I also use PMMail, but I have not been able to get 'write to GUI author' to work - ClamAVGUI crashes and I get this error when I try:

02-19-2011  17:34:35  SYS3175  PID 0084  TID 0001  Slot 00c8
C:\PROGRAMS\CLAMAVGUI\CLAMAVGUI.EXE
c0000005
00014cb7
P1=00000001  P2=fffffffc  P3=XXXXXXXX  P4=XXXXXXXX 
EAX=00045fb8  EBX=000460e4  ECX=00010084  EDX=00000000
ESI=8000010a  EDI=80000001 
DS=0053  DSACC=f0f3  DSLIM=ffffffff 
ES=0053  ESACC=f0f3  ESLIM=ffffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:00014cb7  CSACC=f0df  CSLIM=ffffffff
SS:ESP=0053:00045f88  SSACC=f0f3  SSLIM=ffffffff
EBP=00045fc0  FLG=00010246

CLAMAVGUI.EXE 0001:00004cb7

Thanks again for providing ClamAVGUI.

Regards,

Dave McKenna
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.20, 12:59:29
Hi Dave,

For Clamd started from config.sys, could you do a try moving the line as last config.sys entry ?
Of course, Yuri is the right contact for ClamAV issue

If starting Clamd from config.sys creates problem, I can review code to start it from startup.cmd
May you could give it a try
a/ If your startup.cmd is a rexx: add the string after RUN= into startup.cmd prefixed by START /MIN and the whole string into quotes e.g. 'START /MIN C:\usr\sbin\clamd.exe ..................    '
b/ If it isn't a rexx, add the same except quotes
Ed the file with an exit   

About the second reported problem, which version do you use (please check under about)
I've put during last night the release online but I had to replace it due a wrong build was picked up during the script process. It is ok now under my site (I apology)
Title: Re: ClamAV GUI version 2.0.0
Post by: David McKenna on 2011.02.20, 17:34:32
Remy,

  OK, when I get some time I will try moving the Clamd.exe line in Config.sys to the end.

  I just downloaded the latest ClamAVGUI (2.1.0s) and I still have the issue with 'write to GUI Author'. When I try, the program crashes and a little window very briefly appears (some kind of runtime console?). It also disappears quickly, but I could see that there are two lines in it and they start with:

546 ++ Def_mailparms = '-cwd" ' || substr(......

Rexx 0036  Error 36 running C:\Programs\CLAMAVGUI\CLAMAVGUI.EXE Line........

That's all I could make out.

Regards,

Dave McKenna
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.20, 21:21:22
Hi Dave,

I did my test using latest PMMail program.
The program path should have a \bin in its name. Right ?
It looks like something isn't set as expected under your environement.

I just added a check about the path but something may be wrong under you os2 ini setting for pmmail.
I would like know what you have into your os2 ini file about default mail program and Pmmail ?
(of course, you can get the file again from my web link)

e.g.
PMMail/2      InstallRoot     c:\programs\PMMAil\bin

And
WPURLDEFAULTSETTINGS    DefaultMailExe    c:\programs\PMMail\bin\pmmail.exe
                                                         DefaultMailParameters   ........
                                                         DefaulMailWorkingDir    c:\programs\PMMail\bin

Thanks
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: DougB on 2011.02.20, 23:09:39
Actually, those settings, for PMMail, would not be correct, for a default PMMail 3.x installation. The DefaultMailWorkingDir would be: "c:\programs\PMMail\Accounts".

t would be better to do as I do, and have PMMail call clamdscan to scan each message, as it arrives. What I use, is a REXX cmd file:
ClamDScanPMM.CMD
==============================
/* Clamscan for PMMail */

/* Load REXXUTIL.DLL */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs

x = setlocal();

fname=arg(1)

fname=strip(fname)
/* if pos(' ',strip(fname))>0 then fname='"'fname'"' */

Curdir=directory()
CSdir=directory("\APPS\ClamAV\bin")

rc=lineOut('../Logs/ClanDscanPMM.log','===============================')
rc=lineOut('../Logs/ClanDscanPMM.log',Date()' 'Time())
rc=stream('../Logs/ClanDscanPMM.log','C','CLOSE')

'SET UNIXROOT=W:\APPS\CLAMAV'
'ClamDscan.exe --config-file=../etc/clamd.conf -l ../Logs/ClanDscanPMM.log' fname

RetCode=rc

if RetCode=1 then do
  do while lines(fname)
    Newline=lineIn(fname)
    if left(Newline,8)="Subject:" then do
      Newline=insert(' [SUSPECTED VIRUS]',Newline,8,18)
    end
    rc=lineOut(fname'.out',Newline)
  end
  rc=lineOut(fname'.out')
  rc=stream(fname,'C','CLOSE')
  rc=sysFileDelete(fname)
  'copy 'fname'.out 'fname
  rc=sysFileDelete(fname'.out')
end
if RetCode>1 then do
  rc=lineOut('../Logs/ClanDscanPMM.log','SCANNER FAILED RC='RetCode)
  rc=stream('../Logs/ClanDscanPMM.log','C','CLOSE')
end
olddir=directory(Curdir)

x = endlocal();

exit
===================
and then add that as a REXX exit to run as each file is received. I then filter on the phrase "[SUSPECTED VIRUS]" to put the suspected virus into a special folder, for further investigation. It could just move it somewhere else, or simply delete it, depending on how you wish to handle the file.

Note that I use:
'SET UNIXROOT=W:\APPS\CLAMAV'
to replace the default UNIXROOT, which is used for SAMBA (x:\MPTN\ETC), and isn't the same as what I want to use for ClamAV (or anything else). In fact, it would be far better to use RUN! to set the Environment up properly for ClamAV (and other things). This nonsense was not needed before the latest update produced by Yuri for RPM/YUM.

Mentioning that, it is NOT good for your installer to mess with what is in the UNIXROOT entry in CONFIG.SYS. It is probably also not good to use that entry for ClamAV(GUI). You will probably break something else (like SAMBA).
Title: bout
Post by: CDRWSel on 2011.02.20, 23:43:55
ClamAV-GUI doesn't need unixroot an I may suggest you give it a try :-D
It is checking for it when ClamAV was installed through RPM/YUM which requires UNIXROOT being set into config.sys and when using latest ClamAV 0.96.4.x (@UNIXROOT should be set at root level). This is main RPM/YUM requirement

About PMMail install path, it is like I wrote due I installed latest PMMail WPI package and I checked all ini setting after a well installation.
PMMail is installed under  boot_drive\...\PMMail\bin
the account are under boot_drive\...\PMMail\Account
This is conform to what Jep wrote too.

The reported question was not about how to scan PMMail message but about how to write to me using the
clamav-gui "write to author" option with PMMail. 

kind regards
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: David McKenna on 2011.02.21, 14:26:31
Hi Remy,

  Here are my settings:

PMMail/2  Install Root C:\programs\PMMail\bin

WPURLDEFAULTSETTINGS:  DefaultMailExe  C:\programs\PMMail\bin\PMMail.exe
                                     DefaultMailParameters  -compose
                                     DefaultMailWorkingDir   C:\programs\PMMail\Accounts

This is how it was installed by PMMail on my machine.

HTH,

Dave McKenna

Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.21, 15:19:19
Hi Dave,

Ok

DefaultMailParameters seems strange because "-compose" is thunderbird parm.
It  looks for me more interesting to have
DefaultMailParameters  -cwd  C:\programs\PMMail\Accounts

then, I didn't expect to see
DefaultMailWorkingDir   C:\programs\PMMail\Accounts      << this is account path !
I wrote the program in hope to find
DefaultMailWorkingDir   C:\programs\PMMail\bin               << same as suggested by Jep 

Now I know why it fail. I have to review my code to be able to manage parms like you have.
Until I did changes, could you do a try changing to:

DefaultMailParameters    -cwd  "C:\programs\PMMail\Accounts"   
(I set this when defaultmailexe is not Pmmail and you set "use it as default")

and
DefaultMailWorkingDir   C:\programs\PMMail\bin

don't forget to add the trailing blanks    '00'x   
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.21, 20:53:24
Hi Dave,

Please replace the exe file with this new one and tell how it works.
http://remydodin.levillage.org/outils/ClamAVGUI.ziq    (rename ziq ti zip)

Thanks

Kind regards,
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: David McKenna on 2011.02.22, 00:00:00
Hi Remy,

  I removed '-compose' from DefaultMailParameters (don't know how that got there - maybe  from original eCS install?) and replaced ClamAVGUI.exe with this new one you suggest and now the 'write to GUI author' starts PMMail with Subject and your e-mail address inserted. Thanks!

Regards,

Dave McKenna
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.22, 00:15:08
Fine,

One more issue resolved.

Kind regards,
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: DougB on 2011.02.22, 02:17:10
QuoteOne more issue resolved.

Perhaps not. It looks, to me, that David has his INI entries for PMMail messed up, somehow. They certainly are not right. These are the ones that should be there:

[HINI_USER_PROFILE\PMMail/2]
InstallRoot="W:\APPS\PMMail\BIN"
(path should, of course, match reality)

[HINI_USER_PROFILE\WPURLDEFAULTSETTINGS]
DefaultMailExe="W:\APPS\PMMail\BIN\pmmail.exe"
DefaultMailWorkingDir="W:\APPS\PMMail\Accounts"
DefaultMailParameters="-cwd W:\APPS\PMMail\Accounts -s DOUGB00.ACT"
(again, the paths need to match reality).

There are a couple of other entries, but they are not involved with what you want to do.

This will be set properly (IF you have not changed the location of the Accounts directory) by the migration tool, when it makes PMMail the default mail program (it is a stand alone option in the migration tool). Note that the Internet Application Integration program does NOT do it properly, and Chuck has declined to fix the problem, but it can be entered manually using IAI. What has been quoted looks like what IAI does. The DefaultMailParameters is the command to PMMail to open a compose window, in the specified account. All of that should be followed by the To: CC: Subject: and whatever else you want, in the same format as Firefox sends it in a Mailto: link. There is more information in the PMMail FAQ at:
http://pmmail.os2voice.org/index.php?title=PMMail_FAQ (http://pmmail.os2voice.org/index.php?title=PMMail_FAQ)
Title: Re: ClamAV GUI version 2.0.0
Post by: David McKenna on 2011.02.22, 02:54:58
Doug,

  Thanks for the heads-up about IAI (yes... I was using that). Fixed my entries as you suggest and still ClamAVGUI 'write to GUI Author' works fine. Maybe because I only have one account...

  I am intrigued by your suggestions for using ClamAV with PMMail and plan on giving them a try. Maybe they are something that can be added to a future version of PMMail...

Regards,

Dave McKenna
Title: Re: ClamAV GUI version 2.0.0
Post by: DougB on 2011.02.22, 07:50:48
QuoteMaybe they are something that can be added to a future version of PMMail...

We discussed that, a couple of years ago, but ClamAV is not a very friendly OS/2 application, as you can see by what has been required to make it work with ClamAVGUI. My REXX script seems to work well, but it did require the addition of the UNIXROOT thing, after the ClamAV 0.96.4.4 update (possibly because of the way that I install it, and use it, plus UNIXROOT is used by SAMBA). It was decided that ClamAV was better supported by an external REXX program, which is the way that I use it, rather than try to keep up with it inside of PMMail. Perhaps that is not ideal from a user perspective, but from a developer perspective, it makes sense. There is really only one person working on PMMail, and he is overloaded already, so it is best to avoid loading him up with even more work, when it isn't necessary. That doesn't mean that it will never be done, but I can't see it happening in the foreseeable future.

QuoteClamAV-GUI doesn't need unixroot an I may suggest you give it a try :-D

I have tried it, and I don't like the way you do it (just my own preference, there is really nothing wrong with what you do), although SAMBA quit working after I installed ClamAVGUI, so I uninstalled it (Samba is more important). My own preference is to call ClamDScan.exe from a batch file, when that is appropriate (like from PMMail), otherwise, I have set the associations to have ClamDScan associated with every file, and adding a shadow of ClamDScan.exe to the  Extended Menu Options (X/eWorkplace) adds it to the popup menu for drives, and directories. A simple right click-> Open As-> ClamDScan.exe, and it scans the file. Or, RMB the drive, or directory, and ClamDScan is one of the options. I set ClamDScan so that it doesn't close the window when it is finished, and I can see the summary before closing the window. Not as flashy as what you did, but just as effective.

FWIW, I do trap an incoming mail virus, every once in a while, but i don't think I ever caught one lurking on my system otherwise.
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.22, 09:58:24
Quote from: DougB on 2011.02.22, 02:17:10
QuoteOne more issue resolved.

Perhaps not. It looks, to me, that David has his INI entries for PMMail messed up, somehow. They certainly are not right. These are the ones that should be there:

[HINI_USER_PROFILE\PMMail/2]
InstallRoot="W:\APPS\PMMail\BIN"
(path should, of course, match reality)

[HINI_USER_PROFILE\WPURLDEFAULTSETTINGS]
DefaultMailExe="W:\APPS\PMMail\BIN\pmmail.exe"
DefaultMailWorkingDir="W:\APPS\PMMail\Accounts"
DefaultMailParameters="-cwd W:\APPS\PMMail\Accounts -s DOUGB00.ACT"
(again, the paths need to match reality).

I'm sure he has InstallRoot correct or it will not start
About other entries,  only
DefaultMailParameters="-cwd W:\APPS\PMMail\Accounts -s DOUGB00.ACT"
Wasn't correctly set but no need to have the account name appended to the parms.
(See PMMail doc)
Having  DefaultMailParameters="-cwd C:\programs\PMMail\Accounts" is enought and correct
Only in case of migration and with more accounts, adding the account name is helpfull here

But no matter about how his ini entries are. I do several check and able to start PMMail if default ini entries are set or not and if DefaultMailParameters are bad, I'm able to try new default parms....
What is making you tell "Parhaps NO" about my ClamAV-GUI resolved PMMail issue when starting it ?
Did you analyze my code ?  
 
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.22, 10:17:48
Quote from: DougB on 2011.02.22, 07:50:48

QuoteClamAV-GUI doesn't need unixroot an I may suggest you give it a try :-D

I have tried it, and I don't like the way you do it (just my own preference, there is really nothing wrong with what you do), although SAMBA quit working after I installed ClamAVGUI, so I uninstalled it (Samba is more important).


Humm !
You didn't understand how UNIXROOT is used when installed via the "not official" ClamAV WPI build I did and how it is used with ClamAV-GUI
(You may see that what you have no reason to do it like you do)  

Let me tell you how the UNIXROOT is used when WPI installed.
The only required path using UNIXROOT is for the ClamAV database (This isn't the case when using RPM/YUM)

Why don't you add required ClamAV database under your existing UNIXROOT path ?
Realy, there is no need to create a batch programs to set environment variable and run ClamAV from it!        

Under a second system, I have ClamAV installed under  C:\programs\ClamAV
and "SET UNIXROOT=E:"     << see, it is not ClamAV installation path

How to do ?
Add under UNIXROOT used by SAMBA following directories
SAMBA_UNIXROOT\var\lib\clamav
That's all for "unixroot" and nothing to install  

Now, under ClamAV-GUI, set manually the database path to this created path and save despite the red led is on.  Run database update and it will updated config file and load database files into the right directory.  That's all and very easy to do (no batch or extra process to use and your SAMBA as well as ClamAV will work)

This is much easier to do as your suggestion  ;)

Futur ClamAV have more products dependencies and my latest tested WPI always fail depite adding more required dlls - internal error - It seems requiring RPM/YUM process :(
This may suppose you to review all your installation !

ClamAV is compatible with ClamAV WPI or RPM/YUM packaged  


Hi Dave,
Just create lists for you PMMail and you can scan it at request but if you start ClamD, no need to scan you PMMail path, mails are checked by ClamAV daemon     

Best regards,
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: DougB on 2011.02.22, 20:11:44
QuoteDefaultMailParameters="-cwd W:\APPS\PMMail\Accounts -s DOUGB00.ACT"
Wasn't correctly set but no need to have the account name appended to the parms.
(See PMMail doc)

Well, a single account might work without that, but you may find that a user doesn't always want to use the first account that is found.

QuoteWhat is making you tell "Parhaps NO" about my ClamAV-GUI resolved PMMail issue when starting it ?
Did you analyze my code ?

I have been working with the new PMMail, for a few years now (as alpha, beta tester, plus support). I also wrote the migration tool, so I do have some insight into how it all works. You will find that not having the account defined can cause problems.

QuoteYou didn't understand how UNIXROOT is used when installed via the "not official" ClamAV WPI build I did and how it is used with ClamAV-GUI
(You may see that what you have no reason to do it like you do)

I do it the way that I do, because it works for me. UNIXROOT is a hard coded directory structure in *NIX, that I do not like, and I try to avoid using it whenever possible - even to the point of not using programs that insist on using that structure. My usual work around is to define a unique UNIXROOT for each program that wants to use that nonsense. How I do that depends on how the program uses UNIXROOT. Usually, I just add a new setting to point to the program install directory as the UNIXROOT path. I do that with DragText, most of the time, but RUN! will also do it, or I can simply use a wrapper cmd file. I haven't taken the time to try to get SAMBA sorted out, because it is delicate enough, without adding more possible ways for it to fail. How you use it is up to you, I am not particularly impressed with ClamAVGUI (my own preference, not a reflection on your work), so I don't intend to use it. I do like to have an AV program, and ClamAV seems to be the only choice for OS/2, so I use it, but I use it in the way that I like to use OS/2, I don't need a "front end" processor for that, the WPS does the job, in the way that I like to use OS/2.

QuoteThe only required path using UNIXROOT is for the ClamAV database (This isn't the case when using RPM/YUM)

Actually it is, because RPM/YUM takes over the UNIXROOT thing, and all programs must use it, or they won't work with RPM/YUM.

QuoteWhy don't you add required ClamAV database under your existing UNIXROOT path ?

Not a chance. My default UNIXROOT path is c:\MPTN\ETC (what SAMBA insists on using). There is already way too much junk in there, and it is on my boot drive, where I really don't want anything, except the actual OS2/eCS stuff. I like to be able to just install a new eCS, and pick everything else up from one of the other drives.

QuoteRealy, there is no need to create a batch programs to set environment variable and run ClamAV from it!

Well, there is, because PMMail links to outside programs using REXX exits. Since I will not use the default UNIXROOT entry in CONFIG.SYS, I need to set the UNIXROOT that I want ClamAV to use. I will, probably, change the way I do it, to use RUN!, when I find the time.

QuoteUnder a second system, I have ClamAV installed under  C:\programs\ClamAV
and "SET UNIXROOT=E:"     << see, it is not ClamAV installation path

That is okay, but now your ClamAV update files will be on E:, not with the rest of the ClamAV stuff, where they should be (and ClamAV and/or ClamAVGUI, should NOT be on the boot drive). I am not sure what SAMBA would do with that either.

QuoteThis is much easier to do as your suggestion

Is it? Can I RMB on a file (any file) and select ClamDScan as one of the programs to handle that file? Can I RMB on a folder, or a drive, and have ClamDScan as an option? I don't want to open a new program just to scan a file, directory, or drive.

I think we will need to disagree about how to use ClamAV. I will use it, as long as I don't need to jump through hoops just to get the updated program, and make it work. I am not planning to use ClamAVGUI, because I don't like working that way, when I don't have to. One of the great things about OS2/eCS is that there are many ways to do things, so a user can do it in a way that they feel comfortable with. The *NIX world has many restrictions, that OS/2 does not have, until someone decides to force them upon the user, and UNIXROOT is one of them. I don't need to submit to using it, in the prescribed way, though.
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.22, 20:28:19
Hi Doug,

I understand you position and I agree with most of them.
RPM/YUM (I hate) but I had to do with those using it.

By default, there is no entries under WPS to call ClamDscan under WPS options.
This means you wrote a program to update WPS entries and add ClamDscan as option

Of course, you can drag/drop a file or a folder on ClamAV-GUI and it works with the advantage to have the a log file, use of your usual conf file etc... 
Only when you drag/drop more than one file, it opens one ClamAV instance and because it is the same time, there is a shared log access issue. This can be improved next....

Have a nice evening
Cheers
Remy
   
Title: Re: ClamAV GUI version 2.0.0
Post by: DougB on 2011.02.22, 23:03:33
QuoteBy default, there is no entries under WPS to call ClamDscan under WPS options.
This means you wrote a program to update WPS entries and add ClamDscan as option

I wrote nothing. I just used the facilities that already exist. To associate ClamDScan with every file in the system, I make a program object (icon) for ClamDScan, and set the association to "*" (asterisk, without the quotes). Now, when I RMB on the icon of any file on the system, it is associated with ClamDScan, and ClamDScan is listed in the Open As menu, click, and it runs. By also setting ClamDScan so that it leaves the window open, after running, I see the results before I close the window. Adding ClamDScan to the folder and drives menus, requires X/eWorkplace. I just put a shadow of ClamDScan into the Extended Menu Options folder, and that does the job. There is actually a way to do that without using X/eWorkplace, but it has been many years since I did it, and now I don't remember how to do it.

QuoteOf course, you can drag/drop a file or a folder on ClamAV-GUI and it works with the advantage to have the a log file, use of your usual conf file etc...
Only when you drag/drop more than one file, it opens one ClamAV instance and because it is the same time, there is a shared log access issue. This can be improved next....

I see the log problem, if I select more than one file at a time (rarely useful). The log is created/updated when ClamDScan runs, using its config file, or parameters, to define the log file. Since I leave the window open, it is not necessary to look in the log file, unless I want to review something later. I can also drag/drop onto the icon, but that means that I need to find the icon first. Just a lot more effort than what is required.

BTW, if you use E.EXE, or AE.EXE, a log file that is being used will not open (poor program design, but that is the way it is). If you use EPM.EXE, it will open a locked log file, although it is usually in read only mode.
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.23, 01:15:52
How to add "ClamAV scan..." under Folder menu ?    
Open:
"Local system" folder
     - Open "System Setup" folder
            - Open "Extented Menu Option" folder
              1/ Create a new program
              2/ Give the name as you want have it display under Folder Menu
              3/ Specify ClamAVGUI.exe full path as program path
              4/ Add default parms like it is under original program folder.
Save and close all
Now do a try

To edit contain of an open/inuse logfile:
Create a temporary file through:
TYPE logfile > tempfile
Edit tempfile

Kind regards,
Remy
Title: Re: ClamAV GUI version 2.0.0
Post by: David McKenna on 2011.02.25, 19:42:40
Remy,

  I finally got a chance to play around with starting Clamd from CONFIG.SYS. When I use 'Start ClamDaemon' and allow it to insert a line in my CONFIG.SYS, the next boot hangs at MPTSTART. If I move that line to the end of all 'RUN=...' lines in CONFIG.SYS, then booting completes.

  Then when I start ClamAVGUI, it shows that 'ClamD is Running', but if I try to perform a scan (using Clamdscan) I get buzzing and a message: ERROR: Can't connect to clamd: Can't assign requested address.

One strange thing at this point is if I choose 'Clamdscan (conf)' it displays the file /etc/clamd.conf NOT C:\Programs\ClamAVGUI\clamd_GUI.conf (as directed by the clamd parameter '--config-file=...' added by ClamAVGUI in CONFIG.SYS). Going in to ClamAVGUI settings and saving, then using Clamdscan (conf) again displays C:\Programs\ClamAVGUI\clamd_GUI.conf. This is confusing - which file is clamd really using?

  If clamd is not started from CONFIG.SYS, but manually started from ClamAVGUI using 'Start ClamDaemon', then I can perform scans using clamdscan with no trouble. It's not clear to me what may be wrong...

Regards,

Dave McKenna
Title: Re: ClamAV GUI version 2.0.0
Post by: CDRWSel on 2011.02.25, 22:36:14
Hi Dave,

"One strange thing at this point is if I choose 'Clamdscan (conf)' it displays the file /etc/clamd.conf"
Hum ! This may be a bug in my code when ClamAV is RPM/YUM installed. I'll check this.

About "Can't connect to clamd: ..." it looks like the parameters in config.sys are ignored. I will check what happens here...