HOWTO: Use ASSP with hMailServer

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

HOWTO: Use ASSP with hMailServer

Post by TheAngryPenguin » 2005-05-25 03:06

Image
HOWTO

<DISCLAIMER>This is a work in progress. Feel free to post your comments and recommend changes. To somewhat simplify things for new users, I've been considering creating a preconfigured hMS/ASSP package. At any rate, here it goes. Hope you enjoy the ride...</DISCLAIMER>

Download and install ActivePerl, version 5.6.1.638 -- in my experience, version 5.8.7.813 was unstable and kept on crashing. Grab the MSI package - registration is not required. During its install, select all defaults.

From Start>Programs>ActiveState Active Perl..., launch the "Perl Package Manager" and execute the following command:

Code: Select all

install http://www.roth.net/perl/packages/win32-daemon.ppd
Download and extract the ASSP package to C:\ASSP

Create the following directories:

Code: Select all

C:\ASSP\errors
C:\ASSP\errors\spam
C:\ASSP\errors\notspam
C:\ASSP\notspam
C:\ASSP\spam
Create the following files:

Code: Select all

C:\ASSP\spamdb.bak
C:\ASSP\eicar.db
Leave spamdb.bak empty, and in eicar.db, insert the following single line:

Code: Select all

Eicar-Test-Signature=58354f2150254041505b345c505a58353428505e2937434329377d2445494341522d5354414e444152442d414e544956495255532d544553542d46494c452124482b482a
Download WGET for Windows and extract wget.exe to your Windows directory.

Open C:\ASSP\assp.pl in your favorite text editor and change the line:

Code: Select all

