HOW TO: Install Spamassassin For Windows and SPAMD service

This section contains user-submitted tutorials.
User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by RvdH » 2021-10-28 09:17

coax wrote:
2021-10-24 12:02
RvdH wrote:
2021-10-23 18:20
open C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\runtime\sa-learn or C:\Program Files\JAM Software\SpamAssassin for Windows\runtime\sa-learn (note: file without extension)

Code: Select all

after line 36, add: my $LOCAL_STATE_DIR = '..\share';    # substituted at 'make' time
after line 43, add:  $LOCAL_STATE_DIR = JAM::Path::local_state_dir() || $LOCAL_STATE_DIR;
after line 243 add: LOCAL_STATE_DIR     => $LOCAL_STATE_DIR,
Thanks @RvdH, sa-learn.exe doesn't throw error anymore. How in the world did you figure that out? Comparing sa-learn from 3.4.4 vs 3.4.2 (older version I had until now), they're both same, as well as path.config's!

While we're at it, would it be possible to fix the svnunknown to show something meaningful in header X-Spam-Checker-Version: SpamAssassin 3.4.4 (svnunknown) on [MASKED]?

Edit:
Found a way to remove (svnunknown). In local.cf add line:

Code: Select all

add_header all Checker-Version SpamAssassin _VERSION_ on _HOSTNAME_
Basically i compared the ways how a debug run of sa-learn vs spamassassin itself compared and noticed the difference in how the $LOCAL_STATE_DIR expanded

I also shared my findings with the people @Jam, so maybe a fix might surface and otherwise you have a workaround :)
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

etienne2000
New user
New user
Posts: 24
Joined: 2010-07-28 18:48

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by etienne2000 » 2022-02-09 01:00

Hello,

i get somes problems to get that working. nss tell me when lauch the service that spamassassin isnt a win32 valid application.

but if i launch manually "spamd.exe" it launch proprely spamassassin (when the spamd.exe window is open, spamassassin is working on hmailserver, if i close the window it close the ap/service). Actually it doesnt too problematic, i just autolaunch spamd as an application with windows at startup and it's done.

Best Regards.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by RvdH » 2022-02-09 14:11

etienne2000 wrote:
2022-02-09 01:00
Hello,

i get somes problems to get that working. nss tell me when lauch the service that spamassassin isnt a win32 valid application.

but if i launch manually "spamd.exe" it launch proprely spamassassin (when the spamd.exe window is open, spamassassin is working on hmailserver, if i close the window it close the ap/service). Actually it doesnt too problematic, i just autolaunch spamd as an application with windows at startup and it's done.

Best Regards.
32-bit <> 64-bit issues?
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

palinka
Senior user
Senior user
Posts: 4455
Joined: 2017-09-12 17:57

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by palinka » 2022-02-09 14:17

etienne2000 wrote:
2022-02-09 01:00
Hello,

i get somes problems to get that working. nss tell me when lauch the service that spamassassin isnt a win32 valid application.

but if i launch manually "spamd.exe" it launch proprely spamassassin (when the spamd.exe window is open, spamassassin is working on hmailserver, if i close the window it close the ap/service). Actually it doesnt too problematic, i just autolaunch spamd as an application with windows at startup and it's done.

Best Regards.
https://nssm.cc/download
nssm should work under Windows 2000 or later. Specifically, Windows 7, Windows 8 and Windows 10 are supported. 32-bit and 64-bit binaries are included in the download. Most of the time it should be safe to run the 32-bit version on 64-bit Windows but in some circumstances you may find that it doesn't work and you must use the 64-bit version. Both versions are compiled from the same source code. If one works for you, use that one. If it doesn't, try the other.
Jam spamassassin is available in both 32/64 bit. But come on... its current year... 32 bit is legacy stuff...

etienne2000
New user
New user
Posts: 24
Joined: 2010-07-28 18:48

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by etienne2000 » 2022-02-11 18:53

RvdH wrote:
2022-02-09 14:11
etienne2000 wrote:
2022-02-09 01:00
Hello,

i get somes problems to get that working. nss tell me when lauch the service that spamassassin isnt a win32 valid application.

but if i launch manually "spamd.exe" it launch proprely spamassassin (when the spamd.exe window is open, spamassassin is working on hmailserver, if i close the window it close the ap/service). Actually it doesnt too problematic, i just autolaunch spamd as an application with windows at startup and it's done.

Best Regards.
32-bit <> 64-bit issues?
Both (Nssm & Spam Assassin) running in 64-bit . i will install 32 bit and see if working.

etienne2000
New user
New user
Posts: 24
Joined: 2010-07-28 18:48

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by etienne2000 » 2022-02-11 19:51

