Post new topic Reply to topic  [ 267 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: 2006-01-06 17:48 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
Are you not getting any markup in the headers of the emails you sent yourself? Like X-Spam-Level?

Is SpamD running? If it is you should see about 5 instances of perl.exe running in your task manager.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-06 21:35 
New user
New user

Joined: 2006-01-04 22:23
Posts: 21
GlenC wrote:
Are you not getting any markup in the headers of the emails you sent yourself? Like X-Spam-Level?

Is SpamD running? If it is you should see about 5 instances of perl.exe running in your task manager.


There's the problem. I did not get that installed properly I guess. What is the best way to do that? Is it in the tutorial at the beginning of the thread and if so, is it still applicable?


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-06 22:24 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
I scanned through the tutorial and didn't see it. You should be able to test it by just running spamd in a dos box for now. ( spamd -D -u username ) When you know what command line options work best for you then you can probably install it as a service with Srvany. It's been a while since I ran with activestate so my memory is failing me as to any other things you might need to do.

If all else fails you should still be able to run the raw SpamAssassin, but your script will need to be modified in order to do so.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-06 22:39 
New user
New user

Joined: 2006-01-04 22:23
Posts: 21
GlenC wrote:
I scanned through the tutorial and didn't see it. You should be able to test it by just running spamd in a dos box for now. ( spamd -D -u username ) When you know what command line options work best for you then you can probably install it as a service with Srvany. It's been a while since I ran with activestate so my memory is failing me as to any other things you might need to do.

If all else fails you should still be able to run the raw SpamAssassin, but your script will need to be modified in order to do so.


I must've done something wrong along the way. spamd and spamc both return "is not recognized as an internal or external command". spamassassin works from the dos prompt. I guess I assumed that spamc/d was created during the nmake step of the tutorial. I apologize for that.

I want to use spamd/spamc. What's my next step?


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-06 23:06 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
crap...

I feel like I have wasted your time. You just made me remember that SpamD will NOT run with activestate perl without some pretty heavy modification. And you need to use a specially built version of SpamC too.

I am REALLY sorry!

If you want to try anyway... here is the link for the mods that had to be made for SpamAssassin version 3.0. I have no idea how this will work with 3.1
http://wiki.apache.org/spamassassin/SpamdOnWindows

Here is the link for the windows version of SpamC:
http://sourceforge.net/projects/winspamc

I had run it this way for a while but had forgotten what all was involved to make it work.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-06 23:21 
New user
New user

Joined: 2006-01-04 22:23
Posts: 21
GlenC wrote:
crap...

I feel like I have wasted your time. You just made me remember that SpamD will NOT run with activestate perl without some pretty heavy modification. And you need to use a specially built version of SpamC too.

I am REALLY sorry!

If you want to try anyway... here is the link for the mods that had to be made for SpamAssassin version 3.0. I have no idea how this will work with 3.1
http://wiki.apache.org/spamassassin/SpamdOnWindows

Here is the link for the windows version of SpamC:
http://sourceforge.net/projects/winspamc

I had run it this way for a while but had forgotten what all was involved to make it work.


No need to apologize. I appreciate all the help you are giving me.

Could I switch to cygwin? Is this practical? I have no other reason to have activestate on the server and only installed it for SA. I don't mind making modifications, etc. I'll do whatever it takes. I would like to have SA-learn running well, ultimately, I think.

Thanks again. I've worked in computer support for about 5 years. i know how these things go (my boss is not as patient but oh well). I have never dealt with perl and have installed SA once on a web server I lease (pretty straight forward in linux).


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-06 23:33 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
Yes you can, and actually it will be better because with cygwin you get the full functionality of spamd.

The cygwin install is a little more tedious, but once it is working, it works well (for me at least)

Here is the link to the How-To http://www.hmailserver.com/forum/viewtopic.php?t=3144

It appears that at least a few people have had good success following those instructions.

As for activestate, you should be able to just uninstall it. Just make sure that you remove the reference to c:\perl\bin in your path, I doubt the uninstall will do that for you.

One other thing that the How-to doesn't mention, but that I think probably needs to be fixed in the How-to... don't install it as the user "Administrator" I think spamd will refuse to run as that user.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-06 23:43 
New user
New user

Joined: 2006-01-04 22:23
Posts: 21
GlenC wrote:
Yes you can, and actually it will be better because with cygwin you get the full functionality of spamd.

The cygwin install is a little more tedious, but once it is working, it works well (for me at least)

Here is the link to the How-To http://www.hmailserver.com/forum/viewtopic.php?t=3144

It appears that at least a few people have had good success following those instructions.

As for activestate, you should be able to just uninstall it. Just make sure that you remove the reference to c:\perl\bin in your path, I doubt the uninstall will do that for you.

One other thing that the How-to doesn't mention, but that I think probably needs to be fixed in the How-to... don't install it as the user "Administrator" I think spamd will refuse to run as that user.


Excellent. I'm excited to make the change. Full functionality is key. 8)

So do not install cygwin when logged in as administrator or does it ask what user to run under?


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-07 00:00 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
You can install cygwin for all users. But it won't ask what user to run it under. I don't know for sure it is a problem, but if you read the thread you will see that it appears that one person might have an issue trying to run it that way. To be safe, I would just avoid that and install it under a different windows user. On my machine, I installed it while logged in as GlenC, and then when setting up the scripts and services I used the "-u GlenC" option for spamd, spamc and sa-learn. You have some experience with Linux so you understand how the permissions and users and groups can get to be a PIA.

Edit: Note that I meant "Administrator" and not a "Member of the Administrator Group" which won't pose that problem.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-11 06:38 
Normal user

Joined: 2005-12-22 04:10
Posts: 103
Why hasn't this: http://www.hmailserver.com/forum/viewto ... =9101#9101 been turned into a how to?


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-11 17:11 
New user
New user

Joined: 2006-01-04 22:23
Posts: 21
I installed cygwin and have it up and running for now. I would like to add salearn, etc to script but that can wait. Thanks to all that helped. It's much appreciated. I will have no qualms about recommending hMailServer to others.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-12 05:23 
Normal user

Joined: 2005-12-22 04:10
Posts: 103
I am running spamd, spamc and sa-learn in Cygwin. Am I going to run into any issues following this: http://www.hmailserver.com/forum/viewto ... =9101#9101 process to get user-level configuration?


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-12 08:46 
Normal user

Joined: 2005-12-22 04:10
Posts: 103
To stay on the current subject that this thread seems to have taken on, I tried to run SpamD in Cygwin and had some problems, as observed in the other thread. I gave up for a couple days and installed Active State Perl and ASSP, then came back to Cygwin because I was disappointed with ASSP and new that SpamD runs so much better in Cygwin than in Active State Perl.

I am currently running both Active State Perl and Cygwin fine. I imagine I may have to make sure that there are no conflicting instances of programs using the same filenames in both c:\perl\bin and c:\cygwin\bin sometime down the road if I decide to utilize any of them. I also had to disable the ASSP service in the MMC, but I didn't uninstall ASSP because you never know. I imagine if you have installed SA in both Cygwin and ActiveState Perl you will have to disable some services, rename some files or uninstall one or the other completely.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-12 10:26 
Normal user

Joined: 2005-12-22 04:10
Posts: 103
I am running hMailServer and SpamAssassin on Cygwin. I want to set it up so that any detected spam be moved to an IMAP folder for that account. I want to also set up a webmail app, any app, that will tie in to SpamAssassin as much as possible. Then allowing users to change SA config prefs all within the same webmail app would also be a plus. Anyone know how it is done?


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-12 15:14 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
webavant wrote:
II want to also set up a webmail app, any app, that will tie in to SpamAssassin as much as possible. Then allowing users to change SA config prefs all within the same webmail app would also be a plus. Anyone know how it is done?


You can take a look here, there are some SM plugins and other options for configuring SA prefs. I would recommend going the SQL route so you don't end up with a bunch of user directories in your cygwin directory though. http://wiki.apache.org/spamassassin/WebUserInterfaces


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-12 15:30 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
webavant wrote:
I am running spamd, spamc and sa-learn in Cygwin. Am I going to run into any issues following this: http://www.hmailserver.com/forum/viewto ... =9101#9101 process to get user-level configuration?


You will need to parse the recipients list to get the users and run spamc for each recipient. I experimented with this a while back and was using something along the lines of this... you will need to clean this up to make it work properly I think:
Code:
dim cmd, rc, sh, infile, testfile, recip_addr, recip_name
infile = fso.getabsolutepathname(file_name)
testfile = infile & ".tmp"
fso.copyFile infile, testfile

'ID recipients in order to use SpamD user_prefs
for i = 0 to oMessage.Recipients.Count - 1

'Separates the user name from the domain, place in recip_name(0)
'you need to modify this if your SA setup uses [email protected] names.
recip_addr = oMessage.Recipients(i).Address
if oMessage.Recipients.Item(i).IsLocalUser then
   recip_name = Split(recip_addr, "@",-1,0)
'call spamc for each recipient
   cmd = "cmd /c spamc -E -s 512000 -u """ & recip_name(0) & """ < """ & testfile & """ > """ & infile & """"
   set sh = CreateObject("WScript.Shell")
   rc = sh.Run( cmd , 0 , TRUE)
   If rc = 0 Then         'Normal operation HAM
   '   Msgbox "Result code 0", 0, "Msg"
      Elseif rc = 1 Then   'Normal operation SPAM
   '   Msgbox "Result code 1", 0,"Msg"
   End If
end if
next


Top
 Profile  
 
 Post subject: Blank emails...?
PostPosted: 2006-01-16 13:18 
New user
New user

Joined: 2005-12-11 05:26
Posts: 4
Location: California
Do you know why I keep getting blank email messages? Everything else works great. SpamAssassin has been installed properly and tested to work manually. But when I plug it into hMailServer, using either the scripting method or the External Virus Scanner, all I ever get is a blank email with NOTHING in it. No headers, no body, no nothing.

I've spent several hours trying to figure this out and I'm out of ideas.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-16 16:03 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
Are you using spamd? And if so, is it running? That is the common mistake. Also, is perl in your path?

If those don't fix it, post the relavent portion of your script.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-29 08:49 
New user
New user

Joined: 2006-01-27 09:55
Posts: 4
Quote:
"If it is not working and you are getting only blank emails in your inbox, check you have R64"


What do you mean, R64? Revision .64 of SpamAssassin? of hMailServer?... This line makes no sense to me...

I've installed SpamAssasin, i have made spamc.exe, and i've got the vbscript set up and configured to run as an External Antivirus, but all i get are BLANK EMAILS... No subject, no sender, no body... All blank.

Help!


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-29 10:09 
New user
New user

Joined: 2006-01-27 09:55
Posts: 4
Ok, upon closer inspection of this How To, i realize that what is meant to be done is modifying the C:\Program Files\hMailServer\Events\EventHandlers.vbs file, and uncommenting, and creating the Sub onDeliverMessage(oMessage) sub to have a value that does all the spam-checking...

But for the average reader it is extremely frustrating, and difficult to understand.

Could we please find an agreeable onDeliverMessage sub and re-post it as clear and precise as possible. And what would be even better would be to "Edit" the first post, so that the next user doesn't come up and start from square one, and have problems, then try cygwin, then realize they need to do a bunch of other crap, and then finally come to realize that they just need a few files and need to modify their EventHandlers vbscript...

That's just my opinion...

And i still cannot get the EventHandlers to do anything to spam. I've tried all of the vbscripts, but to no avail... Please help!


Top
 Profile  
 
 Post subject: Blank emails
PostPosted: 2006-01-29 11:46 
New user
New user

Joined: 2005-12-11 05:26
Posts: 4
Location: California
I still haven't gotten SpamAssassin to work. At the moment, it's not being utilized because all I get is blank emails.

I have successfully tested SpamAssassin by passing email into it manually and it spits back a modified email with the headers updated and such. Perl is in my command path. All seems well with the world.

The problem lies in the connection from hMailServer to SpamAssassin. I've tried many different variations... using both the Virus Scanner to call SpamAssassin and the EventHandlers.vbs. Neither makes any difference. I still get blank emails.

I've added debug output to figure out what's going on. All I can figure out is that SpamAssassin is NOT being called by hMailServer. The script blows right past the call to SpamAssassin and somehow ends up with a blank email.

I have confirmed that the script IS creating the email file and the temporary email file. I have even taken the email file in the directory where it's created and used the exact VBS code from my script to call SpamAssassin the same way (but doing it manually with a custom .VBS file) and it works fine: SpamAssassin is launched and a couple seconds later, it rewrites the email file with the spam headers. However, it fails when hMailServer tries to do it. There is no error whatsoever. I just get blank emails.

The only significant difference I can figure out between my setup and everyone else's is that everyone else seems to be using CygWin. Before I continue installing more and more stuff on my server, I was hoping I could get it to work without CygWin. Then, once that was working, I figured I would see how the performance was. Only then would I go the CygWin route... if the performance needed a boost. But maybe most others aren't seeing my problem because they're all blowing right past my basic setup and they're going straight to CygWin which might inadvertently fix whatever my problem is?? I don't know.

Here is the OnDeliverMessage() code I currently use. Keep in mind, I have used at least a dozen variations of this code, much of it taken from this form, and the result is always the same.

Code:
   fname = oMessage.filename
   Dim infile, testfile, sh
   Dim fso
   Set fso = createobject("Scripting.FileSystemObject")
   If Not fso.fileexists(fname) then
      result.Value = 0
      Exit sub
   End If
   
   infile = fso.getabsolutepathname(fname)
   testfile = infile & ".tmp"
   fso.CopyFile infile, testfile
   Set sh = CreateObject("WScript.Shell")
   
   'CALL SPAMASSASSIN
   Dim cmd, rc
   cmd = "cmd /c perl -S -T -w spamassassin < """ & testfile & """ > """ & infile & """"
   rc = sh.Run( cmd , 0 , TRUE)
   result.Value = 0
   fso.Deletefile testfile
   Set fso = Nothing


By the way, I have to second SoundOfEmotion's comment that the original post should be edited. I was also (and still am) very confused about the "R64" reference. I still don't know what that means! But from the post, it sounds crucial.

Thanks for your help, guys! I really appreciate it!


Top
 Profile  
 
 Post subject:
PostPosted: 2006-01-29 14:48 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
R64 refers to the minimum requirement for hmail (hMailServer 3.4 Build 64)

The problem is obviously here:
Code:
cmd = "cmd /c perl -S -T -w spamassassin < """ & testfile & """ > """ & infile & """"


The only way you are going to get blank emails is if this line is executed AND spamassassin is not returning the marked up message to "infile"

You can tell the line is being executed because that is the only way "infile" will change... nothing else writes to "infile"

Your command to call spamassassin looks ok, so that really only leaves two things in my mind. Either the script can't find perl, or perl can't find spamassassin.

Since you say perl is in your path, that leaves spamassassin. What directory did the spamassassin executeable get installed to and is THAT in your path?

That's about all I can guess... your script looks ok to me otherwise.

SoundofEmotion: Your problem is similar, except you need to 1. Ensure spamd is running and 2. Ensure perl and spamc are in your path.

Also note that spamd won't run with activestate perl... unless you make some modifications to the spamd file. I believe there is a link to that somewhere in this thread.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-02-10 03:39 
New user
New user

Joined: 2006-01-19 06:43
Posts: 21
Location: Australia
john25uk wrote:
If you want to have hmail delete the spam for you, open the vbs file and change the wscript.quit(7) to wscript.quit(rc)

and
add the -e to the cmd string ie:
cmd = "cmd /c perl -S -T -w spamassassin -e < """ & testfile & """ > """ & infile & """"

and set the return code in hMailServer Admin to 5

then it will delete everything that spamassassin thinks is spam.

Though i would get everything marked as spam put into a seperate mailbox instead, so you can check it first before deleting it as you won't know if its really ham

John


Hi again,
I followed the entire thread through here - Spam Assassin 3.1 is running fine, hMail is processing mail & Spamassassin is marking mail up, but I cannot get mail to be deleted using John25UK's suggested method above. Can anyone assist with this please?

I changed the line mentioned above in sa.vbs, saved, rebooted the entire machine in case something was not taking immediate effect. Any assistance would be greatly appreciated. - Terry

_________________
Bye for now, Terry


Top
 Profile  
 
 Post subject:
PostPosted: 2006-02-10 23:04 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
It has been so long since I messed with that script from John25UK. The first thing you should check I suppose is to ensure you are using the "-e" switch on your call to spamassassin.

Make sure you changed the last line in the .vbs file from (7) to (rc)

Next, look in your logs (you may have to turn on debug logging and application logging) and make sure that "5" is the value being returned. The SpamAssassin docs say that using the "-e" switch will cause spamassassin to return a value > 0. I don't know where the "5" value came from. So look and see what the log says it is returning and try using that value.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-02-11 10:56 
New user
New user

Joined: 2006-01-19 06:43
Posts: 21
Location: Australia
Hi again,
Many thanks Glen, I will check that out. The script was definitely modified so that the last line is indeed changed to 'rc' instead of 7. I will have to check what values the server is returning.

The 0 is perhaps what the problem is. It's a shame that the web admin doesn't assist in changing or viewing the logs at this stage, because I will have to visit the client's office agan for this.

_________________
Bye for now, Terry


Top
 Profile  
 
 Post subject:
PostPosted: 2006-02-13 10:48 
New user
New user

Joined: 2006-01-19 06:43
Posts: 21
Location: Australia
Hi again,
GlenC - the problem was very simply the fact that all changes had been made, including the last line to rc, but the changes had not been saved (where did I leave my head by the way?). After checking it had been saved now, everything is working as expected.

Just for everyone's information, SpamAssassin by default marks any value over 5 as 'spam=yes', so that's where the value comes from & that's what the script returns if it is spam. If the value is between 0-5, then it is not classed as spam & is passed through without issue. This is exactly the way SpamAssassin runs on *nix servers I administrate.

_________________
Bye for now, Terry


Top
 Profile  
 
 Post subject:
PostPosted: 2006-08-01 15:28 
New user
New user

Joined: 2006-07-25 09:48
Posts: 2
Location: France
Hi,

To use SA 3.1.3 with option "-e", you need modify spamassassin script in C:\Perl\Bin.
Replace the line : eval { $exitvalue ||= $iter->run(@targets); };
by the line : $iter->run(@targets);

that's return 5 for a spam and 0 for a non-spam


Top
 Profile  
 
 Post subject: Query on SA and hM
PostPosted: 2006-08-29 14:34 
New user
New user

Joined: 2005-08-22 14:33
Posts: 7
Anyone attempted to use this Win32 non-cygwin/non-perl version of Spamassassin? http://physics.ucsd.edu/~epivovar/anti-spam.htm
... SpamAssassin for Windows (Win32), a native Windows build of spamassassin and spamd/spamc command-line tools. (Especially useful on mail servers.)...


Top
 Profile  
 
 Post subject: Re: Query on SA and hM
PostPosted: 2006-09-19 07:09 
Normal user

Joined: 2005-07-16 01:46
Posts: 36
fingers wrote:
Anyone attempted to use this Win32 non-cygwin/non-perl version of Spamassassin? http://physics.ucsd.edu/~epivovar/anti-spam.htm
... SpamAssassin for Windows (Win32), a native Windows build of spamassassin and spamd/spamc command-line tools. (Especially useful on mail servers.)...

I am trying to, i get everything working except having spamd running as a service.

it works perfect when i just start it by doubleclicking spamd.exe in the catalogue, but when i try to set it up as a service with srvany i cant get it to work.

anyone have got it working and can make a brief walkthrough?

EDIT: found the answer by googling a bit:

pop3proxy wrote:
Hi, Yann! I am the guy who maintains spamassassin for windows. Found your post accidentally by googling...

I believe that the root of the problem is in the fact that my build of spamd finds all other files (in particular, the rules) relative to the current folder, unless you install it in the folder \usr. You should probably create a file spamd.bat and put two lines there

cd {full path to SpamAssassin for Win32 folder}
spamd.exe

Then run this spamd.bat as a service. I have updated the Readme file so that now it explains that.


Last edited by weetabix on 2006-09-19 07:23, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Query on SA and hM
PostPosted: 2006-09-19 07:19 
New user
New user

Joined: 2005-08-22 14:33
Posts: 7
weetabix wrote:
fingers wrote:
Anyone attempted to use this Win32 non-cygwin/non-perl version of Spamassassin? http://physics.ucsd.edu/~epivovar/anti-spam.htm
... SpamAssassin for Windows (Win32), a native Windows build of spamassassin and spamd/spamc command-line tools. (Especially useful on mail servers.)...

I am trying to, i get everything working except having spamd running as a service.

it works perfect when i just start it by doubleclicking spamd.exe in the catalogue, but when i try to set it up as a service with srvany i cant get it to work.

anyone have got it working and can make a brief walkthrough?





I've been Using - XYNTService.exe and it's Working Greate Have Had it running for 2+weeks and no mem leaks etc
uses about 48mb
Code:

------Start install.bat------
@ECHO OFF
ECHO ----------------------------------
ECHO Install SpamD as a Windows Service
ECHO ----------------------------------
ECHO.
ECHO.
ECHO Make Sure you have edited
ECHO     \SA\XYNTService.ini
ECHO.
ECHO Reflecting your Drive\Folder Location of SA
ECHO.
ECHO And....
ECHO.
ECHO spamd.exe -i(Listening Network interface) 127.0.0.1 -A(Only Accept Connections From) 127.0.0.1
ECHO.
ECHO.
pause
XYNTService.exe -i
ECHO Edit the Service Properties Before Continuing...
ECHO.
ECHO ie use a user and Password "that will be allowed to logon as a Service"
ECHO Note: Make Sure it is An Existing User
ECHO.
ECHO Then, and Only Then, Continue to Run this Batch File to Start the SpamD_SVC
ECHO.
pause
XYNTService -r SpamD_SVC
------End install.bat------


Code:
XYNTService.ini
[Settings]
ServiceName = SpamD_SVC
CheckProcessSeconds = 30
[Process0]
CommandLine = C:\SA315\spamd.exe -i 127.0.0.1 -A 127.0.0.1 --syslog="C:\logs\spamd.log"
WorkingDir = C:\SA315\
UserInterface = No
Restart = Yes


Don't forget to edit the local.cf

I use.....
required_score 6.3
bayes_auto_learn 1
use_bayes 1
ok_locales all
report_safe 0
rewrite_header Subject [**ASSASSIN**]
dns_available test: [localdomain.tdl dns server]
bayes_path c:/SA315/etc/spamassassin/bayes
bayes_auto_learn_threshold_nonspam 0.05
trusted_networks 127.0.0.1


Top
 Profile  
 
 Post subject: Use Eventhandler.vbs instead of external virus scanner?
PostPosted: 2006-09-21 04:35 
New user
New user

Joined: 2006-02-10 03:17
Posts: 20
Hello,

Using this howto: I was able to get the basic spam assassin up and filtering

I continued reading down the tread and found some code for the eventhandler.vbs instead of the external virus scanner setup but it didn't seem that the author was too confident in the code at the time.

Is there some code that is accepted as good and stable for a fairly basic install of SA, I haven't tackled spamC/spamD and I still have a lot of sorting to do before I can have bayes working well.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: 2006-09-21 05:06 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
If you are referring to the code in this thread: http://www.hmailserver.com/forum/viewtopic.php?p=22643#22643 it looks like it will work ok. Just make sure that perl is in your path.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-09-21 07:00 
New user
New user

Joined: 2006-09-04 07:02
Posts: 8
Location: Brisbane, Australia
Stylus, I can vouch for GlenC on that one. I've been using it for about a month now without a single problem.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-10-18 10:59 
New user
New user

Joined: 2006-03-16 20:21
Posts: 13
Location: Belgium
martin wrote:


That does confirm my suspicion that running SA in the OnDeliverMessage makes it impossible to set a Global Rule for moving spam to the right folder...?


Top
 Profile  
 
 Post subject:
PostPosted: 2006-11-05 07:25 
New user
New user

Joined: 2006-03-20 01:41
Posts: 18
Revisting an issue with OnDeliverMessage.....

Since OnDeliverMessage checks both incoming and outgoing messages, Martin had made a suggestion to check the From header before running the spam check. However, I'm finding a lot of spam with bogus headers saying they are from the person they are trying to send to.

Is there - could there be - a message property that OnDeliverMessage could check which is which IP Range the message is coming from? That would be checking the data I am interested in, rather than trying to find a surrogate for it.

MV


Top
 Profile  
 
 Post subject:
PostPosted: 2006-11-05 10:37 
Normal user

Joined: 2005-06-03 16:14
Posts: 98
If you do a check of the received header (first line of the mail) to decide whether it is a local or externally originated mail I have found that you need to look for two possible striings:
Code:
' Received header RegEx strings For local mail
' cRecHdr1 will match any mail sent from a local source other than hMailServer
const cRecHdr1 = "(Received\: from ((\[192\.168\.1\.[0-9].*\])|hostname.|hostname) \(.(192\.168\.1\.[0-9].*|127\.0\.0\.1).\))|(Received\: from domain\.tld \(\[127\.0\.0\.1\]\))"
' cRecHdr2 will match on warning mails generated by hMailServer
const cRecHdr2 = "(Message-ID: <.*@host\.domain\.tld>)"

If it matches either of these it's local so doesn't need to get checked by SA.
HTH
--
Regards
Barry


Top
 Profile  
 
 Post subject:
PostPosted: 2006-11-05 23:30 
Normal user

Joined: 2006-05-06 18:09
Posts: 30
I wish SA was faster because I would love to do the test while the remote server is connected and reject it at that level. But it is way too slow!

Thanks for all the great info in this area.

I hope the future versions of hMail get better SA integration too.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-11-08 23:49 
Normal user

Joined: 2006-04-14 00:00
Posts: 163
I posted an article about how to integrate SpamAssassin into hMailServer without launching any external processes. This is an extremely scalable solution for busy email servers. Here is a link to the article:
http://www.howiblockspam.com/index.php? ... icle&sid=2


Top
 Profile  
 
 Post subject:
PostPosted: 2006-11-21 22:28 
Normal user

Joined: 2006-06-21 01:51
Posts: 38
Location: NYC
I was messing with this com object, does it support sending a username?

thanks
sc


Top
 Profile  
 
 Post subject: way to check and delete spam
PostPosted: 2006-11-23 09:21 
New user
New user

Joined: 2006-11-23 09:17
Posts: 1
hello everyone :-)

many thanls for all your help and all the tips supplied in this post.... i actually installed spamassassin, making it work first by the mean of the external virus scanner and the by the scripts.

my question : with the external virus scanner i could delete the mail easily, i made a rule in hmailserver to delete each taged mail.

with the scripts it is not possible if i use the ondelivermessage, the rules are not applied. so i had to put SA in the onacceptmessage, wich cause delays...

what could i do as a better solution to have the spam directly deleted?

EDIT: another problem is that i had to desactivate spamassassin check because my computer was freezing each time a large e-mail was checked....... any way to handle that ? help would be much appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-11-29 19:19 
Normal user

Joined: 2006-04-14 00:00
Posts: 163
prolifix: No, my COM object does not support sending a username. I assume you are asking about the username field because you want to do per user rules in SA. I do not set up per user rules in SpamAssassin.

I do my spam thresholds on a per user basis on the email server side, because it is much easier to manage. In our environment, we have a load balanced cluster of SA boxes. It is not really practical to maintain per user rules on each SA box and we do not want the SA boxes to need to share a MySQL instance because that would be a single pont of failure.

The most useful per user rule is the SA threshold. And that is implemented in the email server VBS script, so each user can have his/her own custom threshold.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-11-29 19:22 
Normal user

Joined: 2006-04-14 00:00
Posts: 163
remyb: Are you trying to run spamassassin on the same box as hMail? I've tried that in the past but the performance is terrible that way. You really need to set up SpamD on a separate box and then connect to it from the hMail box using TCP. This will relieve the strain on your email server. If you need even more performance, set up a load balanced cluster of SpamD boxes. When we retire old web server, we format the old boxes and set them up in our SpamD cluster. It is an excellent way to recycle old hardware.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-11-29 19:27 
Normal user

Joined: 2006-04-14 00:00
Posts: 163
schworak: I created a poll regarding how I think SA should be integrated into hMail. I think the SpamC section of the code should be integrated but NOT the main SpamAssassin or SpamD section of the code. With the SpamC code (which is extremely tiny and very effecient) integrated into hMail, it would be very easy for people to connect to SpamD instances.

Here is a link in case you have not voted on it yet:
http://www.hmailserver.com/forum/viewtopic.php?t=4268


Top
 Profile  
 
 Post subject: Per User Spam Folder
PostPosted: 2006-12-04 04:47 
Normal user

Joined: 2006-06-21 01:51
Posts: 38
Location: NYC
Since OnDeliver occurs after the global rules this script puts a rule for each user account to put spamassasin spam into "Junk Mail" imap folder. The script enforces the rules to make sure it exists.

Code:
'Stephen Cattaneo
'MT Hosting
'www.mthosting.net
'Per User Spam Folder
SpamFolder = "Junk Mail"
SpamRule = "Spam Junk Folder"
SpamDeleteRule = "Spam Delete"
SpamScore = "**********"

Set HmailCom = CreateObject("hMailServer.Application")
For Domaincnt = 0 to HmailCom.Domains.Count - 1
   Set Domain = HmailCom.Domains.Item(Domaincnt)

   For Accountcnt = 0 to Domain.Accounts.Count - 1
      Set Account = Domain.Accounts.Item(Accountcnt)
      HasRule = False
      For Rulescnt = 0 to Account.Rules.Count - 1

         If Account.Rules.item(Rulescnt).Name = SpamRule then
            'Spam Rule Exists.
            HasRule = True
         end if
      Next
         
      'Rules Does Not Exist so lets create it.
      If not HasRule Then
         Set obRule = Account.Rules.Add
         obRule.Name = SpamRule
   
         'Check Header for Score
         Set obcriteria = obRule.Criterias.Add
         obCriteria.UsePredefined = false
         obCriteria.HeaderField = "X-Spam-Level"
         obCriteria.MatchType = 2 'Contains
         obCriteria.MatchValue = SpamScore
         obCriteria.Save
         
         'Create Action
         Set obAction = obRule.Actions.Add
         obAction.Type = 4 ' Move to imap Folder
         obAction.IMAPFolder = SpamFolder
         obAction.Save
   
         'Save Rule
         obRule.Save
      End if
   Next
Next

--Updated Fixed Looping Error

_________________
MT Hosting


Last edited by mthosting on 2007-06-03 18:16, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: 2006-12-17 23:06 
New user
New user
User avatar

Joined: 2006-12-17 22:56
Posts: 1
Location: Manchester, England
I tried the above script and an error was generated in the log:

Error 800403E9 - No access to this property/method. Ensure that hMailServer.Application.Authenticate() is called with proper login credentials.

And also, the Spamassassin for Win32 seems to run so so much better than the Perl version which took ages to install, and even then it generated blank messages even after hours of tinkering with its settings.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-12-18 00:29 
Normal user

Joined: 2006-10-20 14:13
Posts: 93
Location: CZ
For anybody, who do not want to install and configure Perl or Cygwin I can recommend sawin32 (see Sourceforge). Project consists of standalone .exe files, configuration is very easy, spamd can be easily run as service using srvany.exe and instsrv.exe. I have not found any problems running this version.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-12-18 18:22 
Normal user

Joined: 2006-04-14 00:00
Posts: 163
As far as I understand it, all they did with sawin32 was tweak the Perl code a little bit and then use a Perl to EXE compiler to generate the EXE files with the Perl libraries and executable built it. It is a bloatware approach. I think it is a decent solution for small volumes of email.

For higher volumes, run SpamD on FreeBSD or Linux and connect to SpamD using spamc.exe (the one compiled using C) or my COM object. SpamAssassin was written for Unix, and it was tested for Unix. You can get it to work on Windows, but the application does not perform well on Windows. It is just not written to properly take advantage of Windows. It is really written with Unix in mind.

Additionally, the sawin32 version is not written for Windows and tweaked to get the most performance possible with Windows. The sawin32 version is just a port with some of the obvious bugs corrects and Perl compiled into it. A true Windows port could perform much better than sawin32. I have nothing against sawin32, but I would not recommend it for anybody that has to process a lot of email.


Top
 Profile  
 
 Post subject:
PostPosted: 2006-12-18 18:34 
Normal user

Joined: 2006-06-21 01:51
Posts: 38
Location: NYC
simbolo wrote:
I tried the above script and an error was generated in the log:

Error 800403E9 - No access to this property/method. Ensure that hMailServer.Application.Authenticate() is called with proper login credentials.

And also, the Spamassassin for Win32 seems to run so so much better than the Perl version which took ages to install, and even then it generated blank messages even after hours of tinkering with its settings.


Sorry I use helm so i have authentication disabled.

Add:
Code:
call hMailCom.Authenticate ("Administrator", "your-admin-password")

after:
Code:
Set HmailCom = CreateObject("hMailServer.Application")


Top
 Profile  
 
 Post subject:
PostPosted: 2007-01-03 15:38 
Normal user

Joined: 2006-10-20 14:13
Posts: 93
Location: CZ
There is new version of sawin32, which incorporates SpamAssassin 3.1.7.


Top
 Profile  
 
 Post subject: Tutorial
PostPosted: 2007-02-12 14:46 
New user
New user

Joined: 2006-03-27 16:08
Posts: 5
Hi

I have to move our mail server to a new pc and need to reinstall spamassasin. The tutorial mentioned in the how to's is no longer available.

Does anyone have a copy of the guide for me?


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-12 16:09 
Site Admin
User avatar

Joined: 2005-07-29 16:18
Posts: 13812
Location: UK
http://www.howiblockspam.com/index.php? ... icle&sid=2


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-18 10:03 
New user
New user

Joined: 2007-02-14 21:35
Posts: 21
Location: Germany
I'm using this code:
Code:
Sub OnDeliverMessage(oMessage)
   fname = oMessage.filename
   Dim infile, testfile, sh
   Dim fso
   Set fso = createobject("Scripting.FileSystemObject")
   If Not fso.fileexists(fname) then
      result.Value = 0
      Exit sub
   End If
   
   infile = fso.getabsolutepathname(fname)
   testfile = infile & ".tmp"
   fso.CopyFile infile, testfile
   Set sh = CreateObject("WScript.Shell")
   
   Dim cmd, rc
   cmd = "cmd /c perl -S -T -w d:\perl\bin\spamassassin < """ & testfile & """ > """ & infile & """"
   rc = sh.Run( cmd , 0 , TRUE)
   result.Value = 0
   fso.Deletefile testfile
   Set fso = Nothing
end sub


and it seems to actually start Spamassassin. It also generates the e-mail, BUT: I get empty headers in Outlook showing all the header-stuff in the mail-body :x

The original message begins with (faked the details):

Code:
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from rrrrr.mail.ukl.yahoo.com (rrrrr.mail.ukl.yahoo.com [217.12.12.12])
   by [email protected] (Postfix) with SMTP id 10CFF8FE6F
   for <[email protected]>; Sun, 18 Feb 2007 09:45:33 +0100 (CET)


The message generated from SA begins with (also details faked):

Code:
Return-Path: <[email protected]>

X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on home
X-Spam-Status: No, score=2.6 required=10.0 tests=AWL,MISSING_HB_SEP
   autolearn=no version=3.1.8 on home
X-Original-To: [email protected]

Delivered-To: [email protected]

Received: from rrrrr.mail.ukl.yahoo.com (rrrrr.mail.ukl.yahoo.com [217.12.12.12])

   by server2.rrrrrr.de (Postfix) with SMTP id 10CFF8FE6F

   for <[email protected]>; Sun, 18 Feb 2007 09:45:33 +0100 (CET)


There is also an empty line every second line. In fact spamassassin seems to replace a 0d0a (line break) with 0d0d0a.

I'm using the Windows-compiled version of SA. Maybe this is the reason of the Unix-style Line breaks!? But how can I fix this?

Any suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-25 19:54 
New user
New user

Joined: 2007-02-14 21:35
Posts: 21
Location: Germany
OK, now I got it. I now use the stuff from http://sawin32.sourceforge.net and it works well.

3 general SA questions:
1)
I've got c:\sawin\SpamAssassin-win32\etc\spamassassin where the local.cf is located. Are the .cf files in c:\sawin\SpamAssassin-win32\share\spamassassin loading automatically?

2)
How do I set SA to German so that the texts in 30_text_de.cf are used.

3)
I've set the update like this: sa-update.exe --nogpg --updatedir \sawin\SpamAssassin-win32\share\spamassassin\
But in this directory a \updates_spamassassin_org is created. Can't I just update to \sawin\SpamAssassin-win32\share\spamassassin\ somehow or is there a reason that the subdir is created?

Sorry - I'm a newbie to the SA :roll:

[edit]: Noone answers so I'm on myself - like allways:

1) yes

2) It's a bug in the latest version

3) The files are used, even if the foldername is "updates_spamassassin_org..."

:?


Top
 Profile  
 
 Post subject:
PostPosted: 2007-03-17 05:18 
Normal user

Joined: 2007-03-17 05:16
Posts: 43
I cannot access the how to on link number 6, does anyone have it saved on their computer or know what to do to install spam assasin from scratch, I also am trying to hunt down help installing squirlmail too.
thank you.


Top
 Profile  
 
 Post subject:
PostPosted: 2007-03-17 15:21 
Senior user
Senior user

Joined: 2004-08-17 23:31
Posts: 680
Location: Santiago, Chile
Try here for the howto: http://64.142.36.76/howtosa.html


Top
 Profile  
 
 Post subject:
PostPosted: 2007-04-23 15:48 
New user
New user

Joined: 2007-03-29 08:38
Posts: 4
I've set all of the above up and it appears to be working very well.

There is one problem though, when I check my mail through the web-interface (squirrelmail) all the e-mails have no subject and no content...
This is very weird because when I download the e-mail through POP it's all fine.

Does anybody know what could be causing this?


Top
 Profile  
 
 Post subject:
PostPosted: 2007-06-16 16:11 
Normal user
User avatar

Joined: 2007-05-04 17:31
Posts: 82
hi,

I've used a quick and excellent guide to setup Spamassassin posted by bazporter here: http://www.hmailserver.com/forum/viewto ... ight=razor

he also helped me further to set it up, below is a script I ended up with, I've setup 2 email addresses, first is to be intentionally spammed, no legitimate email ever will make it to this email address, second is for forwarding spam emails missed by Spamassassin in this setup as attachments.

Could you guys review it, and possibly I would also like to delete the emails permanently that are going to the 2 accounts, I am still not sure how to do that right...

As far as I can tell it works, however since there is no way to get the success notice out of SA-learn as far as I can tell, I tried the piping I also tried --dump, but without success, perhaps someone with SA-learn experience could show us how to get some feedback to see if learning took place?

I made some changes to capture the Debugging info and now I get this in the log:

Code:
[2192] info: config: failed to parse line, skipping: use_pyzor 0


Does anyone know what that means?

Also, I am hoping for some additional ideas and improvements if any?

Does anyone know of a sure fire way to get spam flowing to the particular email address so we can feed it to SA-learn?

Would be really great to be able to disable Spam protection in hmailserver for those 2 accounts...

Code:


      Sub OnDeliverMessage(oMessage)

oMessageSubject = oMessage.Subject

If InStr(oMessageSubject,"[SPAM]") > 0 Then exit Sub 'spam = true

'   If InStr(oMessage.To,".files") > 0 Then oMessage.Subject = "[file] " & oMessageSubject :oMessage.Save :exit sub

If oMessage.HeaderValue("X-Spam-Flag") = "YES" Then oMessage.Subject = "[SPAM] " & oMessageSubject :oMessage.Save :exit sub

   ' Use SpamC (true) or SpamAssassin (false)
   const cUseSpamC = true

   set oFSO = createObject("Scripting.FileSystemObject")
   set oWSO = createObject("WScript.Shell")

   ' Capture the message filename
   sFname = oMessage.filename

   ' Check if the input file really exists
   if not oFSO.FileExists(sFname) Then :Result.Value = 0 :exit sub

   oInfile = oFSO.GetAbsolutePathName(sFname) :oTestfile = oInfile & ".tmp" :oFSO.CopyFile oInfile, oTestfile

   ' Create command strings
   cmdSA = "cmd /c C:\SA\spamassassin --configpath=c:\sa\share\spamassassin --siteconfigpath=c:\sa\etc\spamassassin < """ & oTestfile & """ > """ & oInfile & """"
   cmdSC = "cmd /c C:\sa\spamc < """ & oTestfile & """ > """ & oInfile & """"

   cmdlearn = "cmd /c c:\SA\sa-learn.exe --username=Administrator --spam --sync " & oTestfile' & "  >> c:\logs\sa-learnspam2.log 2>&1"

   If instr(oMessage.To,"[email protected]") > 0 Then rcSA = oWSO.Run(cmdlearn , 0 , true) :oFSO.Deletefile oInfile :oFSO.Deletefile oTestfile :Result.Value = 0 :exit Sub

      If instr(oMessage.To,"[email protected]") > 0 Then

   Set atta = oMessage.Attachments

intCC = oMessage.Attachments.Count - 1

For x = 0 To intCC
Set att = atta.Item(x)

pth = "c:\tmp\" & att.Filename

att.SaveAs( pth )
cmdlearn = "cmd /c c:\SA\sa-learn.exe --username=Administrator --spam --sync --D " & pth & "  >> c:\logs\sa-learnspam.log 2>&1"
   
   rcSA = oWSO.Run(cmdlearn , 0 , true)
   oFSO.Deletefile pth

Next
exit Sub
End if


   if cUseSpamC Then rcSC = oWSO.Run(cmdSC , 0 , true) :else rcSA = oWSO.Run(cmdSA , 0 , true)' use SpamC or Run SpamAssassin

   ' Failsafe: In the event an error causes a zero byte msg
   if oFSO.GetFile(oInfile).Size = 0 Then oFSO.CopyFile oTestfile, oInfile

   oFSO.Deletefile oTestfile
   Result.Value = 0

   set oFSO = nothing
   set oWSO = Nothing

end sub


_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: 2007-06-18 00:45 
Normal user
User avatar

Joined: 2007-05-04 17:31
Posts: 82
Hi,

there is a problem...

using above script I posted before, I added a few lines to it and a new header in spamd configuration, however, the message object in script doesn't have the new headers, is there a way to re-read the email modified by spamassassin to get those headers or any other way?

I know i could construct some fso little script to read and parse the new email file saved by spamassassin but that would be resources problem...

here is the code:

Code:
'oMessage.Save
testvalue = CInt(oMessage.HeaderValue("X-Spam-Score"))

If testvalue > 6.3 Then oMessage.Subject = "[6+] " & oMessageSubject :oMessage.Save :Else :oMessage.Subject = "[6-] " & oMessageSubject :oMessage.Save



if I remarked the first line you see there the message saved is the version from before the spamassassin does it's work, so that can't be used.

currently nothing is added to the subject, I plan to set the result.value according to the score

how can we load the email into message object after spamassassin rewrote it to read the new headers?

I think perhaps creating a new sub? we can then load the message in the new sub and read headers there? will the new sub load the new message from disk?

-ark

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: 2007-07-01 15:56 
New user
New user

Joined: 2007-06-03 02:15
Posts: 4
Hello,

I have use the standard script in the thread for integrating Spamassassin into hMailServer.
I dont use the cywin version.

My problem is that tempfiles created on c:\ are not deleted...
the files look like .spamassassinxxxxxxxtmp

Am i the only one experiencing this problem?


Top
 Profile  
 
 Post subject:
PostPosted: 2007-07-01 21:14 
Site Admin
User avatar

Joined: 2005-07-29 16:18
Posts: 13812
Location: UK
Does spamassassin / hmail have modify permissions on the temp folder? If not this is why they are left behind.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 267 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next


Who is online

Users browsing this forum: No registered users and 1 guest



Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group