[AsAService,'As a Service',0,checkbox,'0','(\S*)',undef,
to:

Code: Select all

[AsAService,'As a Service',0,checkbox,'1','(\S*)',undef,
Add ASSP as a Windows Service by opening a command prompt and changing directory to C:\ASSP. Then execute the following command:

Code: Select all

perl addservice.pl -i C:\ASSP\assp.pl C:\ASSP
Next, start the ASSP service with the following command:

Code: Select all

perl addservice.pl -s
Point your web browser to http://127.0.0.1:55555 -- The default password is 'nospam4me'

Configure away! Here are some directives I would recommend changing:

Network Setup
SMTP destination: 127.0.0.1:125 (Note: change hMailServer's SMTP service to listen on port 125 prior to commiting this change)
(Leave everything else at their defaults, or deselected/blank)
Listen Port: 25


SPAM Control
Add Spam Probability Header?: [Selected]
Add Spam Header?: [Selected]
Use Subject as Maillog Names: [Selected]
(Leave everything else at their defaults, or deselected/blank)

Whitelist Options
(Leave everything at their defaults, or deselected/blank)

Relaying
Local Domains: yourdomain.com|yourotherdomain.com
(Leave everything else at their defaults, or deselected/blank)

Validate Recipients
No-Valid-User Reply: 250 OK - Recipient <EMAILADDRESS>
Validate recipient addresses to conform with RFC 822: [Deselect, or install Email::Valid]
Do LDAP lookup for valid recipients: [Deselect]
{All other LDAP Options} [BLANK OUT]

SPF Options
(Leave everything at thei r defaults, or deselected/blank)

RBL Options
(Leave everything at their defaults, or deselected/blank)

Virus Control
List of Anti-virus Signature Database Files: main.db,daily.db,eicar.db
(Leave everything else at their defaults, or deselected/blank)

Spam Bombs & Scripting
(Leave everything else at their defaults, or deselected/blank)

TestMode Options
(Put everything into Test Mode)
Prepend Spam Subject: [SPAM]

Email Interface
Report Spam Address: spam
Report not-Spam Address: notspam
Add to Whitelist Address: whitelist
From Address for Email: ASSP <postmaster@yourdomain.com>

File Paths
PID File: [BLANK OUT]
(Leave everything else at their defaults, or deselected/blank)

Logging
Roll the Logfile How Often?: 1
(Leave everything else at their defaults, or deselected/blank)

Security
Web Admin Password: <CHANGE PASSWORD>
(Leave everything else at their defaults, or deselected/blank)

Other Settings
(Leave everything else at their defaults, or deselected/blank)


The next step is to collect at least a few thousand SPAM and non-SPAM messages. This will occur automatically and all messages will initially be placed into C:\ASSP\spam. You will need to manually move all misclassified non-SPAM messages into C:\ASSP\notspam. Once you have accumulated a good sample of both good and bad messages, run the 'rebuildspamdb.pl' script. The more often you do this during the testing stage, the more accurate it will become.

Eventually you should schedule the 'rebuildspamdb.pl' to run automatically once or twice every day, preferably at a time when your mail server is less active -- the script will consume many CPU cycles, and depending on how fast your system is and the amount of messages it has to analyze, this could take many minutes. Also, it would be a good idea to schedule freshclam.bat to look for updates regularly (no more often than once every hour is highly advised). You can accomplish both of these as scheduled tasks -- for freshclam's scheduled task, go into the advanced settings, have the task repeat (no more than once) every hour, and set the duration to 23 hours and 59 minutes.

Once you're confident that ASSP is well-tuned, your last step is to take it out of "Test Mode" and introduce it to your users. More information about this can be found in ASSP's online documentation, which would be good to review during the testing period.
Last edited by TheAngryPenguin on 2005-07-06 20:40, edited 5 times in total.

cmurphy54
Senior user
Senior user
Posts: 550
Joined: 2004-09-25 22:11
Location: Atlanta, GA
Contact:

Post by cmurphy54 » 2005-05-25 16:45

Nice tutorial. Since there is already an existing ASSP tutorial perhaps it would be good to integrate whatever steps/changes you think are necessary (particularly with using the anti-virus scanning) with that tutorial (Users might not think to look in the forum given that the other tutorial exists).

On a side note, I do my virus scanning from hMailServer as opposed to using ASSP (whereas this tutorial has ASSP do the scanning). Has anyone tested to see which method is more efficient?

cmurphy54
Senior user
Senior user
Posts: 550
Joined: 2004-09-25 22:11
Location: Atlanta, GA
Contact:

Post by cmurphy54 » 2005-05-25 16:50

Also, I think

"your last step is to take it out of 'Test Mode' and introduce it to your users. At this point, you may wish to prepend the subject with something like [SPAM]."

is somewhat unclear as you can't take it out of Test Mode AND prepend the subject with [SPAM], it's one or the other. When not in test mode, spam doesn't get delivered to the target user.

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-05-26 07:08

Thanks for the replies. I almost forgot about the ASSP tutorial. And thanks for pointing out the prepending [SPAM] issue. I intended to subdivide the testing stage into a blind gathering process, and a user-supported teaching process where misidentifed messages, both good and bad, could be forwarded to the appropriate drop. I'll make these changes in the near-future...

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-07-06 20:41

The OP has been updated.

Jmackay
New user
New user
Posts: 8
Joined: 2005-06-27 08:41

Post by Jmackay » 2005-07-08 00:53

How do I uninstall the service? I'm using the newest version of perl too, should I swap back to 5.6?

When I try to start the service it gives me a 1053: The service did not respond... error. If I start it from the command line, no error but it doesn't start up either.

Any ideas on what I can do?

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-07-08 01:33

Jmackay wrote:How do I uninstall the service? I'm using the newest version of perl too, should I swap back to 5.6?

Code: Select all

"Usage:
  perl addservice.pl -i c:\\assp\\assp.pl   installs at location specified
                                          (base is assumed to be c:\\assp)
  perl addservice.pl -i c:\\assp\\assp.pl c:\\assp  -- installs the program and base
  perl addservice.pl -s                   starts the ASSP service
  perl addservice.pl -u                   uninstalls the ASSP service

Note that you must start the service after you install it, and that you must
stop it before you uninstall it. You can do this from the service control
manager.
";
If you have the patience, stick with the Perl you currently have installed. If ASSP beings to become unreliable, try downgrading. My experience may have been isolated.
Jmackay wrote:When I try to start the service it gives me a 1053: The service did not respond... error. If I start it from the command line, no error but it doesn't start up either.

Any ideas on what I can do?
Are you sure you installed the service properly? I just notice that the above code and my instructions are slightly different. Try:

Code: Select all

perl addservice.pl -i C:\\ASSP\\assp.pl C:\\ASSP
...and let me know if it works -- if so, I'll update the HOWTO.

Jmackay
New user
New user
Posts: 8
Joined: 2005-06-27 08:41

Post by Jmackay » 2005-07-08 02:24

yeah I tried the -u, but it doesn't do anything :S, the service still shows up in the Services list :(. Is there a way to manually remove it?

I'll try the double \ thing in a second and let you know if it works :)

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-07-08 03:22

The -u should do it. Is there any error message reported when it fails? Are you doing this from a command prompt that CD'd into the ASSP directory? One thing to possibly note is that you may need to close and reopen the Services console to actually see the service appear/disappear. You might want to make sure that Services console is closed before performing these commands. Finally, are you certain that win32-daemon.ppd was proprely installed into your Perl environment? If in doubt, try reinstalling it.

Jmackay
New user
New user
Posts: 8
Joined: 2005-06-27 08:41

Post by Jmackay » 2005-07-08 03:33

Hmm maybe it is a problem with the win daemon, how would I reinstall it? I just tried to install it and it said it was installed, but I think it was installed when we had version 5.6 instead of .8 on the server.

Doing -u with the services closed did nothing, and reported no error. When I tried to install it with the double \\ I don't think it worked as again, the copy in the services showed only single \'s.

Thanks for the help so far :)

Jmackay
New user
New user
Posts: 8
Joined: 2005-06-27 08:41

Post by Jmackay » 2005-07-08 03:52

Arg!

Ok I think I figured it out. The old version of Perl didn't uninstall correctly and it was still being used as the target for the daemon install, I made sure both were uninstalled and then reinstalled everything and atleast thats working now lol.

Now to get the spam filter working :)

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-07-08 05:34

Good to hear. I hope it works out for you.

Jmackay
New user
New user
Posts: 8
Joined: 2005-06-27 08:41

Post by Jmackay » 2005-07-08 07:06

Ok, its not picking up any emails, so I checked the maillog.txt file and found this error:

Couldn't create server socket on port '25' -- maybe another service is running or I'm not root (uid=0)?

Do I need to change any of the settings in hmail or would this be something I need to change in assp?

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-07-08 14:53

Network Setup
SMTP destination: 127.0.0.1:125 (Note: change hMailServer's SMTP service to listen on port 125 prior to commiting this change)
(Leave everything else at their defaults, or deselected/blank)
Listen Port: 25

srand
Normal user
Normal user
Posts: 103
Joined: 2005-04-12 22:46
Location: Dublin, Ireland
Contact:

Post by srand » 2005-08-06 00:53

Hi Guys..

It seems like I'm having this problem now..

I do have the daemon installed however and everything else seems to be in order..

Service installs fine and shows up on the services list, but fails with error 1053 when I try to start.. Anyone else found the win32-daemon not to be the problem?

Perhaps its just too late and I've been setting up the server all day..??!

Thanks for all the tutorials and help on this by the way..

srand
Normal user
Normal user
Posts: 103
Joined: 2005-04-12 22:46
Location: Dublin, Ireland
Contact:

Post by srand » 2005-08-06 00:56

Also meant to mention that this is the error from the window event log:

"Timeout (30000 milliseconds) waiting for the Anti-Spam Smtp Proxy service to connect."

srand
Normal user
Normal user
Posts: 103
Joined: 2005-04-12 22:46
Location: Dublin, Ireland
Contact:

Post by srand » 2005-08-06 01:05

ok stupid problem.. working on the machine with remote desktop and it entered a corrupt character in the assp.pl file, its fixed now.. sorry for posting in this forum in the first place - I intended to post in the thread on the general forum.. moderator you can delete my three posts here.. sorry..

kpm547
New user
New user
Posts: 23
Joined: 2005-10-08 05:37

Post by kpm547 » 2005-10-08 16:44

Has anyone been able to get squirrelmail, hmail and assp to work together?

I had squirrelmail and hmail working together just perfect. Then I installed ASSP as per this HOWTO. It works great with hmail. I can send and receive perfectly from a Thunderbird. But I can't send mail using squirrelmail. I can receive, but not send.

It says the server returned: "500 relaying not allowed"

This leads me to believe that the settings for relaying in assp need to be changed, but I don't know what to change them to.

Anyone have any ideas?

User avatar
Bram
Senior user
Senior user
Posts: 417
Joined: 2004-05-24 22:57
Location: The Netherlands
Contact:

Post by Bram » 2005-10-10 08:17

in assp there is an option "Accept All Mail". You should add the ip form your server wich is running squirrelmail (or 127.0.0.1 if you set squirellmail to use this server)

jnolan
New user
New user
Posts: 12
Joined: 2005-10-22 17:12

Post by jnolan » 2005-11-08 14:58

It is required that Perl be installed as a service? I'm unable to download the daemon from http://www.roth.net.

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-11-08 18:03

It is not required that one daemonize the ASSP perl script. However, it is recommended because it is much easier to manage and apparently performs better.

koumdros
Normal user
Normal user
Posts: 78
Joined: 2005-11-10 01:20

Post by koumdros » 2005-11-13 13:01

Reading the ASSP documentation i see they propose a different use of the "test" mehanicm. They propsoe when you get the system out of test you should either deselect "test mode" OR start prependign messages with [SPAM].

In contrast you propose we prepend messages with [SPAM] WHEN in test mode and then taking that out when not in test mode anymore ( as it would be a null case in anymater as spam doens not even get delivered...).

am i right?

more so.. do any of you think that droping out all mail suspected as spam is too exreme? wouldnt it be better to have the subject prpepened wit something like SPAM and have it deleivered to the user so he can check out his mails and see if anything categorised as spam is in fact not?

koumdros
Normal user
Normal user
Posts: 78
Joined: 2005-11-10 01:20

Post by koumdros » 2005-11-13 13:03

I'm also wondering ....what;s the use of all these settings in ASSP

Add Spam Probability Header?
Adds a line to the email header "X-Assp-Spam-Prob: 0.0123" Probs range from 0 to +1 where > 0.6 = spam.

Block Outgoing Spam-Prob header?
Check this box if you don't want your X-Assp-Spam-Prob header on external mail
Note this means mail from local users to local users will also be missing the header.

Add Spam Header?
Adds a line to the email header "X-Assp-Spam: YES" if the message is spam.



if eventually spam mail doesn not get delivered and is cut off?
are they essentially used only in test phase?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-11-13 13:13

My guess is that they are only usable in test phase. If you delete the messages, it shouldn't matter whether they contain a specific header.

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-11-13 18:20

koumdros wrote:Reading the ASSP documentation i see they propose a different use of the "test" mehanicm. They propsoe when you get the system out of test you should either deselect "test mode" OR start prependign messages with [SPAM].

In contrast you propose we prepend subjects with [SPAM] WHEN in test mode and then taking that out when not in test mode anymore ( as it would be a null case in anymater as spam doens not even get delivered...).

am i right?
Once you take ASSP out of test mode, ASSP itself will 550 all messages that it considers SPAM, so the need prepend messages with [SPAM] is no longer relevant. I recommend prepending the subject while in test mode because doing so makes it easier to distinguish how well ASSP is working. Besides, not all mail clients can use rules based on x-headers.
koumdros wrote:more so.. do any of you think that droping out all mail suspected as spam is too exreme? wouldnt it be better to have the subject prpepened wit something like SPAM and have it deleivered to the user so he can check out his mails and see if anything categorised as spam is in fact not?
Some do indeed feel that this behaviour is too extreme and end up leaving ASSP in test mode indefinitely. It's all about what best suits your environment.

koumdros
Normal user
Normal user
Posts: 78
Joined: 2005-11-10 01:20

Post by koumdros » 2005-11-14 16:49

TheAngryPenguin wrote: Some do indeed feel that this behaviour is too extreme and end up leaving ASSP in test mode indefinitely. It's all about what best suits your environment.
For the momment I think I'll implement a very long testing process, around 2-3 months and if the ham rejection quota falls very low I'll probably turn to "normal" mode. We'll see.

iprat
Normal user
Normal user
Posts: 247
Joined: 2005-05-20 16:50
Location: Barcelona, EU
Contact:

High success in ASSP and incredibly easy install

Post by iprat » 2005-11-14 18:26

Hi everyone and specially TheAngryPenguin:

I would like to advise that I have found an incredibly easy way to install ASSP, nearly ready against dummy users.

I have found that page of "Anderson IT Solutions":

http://www.andersonit.com/assp.html

These people have build an installer for Win32, it's here (clamav told me it was virus free):

http://www.andersonit.com/assp/ASSP1.1.0%20Win32.exe

The installer is extremely easy, just run it and let install default options, except the last step wich wishes to install a helper or assistant to connect with exchange. I did not install that option because I am a very satisfied hMailServer user ;)

1 ) I suggest that first set hmailserver to listen SMTP at port 125.