It inst working. the fisrt start of nssm goes well. i stop the service for update spamassassin (net stop spamassassin) and when i want to launch spamassassin (net start spamassassin" i get that:

Image

I see nssm after service installation place a file under C: nammed "Program". If i delete it, spamassassin service start itself without problem and i dont get this error.

NOTE: I have does somes test and i get this problems if i stop the service before restart the computer (it's not specified that you cant does this). If i stop the service just after installing with nssm, i cant restart the service and an "Program" file pop up in C:/ and when restart windows, i get an error message. If delete the file, start working correctly. If Install with nssm and after, restart windows, i didnt get this problem. very odd.
Last edited by etienne2000 on 2022-02-11 20:14, edited 1 time in total.

palinka
Senior user
Senior user
Posts: 4455
Joined: 2017-09-12 17:57

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by palinka » 2022-02-11 20:11

etienne2000 wrote:
2022-02-11 19:51
I see nssm after service installation place a file under C: nammed "Program". If i delete it, spamassassin service start itself without problem and i dont get this error.
I'm guessing you didn't wrap a path in "quotes".

etienne2000
New user
New user
Posts: 24
Joined: 2010-07-28 18:48

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by etienne2000 » 2022-02-11 20:19

palinka wrote:
2022-02-11 20:11
etienne2000 wrote:
2022-02-11 19:51
I see nssm after service installation place a file under C: nammed "Program". If i delete it, spamassassin service start itself without problem and i dont get this error.
I'm guessing you didn't wrap a path in "quotes".
I used the GUI version, so it's not possible to add a wrong path for the installation because i use the explorer for get the program to launch.

I have updated my last post for a "possible" problem. Because after install, service it working and if i stop the service before i restart my computer, it does that problem with the "Program" file in C:/ and failure to stard service. If i restart my computer before stop the service (just after the installation with nssm) for update spamassassin i dont get this error.

palinka
Senior user
Senior user
Posts: 4455
Joined: 2017-09-12 17:57

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by palinka » 2022-02-11 20:28

etienne2000 wrote:
2022-02-11 20:19
I used the GUI version, so it's not possible to add a wrong path for the installation because i use the explorer for get the program to launch.
Just because a dialogue box doesn't give you quotes in the path doesn't mean you don't need them.

There's very little doubt that C:\Program is a portion of an un-quote-enclosed C:\Program Files\etc.. Spaces matter!

etienne2000
New user
New user
Posts: 24
Joined: 2010-07-28 18:48

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by etienne2000 » 2022-02-11 20:37

palinka wrote:
2022-02-11 20:28
etienne2000 wrote:
2022-02-11 20:19
I used the GUI version, so it's not possible to add a wrong path for the installation because i use the explorer for get the program to launch.
Just because a dialogue box doesn't give you quotes in the path doesn't mean you don't need them.

There's very little doubt that C:\Program is a portion of an un-quote-enclosed C:\Program Files\etc.. Spaces matter!

It's a possibility, but it's still strange that on all the installation tests (4), I had this problem only with the two installations where I stopped the service before reboot the computer.

But now it working fine :)

(The computer running hmailserver and spammassassin is on a virtualbox)

ilpanos
New user
New user
Posts: 10
Joined: 2017-12-12 14:52

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by ilpanos » 2022-03-17 14:54

Hello,
Followed the tutorial (thank you very much btw) but I cannot find the file UpdateChannels.txt
I installed spamassassin 3.4.4 x64

palinka
Senior user
Senior user
Posts: 4455
Joined: 2017-09-12 17:57

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by palinka » 2022-03-17 19:01

ilpanos wrote:
2022-03-17 14:54
Hello,
Followed the tutorial (thank you very much btw) but I cannot find the file UpdateChannels.txt
I installed spamassassin 3.4.4 x64
Use this:

Code: Select all

-v --nogpg --channel updates.spamassassin.org

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by SorenR » 2022-03-17 19:36

palinka wrote:
2022-02-11 20:28
etienne2000 wrote:
2022-02-11 20:19
I used the GUI version, so it's not possible to add a wrong path for the installation because i use the explorer for get the program to launch.
Just because a dialogue box doesn't give you quotes in the path doesn't mean you don't need them.

There's very little doubt that C:\Program is a portion of an un-quote-enclosed C:\Program Files\etc.. Spaces matter!
A Danish windows will have "C:\Programmer" where you have "C:\Program Files" :wink:
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by RvdH » 2022-04-16 09:57

FYI, default SpamAssassin distribution for SpamAssassin 3.4.4 and UP has "20_aux_tlds.cf" in \etc\spamassassin, seems the guys at JAM leaved that out causing the registryboundaries: no tlds defined, need to run sa-update errors. So instead of the changes described here, simply putting "20_aux_tlds.cf" in \etc\spamassassin whould solve this error as well
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

comp1mp
Normal user
Normal user
Posts: 36
Joined: 2013-11-26 03:51

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by comp1mp » 2023-03-26 18:40

RvdH wrote:
2022-04-16 09:57
FYI, default SpamAssassin distribution for SpamAssassin 3.4.4 and UP has "20_aux_tlds.cf" in \etc\spamassassin, seems the guys at JAM leaved that out causing the registryboundaries: no tlds defined, need to run sa-update errors. So instead of the changes described here, simply putting "20_aux_tlds.cf" in \etc\spamassassin whould solve this error as well
Do we copy the "20_aux_tlds.cf" file from {SpamAssassinInstallDir}\share\3.004004\updates_spamassassin_org or do we just create an empty file by that name?

Thanks,
Matthew

User avatar
jimimaseye
Moderator
Moderator
Posts: 10053
Joined: 2011-09-08 17:48

Re: HOW TO: Install Spamassassin For Windows and SPAMD service

Post by jimimaseye » 2023-03-26 20:28

comp1mp wrote:
2023-03-26 18:40
RvdH wrote:
2022-04-16 09:57
FYI, default SpamAssassin distribution for SpamAssassin 3.4.4 and UP has "20_aux_tlds.cf" in \etc\spamassassin, seems the guys at JAM leaved that out causing the registryboundaries: no tlds defined, need to run sa-update errors. So instead of the changes described here, simply putting "20_aux_tlds.cf" in \etc\spamassassin whould solve this error as well
Do we copy the "20_aux_tlds.cf" file from {SpamAssassinInstallDir}\share\3.004004\updates_spamassassin_org or do we just create an empty file by that name?

Thanks,
Matthew
You need that actual file. It contains rules/definitions in it that are being referred to.
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

Post Reply