2 ) Run the installer which installs automatically Perl 5.8.1.807 (wich in my case has been "not any issue"), installs the services for running ASSP as a service, installs ASSP 1.1.0, and configures ASSP as a service.

3 ) You can ignore/unselect/cancel the last stage of the installer wich I deduced that was a helper for microsoft exchange mail server.

4 ) From the server run http://localhost:55555 and give the user you want with password "nospam4me"

5 ) Configure ASSP as TheAngryPenguin has decribed.

6 ) I would encourage to imediatly update ASSP to version 1.1.1 or 1.1.2b1 (wich I am currently using with great success 0 spam !).

7 ) Let some days of training of ASSP and after a week with 1.1.2b1 I have 0 Spam getting through and 0 false positives in 72h (I have a small server with 150 emails a day). :D

8 ) Enjoy the team HMS, ASSP, SOSDG clamav for Win32. Consider donating to all of them. ;)

Zeus
Normal user
Normal user
Posts: 62
Joined: 2004-01-27 16:59
Location: Chicagoland
Contact:

Post by Zeus » 2005-11-26 09:16

TheAngryPenguin - Great Tutorial, worked like a charm
JPrat - Thanks for the update with the install. I tried it the AngryPenguin way on one server, and your way on another!

Z

User avatar
Bingo
Normal user
Normal user
Posts: 92
Joined: 2005-01-27 11:43

Post by Bingo » 2005-11-28 16:17

Great How-To, thanks !
I have some questions before installing though, regarding the learning phase : the documentation mentions a "spam" and "not-spam" folder, and states that the administrator should move emails between these folders before telling ASSP to relearn. IS this process exactly equivalent to the users' provided feedback ?
I don't want to go everyday on my server to do this, I would rather only have my users report Spam / NotSpam, and telling the DB to rebuild once a day.
Am I right to assume that doing this is enough to teach ASSP ?

iprat
Normal user
Normal user
Posts: 247
Joined: 2005-05-20 16:50
Location: Barcelona, EU
Contact:

Post by iprat » 2005-11-28 19:13

It's enough but no exactly the same results.

Messages submited by users get into /error/spam or /error/nospam folders and are considered more important than /spam and /nospam because they are errors.

This will work, and in fact is the usual way to work after initial training.

I would highly recommend doing the manual inspection by administrator during the first days of operation to improve the learning curve of ASSP, and the quality of the /spam and /nospam databases.

It will work in either way but the databases and thereafter the results of bayesian filters will be better with special care during the first days. How many days? Well I had to pay special attention during the first week (15 minutes each day), after that I just spent 5 minutes each day during another week, because there were much less errors. Now I have a look maybe once a month, but I could probably avoid doing my personal filtering nowadays (it's just that I like to have a look at those things that happen on my server from time to time ;) ).
My perfect combination:
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)

User avatar
Bingo
Normal user
Normal user
Posts: 92
Joined: 2005-01-27 11:43

Post by Bingo » 2005-11-28 19:19

Ok thanks for the answer !
I also posted on sourceforge and got the same answer !
The poster pointed out that emails forwarded by Outlook in "inline" mode where not properly handled by ASSP'semail interface. Do some of you have any feedback to provide on this issue ?

iprat
Normal user
Normal user
Posts: 247
Joined: 2005-05-20 16:50
Location: Barcelona, EU
Contact:

Post by iprat » 2005-11-28 20:14

We simply email to spam@mydomain.com or notspam@mydomain.com or whitelist@mydomain.com.

This is universally compatible. No issues with Outlook so far.
My perfect combination:
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)

User avatar
Bingo
Normal user
Normal user
Posts: 92
Joined: 2005-01-27 11:43

Post by Bingo » 2005-11-29 15:45

iprat wrote:We simply email to spam@mydomain.com or notspam@mydomain.com or whitelist@mydomain.com.

This is universally compatible. No issues with Outlook so far.
You mean that you "forward" messages to those addresses ?

If I quote the message I got on ASSP's forum :
I will note that, at least mith Microsoft Mail Applications, you need to forward the message as an attachment to the email interfaces, rather than as a quoted forward. And they need to be send one at a time. Otherwise, the "matching" portion of RebuildSpamDB that would delete the "wrong" copy won't match, because the messsages will be different.

This is problematic with Outlook, since the only time Outlook sends as an attachment is when you select multiple messages and select forward, or when you use VB Code to send a message.
Have you witnessed that the copy of the false positive (or negative) message stored in the notspam (or spam) folder was removed when you forwarded the message to ASSP's email interface ?

Sorry to insist on that, but I'd like to know where I'm going before I start installing ASSP. :)

]Pablo[
New user
New user
Posts: 13
Joined: 2005-09-11 12:28
Location: Bologna, Italy
Contact:

ASSP - SMTP port

Post by ]Pablo[ » 2005-11-30 18:40

Hello,
thanks for hMailServer, to developers and community :D

I followed the howto and all seems to work fine exept for the following:
Network Setup
SMTP destination: 127.0.0.1:125 (Note: change hMailServer's SMTP service to listen on port 125 prior to commiting this change)
(Leave everything else at their defaults, or deselected/blank)
Listen Port: 25
Changing the SMTP port of hMailServer from 25 to 125 results in a blocking of all ASP and ASP.net scripts that send email by CDO component; when using this component one has to configure the port and other parameters. I would like to use ASSP avoiding that all the scripts on the server have to be updated (changing the SMTP port for the CDO email sending).

Any idea?

And more:
I'm using hMailServer 4.1.1 and I can find the SMTP port in two places:
1) Settings -> Protocols -> SMTP -> Email sending -> TCP port
and
2) Settings -> Protocols -> SMTP -> Advanced -> TCP port -> SMTP port
Which one should I change to 125?

Thanks a lot!

Bye,
Paolo

iprat
Normal user
Normal user
Posts: 247
Joined: 2005-05-20 16:50
Location: Barcelona, EU
Contact:

Post by iprat » 2005-11-30 19:03

That's for Bingo:

I'm sorry I missed your message.

Well I told my users to send the email as an attachement. But with Outlook Express this is reasonably easy.

Anyway if you manage to make a button for Outlook or Outlook Express to send selected messages automatically to spam or notspam as an atachement, I would greatly apreciate it.
My perfect combination:
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)

User avatar
Bingo
Normal user
Normal user
Posts: 92
Joined: 2005-01-27 11:43

Re: ASSP - SMTP port

Post by Bingo » 2005-12-01 13:26

]Pablo[ wrote:Changing the SMTP port of hMailServer from 25 to 125 results in a blocking of all ASP and ASP.net scripts that send email by CDO component; when using this component one has to configure the port and other parameters. I would like to use ASSP avoiding that all the scripts on the server have to be updated (changing the SMTP port for the CDO email sending).
If you configure ASSP to allow your ASP.NET server to send email, you should not have to change anything. You will send emails through ASSP's port 25, and ASSP will relay them to hMailServer's port 25.
Sending emails from a script using CDO is no different than sending emails from you r desktop wih Outlook. If you don't change anything in your outlook configuration, don't change anything in your CDO configuration.

Note, though, that if your hMailServer was specially configured to accept emails from your ASP server, you should also configure ASSP to accept emails from this server. This depends on your configuration though, I cannot tell you what should be chaged if you don't give more details on your configuration (ASP and hMailServer on same machine ? localhost allowed to relay ? etc...)
I'm using hMailServer 4.1.1 and I can find the SMTP port in two places:
1) Settings -> Protocols -> SMTP -> Email sending -> TCP port
and
2) Settings -> Protocols -> SMTP -> Advanced -> TCP port -> SMTP port
Which one should I change to 125?
I think that the first one is the smtp port of the smtp relay, if you use another smtp server to relay your emails.
The one you have to change is the second one.

iprat wrote:Well I told my users to send the email as an attachement. But with Outlook Express this is reasonably easy.
Anyway if you manage to make a button for Outlook or Outlook Express to send selected messages automatically to spam or notspam as an atachement, I would greatly apreciate it.
Yes, I wrote some code (inspired from code posted on ASSP's forum), but since you can't send emails in VBA with Outlook (because of the infamous Outlook Security Update), I had to use a 3rd party DLL (Redemption DLL, free for developping purposes, very expensive for redistribution).

Here it is, you just need to create two buttons and assign the 'IsSpam' macro to one, and the 'IsNotSpam' macro to the other one.
Select multiple message and clic the button : they will be forwarded separately as attachments to ASSP's email interface.
Redemption DLL can be found HERE.

Code: Select all

Sub IsSpam()
    Dim objOL As Outlook.Application
    Dim objSelection As Outlook.Selection
    Dim objMsg As Object
    Dim objNewMsg As Outlook.MailItem
    Dim objSafeMsg As Redemption.SafeMailItem
     
    On Error Resume Next
    
    Set objOL = CreateObject("Outlook.Application")
    Set objSelection = objOL.ActiveExplorer.Selection
     
    For Each objMsg In objSelection
        If objMsg.Class = olMail Then
            Set objNewMsg = Application.CreateItem(olMailItem)
            Set objSafeMsg = New Redemption.SafeMailItem
            objNewMsg.To = "assp-spam@mydomain.tld"
            objNewMsg.Subject = objMsg.Subject
            objNewMsg.Save
            objNewMsg.Attachments.Add objMsg
            objNewMsg.Save
            objSafeMsg.Item = objNewMsg
            objSafeMsg.Send
            objNewMsg.Delete
            Set objNewMsg = Nothing
            Set objSafeMsg = Nothing
        End If
    Next objMsg
    
    SendAndReceive
    
    Set objMsg = Nothing
    Set objSelection = Nothing
    Set objOL = Nothing

End Sub

Sub IsNotSpam()
    Dim objOL As Outlook.Application
    Dim objSelection As Outlook.Selection
    Dim objMsg As Object
    Dim objNewMsg As Outlook.MailItem
    Dim objSafeMsg As Redemption.SafeMailItem
     
    On Error Resume Next
    
    Set objOL = CreateObject("Outlook.Application")
    Set objSelection = objOL.ActiveExplorer.Selection
     
    For Each objMsg In objSelection
        If objMsg.Class = olMail Then
            Set objNewMsg = Application.CreateItem(olMailItem)
            Set objSafeMsg = New Redemption.SafeMailItem
            objNewMsg.To = "assp-notspam@mydomain.tld"
            objNewMsg.Subject = objMsg.Subject
            objNewMsg.Save
            objNewMsg.Attachments.Add objMsg
            objNewMsg.Save
            objSafeMsg.Item = objNewMsg
            objSafeMsg.Send
            objNewMsg.Delete
            Set objNewMsg = Nothing
            Set objSafeMsg = Nothing
        End If
    Next objMsg
    
    SendAndReceive
    
    Set objMsg = Nothing
    Set objSelection = Nothing
    Set objOL = Nothing

End Sub

Sub SendAndReceive()
    Dim oBtn As CommandBarButton
    Set oBtn = Application.ActiveExplorer.CommandBars.FindControl(1, 5488)
    oBtn.Execute
    Set oBtn = Nothing
End Sub

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Cant connect

Post by dennism » 2005-12-01 22:06

After installing ASSP which listening on port 25, I have changed hmailservers SMTP to listning at port 125.
After this I restarted hmailserver, and tried to send a email with the server. But Outlook tells me, that it couldn't connect to the server.

Do anybody have a solution on this problem?

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-12-01 22:09

You will have to restart ASSP since hMS was already bound to port 25. You should have changed hMS' port to 125 first, then changed ASSP's port to 25 and restart both of 'em...

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Post by dennism » 2005-12-01 22:12

Oki - but how can I restart ASSP?

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Post by dennism » 2005-12-01 22:17

It is installed as a service - i just restarted it, and now it seems to work :) Thanks.

stefsegers
Normal user
Normal user
Posts: 137
Joined: 2005-05-26 23:26
Contact:

Post by stefsegers » 2005-12-02 21:18

Hi All,

I was wondering how to config ASSP so that all mails that all local domains are sending are whitelisted and put in NOSPAM. All incomming mails don't go in NOTSPAM?
The problem is that I still get about 500 spam mails a week!!!!

I did the tutorial described up here but still nothing worked.

I have to review my SPAM/NOSPAM dirs every week and that is too much work.

I tried the help from ASSP but it doesn't describe very good what to do.

Hope to hear soon

Stef

User avatar
TheAngryPenguin
Senior user
Senior user
Posts: 341
Joined: 2004-10-11 20:51

Post by TheAngryPenguin » 2005-12-03 00:04

stefsegers wrote:I was wondering how to config ASSP so that all mails that all local domains are sending are whitelisted and put in NOSPAM.
Fisrt off, "mails" are never whitelisted -- e-mail addresses are. ASSP is designed in such a way that all e-mail addresses your domain(s) send messages to are automatically whitelisted for a certain length of time. Secondly, AFAIK, none of your outgoing messages are put in the SPAM/NOTSPAM corpi -- only incoming messages are. Note that 'internal' messages will be added.
stefsegers wrote:All incomming mails don't go in NOTSPAM?
No. What would the point be? You need to have a good sample of SPAM and NONSPAM messages and make sure you rebuild your database regularly or ASSP will not be able to classify accurately.
stefsegers wrote:The problem is that I still get about 500 spam mails a week!!!!
It sounds like you're not rebuilding the database...
stefsegers wrote:I did the tutorial described up here but still nothing worked.

...and it sounds like you didn't follow the tutorial close enough.

stefsegers wrote:I have to review my SPAM/NOSPAM dirs every week and that is too much work.
Again, once you have a good sample of messages in both SPAM and NOTSPAM, and ensure your database is being rebuilt regularly, this should not be much of a concern. It seems as though your SPAM and NOTSPAM corpi are poisoned. Perhaps you can backup these directories and start over. Try placing ~100 spam messages in SPAM and ~100 non-spam messages in NONSPAM and rebuild the database. Then carefully monitor both directories until there are about 500 messages in each container, all the while rebuilding the database after making corrections.

Aside from reattempting ASSP, you may want to look into using SpamAssassin instead -- it may be more appropriate for your environment.

stefsegers
Normal user
Normal user
Posts: 137
Joined: 2005-05-26 23:26
Contact:

Post by stefsegers » 2005-12-03 09:49

Hey punguin,

Thanks for the reply but....
All mail I am sending still is going to nospam, also incomming spam is going to no spam.
I rebuild the database every night!
I also have done every swithc shown in this tutorial.

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Post by dennism » 2005-12-03 13:25

I have a problem after installing ASSP. For 2 days I havnt recived any email, and when I shutdown ASSP be revice email again.
I have this statistic in ASSP:
http://www.demaweb.dk/assp.jpg

As you see there have been 83 connections, but only 3 messages had passed. Do anybody know anything about this problem?
The 3 messages I have recives is test-mails sent from myself.

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Post by dennism » 2005-12-03 13:27

And can I find the missing messages somewere?

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Post by dennism » 2005-12-03 20:51

When trying to send a mail to my adresse, I get this error:
Received: 550 Relaying not allowed

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-12-03 21:01

Does it work if you turn of ASSP?

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Post by dennism » 2005-12-04 00:19

Yes, if I turn of ASSP and set hmailserver-SMTP to listening on port 25 it all work again.

User avatar
Bram
Senior user
Senior user
Posts: 417
Joined: 2004-05-24 22:57
Location: The Netherlands
Contact:

Post by Bram » 2005-12-05 09:42

Have you specified you local domains? Al domains you are hosting in hmailserver you have to set in assp as local, if not you get a relaying denied error.

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Post by dennism » 2005-12-06 15:05

Oki, but I have a lot of domains on my server - should I have to enter all of them?

User avatar
Bingo
Normal user
Normal user
Posts: 92
Joined: 2005-01-27 11:43

Post by Bingo » 2005-12-06 16:39

dennism wrote:Oki, but I have a lot of domains on my server - should I have to enter all of them?
Yes, but I believe you could easily script that.

dennism
Normal user
Normal user
Posts: 66
Joined: 2005-10-07 07:34
Location: Denmark

Post by dennism » 2005-12-06 18:09

Yes, and I found a option to point a domain list. The ASSP are now running.
But now I have a new problem..When anybody sent a mail to me, [SPAM] is added in the subject - not just for spam-messages but for all incomming messages.

User avatar
Bram
Senior user
Senior user
Posts: 417
Joined: 2004-05-24 22:57
Location: The Netherlands
Contact:

Post by Bram » 2005-12-06 21:31

Then you receive only spam messages!

assp has to learn, you have to build op a database (rebuildspamdb.pl)
Everyone you mail gets automaticly whitelisted, so when they reply, it is not marked as spam.

stefsegers
Normal user
Normal user
Posts: 137
Joined: 2005-05-26 23:26
Contact:

problems setting up ASSP

Post by stefsegers » 2005-12-07 13:51

Hi All,

I am wondering why I don't receive all mail I should. Also some of my client aren't receiving my mails at all!!!

Here's my statics

Connection Statistics
ASSP Proxy Uptime: 27.403 days 55.648 days
SMTP Connections Received: 2241 4577
SMTP Connection Limits - Total: 0 0
SMTP Connection Limits - by IP: 0 0
Totalled Message Statistics
Messages Processed: 2081 (75.9 per day) 3901 (70.1 per day)
Relay Attempts Rejected: 2 (0.1%) 11 (0.2%)
Total Messages Blocked: 0 155
Total Messages Passed: 2081 3732
Non-Local Mail Blocked: 0.0% 61.5%
Blocked Message Statistics
Bayesian Spams: 0 136
Blacklisted Messages: 0 0
HELO Listed Messages: 0 0
Spam Bucketed Messages: 0 10
Attachments Blocked: 0 0
Viruses Detected: 0 0
Spam Bombs Blocked: 0 0
Scripts Blocked: 0 0
SPF Failures: 0 30
RBL Failures: 0 0
Passed Message Statistics
Bayesian Hams: 0 27
Whitelisted Messages: 0 55
Local Messages: 2081 3650
Noprocessing Messages: 0 0
Spamlover Spams Passed: 0 0


I just deleted my spam/nonspam folder (over 5000 messages!!!) and re-run rebuld database.
I just want all people I send mail to go to the NON SPAM folder and that's it. i want to copy my spam messages my self to the SPAM folder .. OSX has a great spam filter and I move the msgs to my spam folder.

Hope somebody has a solution


Stef

iprat
Normal user
Normal user
Posts: 247
Joined: 2005-05-20 16:50
Location: Barcelona, EU
Contact:

Post by iprat » 2005-12-07 14:23

The first think you must do is read the manuals at ASSP. By your post I assume your ASSP is not properly configured.

First, have you declared your local domains? and local users ? If you use SMTP authentication it is not necessary to list users but if not it is very important.
My perfect combination:
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)

stefsegers
Normal user
Normal user
Posts: 137
Joined: 2005-05-26 23:26
Contact:

Post by stefsegers » 2005-12-07 14:37

iprat,

thanks 4 the reply. Of course I have read the manual, but t's not good! I have done all tutorials found on this forum and tried the help from assp, but it's no good.
I have put all local domains... not users (didn't find the option) I use smtp auth of course

stefsegers
Normal user
Normal user
Posts: 137
Joined: 2005-05-26 23:26
Contact:

Post by stefsegers » 2005-12-07 14:37

iprat,

thanks 4 the reply. Of course I have read the manual, but t's not good! I have done all tutorials found on this forum and tried the help from assp, but it's no good.
I have put all local domains... not users (didn't find the option) I use smtp auth of course

I use version 1.1.1

iprat
Normal user
Normal user
Posts: 247
Joined: 2005-05-20 16:50
Location: Barcelona, EU
Contact:

Post by iprat » 2005-12-07 15:01

You are right that it is not very good documentation but even in that case it is good to have a look at it.

Well, have you set up the proxy correctly? do all your users use ASSP ? I mean, ASSP works because it learns from local users wich users are to be whitelisted. If you made your users not to use ASSP talking directly with hMailServer then ASSP will never learn anything.

I think you should begin to do some very basic tests, and see if you discover anything not normal in your installation. Many things can be misconfigured and lead to bayesian spam not working... I mean it is quite to vage description of the simptoms of your illnes ;)

You have taken a good decision to start from scratch (clear all and start again) but in that case take control of it in the first hours and try to see if something strange happens (whitelisted users message get into spam folders or things like this) in the ASSP logs.

Try to find specific things that go wrong and we'll try to help you.
My perfect combination:
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)

User avatar
carlinhos
New user
New user
Posts: 28
Joined: 2004-09-13 13:07
Location: Valencia, Spain
Contact:

Post by carlinhos » 2005-12-07 20:31

Stefsegers, I had a problem like yours. I had a very big number of false positives. After some tests, I understood that the spam folder must be almost emptied and left only a small sample of spam mesages. For example, I actually have some 13000 not spam mails (I didn't delete anyone) and only 400 spam messages after the cleaning (I had to delete some thousands).

This is because many spam messages are repeated, so the words in score are multiplied by tens or hundreds. In other way, you must delete from spam folder EVERY false positive. This is a bit labourious but is necesary. This is because your bad classified good e-mails adds false spam words that may led to more false positives.

In other hand, you must review your spamdb.helo. It's a very useful feature but if you had many false positives, the database may be corrupted and showing helo addresses of legitimate email senders. If it's the case, you must delete it and after running rebuildspamdb.pl, will be recreated.

I also do not recommend to build database every day. No because the spam database may become so big that the false possitives problem starts again.

stefsegers
Normal user
Normal user
Posts: 137
Joined: 2005-05-26 23:26
Contact:

Post by stefsegers » 2005-12-08 15:46

Hi Carlinhos,

Thanks for the good description.
I just deleted al unnessacary files in the SPAM/NOTSPAM foder.
The I deleted my spamdb files and rebuild it

I hope now only my outgoing msg will go to the NOTSPAM folder and not all messages I get (some are spam)

Hope the mails will do better now, I also got many complaints that mails were not received by people whch were send by my server.

Stef

Post Reply