GRYNX

27th 2006f October, 2006

Greylist – freeware Grey list for Exchange v1.1

by @ 8:03. Filed under
GreylistThis is an old version – click here for latest version

Introduction

Since I have had a lot of problems with false positives with the black lists that I’m using on my Exchange 2003 server I started looking into another way of filtering spam.
The obvious choice of additional protection fell on grey listing ( you can read more about what it is here ).
The problem with this is that there doesn’t seem to be any free products out there for Exchange and as I don’t want to set up a Linux box ( yet another box in the rack ) I decided to write one myself.

Usually i receive 3500-4000 spam attempts per day so that means that 70 mails a day are slipping trough. These 70 get matched to a blacklist that is not that aggressive and the result of this is that my spam level has gone down to almost 0% while I haven’t had a single false positive yet.

About the program. It consists of two parts.

Requirements:

Features:
Greylist

Greylist admin


New in version v1.1.3 (v1.1.1 for Greylist admin):
Greylist

Greylist admin

This is an old version – click here for latest version

Install package Greylist_v1.1.3.zip
Documentation Readme.doc
Source Greylist Greylist_v.1.1.2_vs.net_source.zip
Source Greylist admin Greylist_admin_v.1.1.1_vs.net_source.zip


What does it cost?
Nada. Nothing. It’s for free!
See it as a contribution to a better world :) A free contribution! I’ve released this under a Creative Commonce license, which comes down to that you can use it and redistribute it as long as you refer to me and this site while using any part of my program. The full license is available in the readme file.

The program is distributed ‘as-is’ and I don’t intend to provide any support for it.
But feel free to send me any suggestions to improvements or your own modifications.

Cheers,
Chris

41 Responses to “Greylist – freeware Grey list for Exchange v1.1”

  1. Allen Says:

    Chris,
    Thanks again for a great tool, the last version is working great for me and it looks like this one is even better.

    Allen

  2. Piethein Strengholt Says:

    Wonder if you are able to add junk support? Or to ability to move files to a different folder. Would be very nice!!

  3. Chris J. Says:

    Piethein: No, that won’t work as it’s only delaying the sessions. There is no way to determine if a session is legitimate if you don’t block it.

  4. Chris J. Says:

    I’ve added a statistics demo based on AwStats.
    If numbers get you going then look here for a limited demo.

  5. Exrace Says:

    Thanks for latest version.

    I did run into a issue with SMTP – 999 in the text log.
    The recieving mail server is set to 100 sessions and I understand
    greylist tool can only handle 35.
    I set the incoming mail server to 30 and it is back to reporting SMTP 451’s

    This has logged over 15,000 blocked messages in less then 12 hours and that is not
    counting the 999 failures.

    Suggestions:
    * Add sorting/search for whitelist (much needed)
    * Add “Accepted” logging to allow easy adds to whitelist
    (select entry and add to whitelist).

    I am running this on:
    Exchange 2000
    Windows 2000 sp4

  6. Chris J. Says:

    Exrace: Without making any promises I can say that I’m working on the next version that will have support for ODBC connections instead of the local mdb. The mdb is today the limitation for the concurrent sessions. With a ODBC we should be able to make use of a MsSQL or MySql and be able to get more sessions going.
    The suggestions are accepted and added to the todo list.

    Man, you have some serious traffic going!

    Cheers,
    Chris

  7. Exrace Says:

    Running up on SMTP – 999 in the log again.
    What might be the problem?
    22,000 and counting. :)

  8. Ian Says:

    Hi chris,

    Well, your 1.1.3 update is great! Upgraded as per your advice and put some wildcards in straight away. I also amended some existing entries to be wild cards

    Had a slight “glitch” over a few days ago with 1.1.0 and Exchange stopped accepting email, it just refused everyone. Restarted SMTP and all fixed.

    See how this version goes. At same time thx very much for a great product

    regards
    Ian

  9. Pär Rohlin Says:

    The latest version is working like a clock. I am a bit concerned about the access database size, but I am sure that will be working versions were I can use MSSQL instead in the near future.
    I have a reject rate of 87%, 77000+ blocked and 63000+ entries in database.
    When you look at migrating to a “real” database, you might consider make an option to log to database, instead of logging to file.

  10. Chris J. Says:

    Exrace: Error 999 is logged if something went wrong in the db connection. This usually happens if it’s overloaded. Try reducing maximum concurrent sessions.

  11. Exrace Says:

    I will tweak this connection size. I had at 30 but was getting
    “maximum number of connections has been reached. Connection being closed” so
    I bumped it back up.

    I have it set at 35 for now but let use know what is the max connections it
    should be at.

    I have also seen crashes around same time as the 999:
    Faulting application inetinfo.exe, version 5.0.2195.6620, stamp 3de2893b,
    faulting module msado15.dll, version 2.80.1062.0, stamp 43fff143, debug?
    0, fault address 0x000014af.

  12. Finn Køpke Says:

    It seems like that 1.1.3 is stopping IIS SMTP. Every morning we have outbound mails queued up on the exchange server.
    We are sending alle mails trough our mailgateway on the DMZ zone where Greylist is installed. When we make an iisreset /restart on the mailgateway all outbound mails on the exchange server is sendt. If we remove the Greylist program we have no problems but SPAM :-(

    Btw great program – when it works……

  13. Finn Køpke Says:

    Chris,
    We have reinstalled our mailgateway and the problem with Greylist 1.1.3 is over.
    Conclusion – we had a problem with our IIS and not Greylist.
    It works fine now. Thanks

  14. Eoin Colley Says:

    To upgrade to v1.1.3 from v1.0, do you recommend remove & re-install or is there a safe way to keep using the old database?

  15. Devin L. Ganger Says:

    Just wanted to let you know I did get your comment back in September, and have finally written up your greylist on my blog:

    http://blogs.3sharp.com/Blog/deving/archive/2006/11/03/2350.aspx

  16. Chris J. Says:

    Eoin: When you install the new version and start Greylist admin for the first time then it will upgrade your existing database.
    So – yes. You can just keep the old installation as is.

  17. Gert Says:

    I have a lot of entrys like this in the log file, but the statistics are 0, what s wrong ?

    2006-11-06 09:33:03 infonum-110527710333db@deutsche-bank.de xy@mbn-interlab.de – 84.121.122.129 SMTP – 999 0

  18. Chris J. Says:

    Gert: 999 means that there was an unknown error. This is usually happens if the load (concurrent sessions) is to high.

  19. Gert Says:

    i try it after a reboot from the Exchange Server, but the result is the same SMTP – 999 0
    (i not think that Concurrent Sessions are to high). NT Server 2003, Exchange Server 2003, latest SP
    and McAfee Groupshield – It’s McAfee the problem ? Thx!

  20. Matt G. Says:

    Chris,

    This is a great plugin for exchange and it’s doing a great job for us blocking spam. However, I’ve seen a few spams get through without getting 451 response first when it’s a spam with BCCs in it:

    2006-11-10 15:10:51 estukuleledes@ukulele.com foo1@foo.net – 82.160.42.74 SMTP – 200 0
    2006-11-10 15:10:51 estukuleledes@ukulele.com foo2@foo.net – 82.160.42.74 SMTP – 200 0
    2006-11-10 15:10:51 estukuleledes@ukulele.com foo3@foo.net – 82.160.42.74 SMTP – 200 0
    2006-11-10 15:10:51 estukuleledes@ukulele.com foo4@foo.net – 82.160.42.74 SMTP – 200 0
    2006-11-10 15:10:51 estukuleledes@ukulele.com foo5@foo.net – 82.160.42.74 SMTP – 200 0

    Could you put ‘catch’ in that try/finally block and log any error to the log file? I’m guessing it’s a problem the strRecipient parsing or maybe chkWhitelist handling strRecipient.

  21. Chris J. Says:

    Matt G: Code 200 means that the mail was passed through as it was whitelisted. Do you have @foo.net in your recipient whitelist or @ukulele.com in your senders whitelist or the ip in the source ip whitelist?

    Cheers,
    Chris

  22. Matt G. Says:

    Hi Chris,

    I didn’t @foo.net or @ukelele.com whitelisted. In fact, I didn’t have anything whitelisted at that point nor have I seen it happen again since then. Looking at your code it appears that the only way the result code could be set to 200 is if bolWhite = true so I think I had a whitelist entry in the database with an empty string in it. The more that I think of it I’m pretty sure I had two empty rows visible on the whitelist tab at that time because I created an entry and then I erased the contents of that entry.

    Matt

  23. eric Says:

    Thanks for a great tool – works awesome for us. A request I have is for a black list. About 40% of the mail coming to our server is for people who no longer work for us. Ideally I’d like to just drop anything addressed to them.

  24. Joz Says:

    I tried Greylist today but had no luck (Exchange 2003 on Win 2003).
    The first time I ran Greylist admin there where lots of error messages pointing to some problems with the database. I think there is a problem with the date/time format since this is a german system. Changing the date/time settings to engliush (USA) fixed that, but still nothing but 999s in the logfile and no entry in the db. Recreating the db turns out to be difficult since something has its fingers on the mdb (disabling does not help) so I could not delete it. Server restart helped but that can’t be the solution.
    What a pity – I like the idea of greylisting very much and especialy a free program implementing it…
    Joz

  25. vosweb Says:

    Hi together,
    I think also there is a Date/time Problem.
    Run Greylist admin on a (German)SBS2003server creating the database end with OK then the following error:

    At next start Greylist admin or klicking [cleanup now] or [refresh]
    Following error:

    Failed retrieve internal settings cause BOF or EOF is true ……

    Sorry my rubbish english :-)
    Volker

  26. Chris J. Says:

    Joz and Vosweb: Yes that’s correct. There is a date problem and this has been resolved in the new version that I’m still developing. I’m now storing all dates in international format to overcome this issue.

    Eric: I’ve decided not to implement a blacklist as this is a function supported by Exchange itself. I’m not going to reinvent the wheel 😉

  27. Henrik Says:

    Hi Chris

    After testing your great tool, I seem to have some problems. I have a server that gets a lot of event id 348. Its running very slow:

    A message could not be virus scanned – this operation will be retried later. Internet Message ID , Error Code 0x0. For more information, click http://www.microsoft.com/contentredirect.asp.

    Actually I have disabled your tool by running the disable script. So I don’t get, why I have this event about 350 times a day.
    Google gives me this:
    http://www.webservertalk.com/archive128-2005-4-604357.html
    They talk about some smtpvbs.reg script, and this is where you come in :)

    Is there something in your smtpreg.vbs that isn’t disabled correct?

    Henrik

  28. Chris J. Says:

    Henrik: Odd problem you have…
    The way Greylist works is that it will only interfere with a mail if it needs to be blocked. If it’s not blocked then it passes through without Greylist even touching it.
    What I could imagine is that the virus scanner has a lower priority, or close to, then Greylist and that this might interfere.
    Could you do this: Enable Greylist and run cscript smtpreg.vbs /enum > enum.txt from the Greylist directory. Then send me an email with the enum.txt file.
    I’ll mail you my address separately.

    Cheers,
    Chris

  29. Jeff P. Says:

    I have a smart host between the Exchange server and the internet. Will I still be able to use this program

  30. Chris J. Says:

    Jeff P.: Unfortunately you can’t use Greylist on a server behind the main MX as your smart host would resend any failed emails and the only effect would be that you’d get an delay in recieving emails.
    Greylist has to be installed on a MX server that faces the spammers.

    Cheers,
    Chris

  31. Andy Laurence Says:

    I’ve installed the software on a Windows 2000 / Exchange 2000 server. Aside from installing a later MDAC version, and .NET 2, all appears to have worked well. I am receiving mail, and have had no spam as yet……

  32. Jeff S. Says:

    I am just trying greylist out and so far looks very promising. But it would be nice if there was a feature that listed in a simple format what has been blocked and what has been passed.

    Filtering and sorting what’s in the log file, I guess is what I’m suggesting. In other words, filter out blocked items if they were subsequently allowed to pass on retry, and filter out multiple passed items. Then sort what’s left in some logical manner.

    That would make it easier to analyze how well it’s doing at blocking junk and avoiding false positives.

    Ideally this would be available via command line so I could automate it with a perl script to email the output on a regular basis.

  33. Jeff S. Says:

    One other thing… the log file’s name and the times inside the log file appear to be GMT rather than local time. Any chance we can see this changed or at least have an option?

  34. Chris J. Says:

    Jeff S: The easiest way to find items is from the command prompt. Open a command prompt and go to the \log directory.
    To find all blocked grey sessions type: find ” 451 ” 20061120.log
    To find all passed grey sessions type: find ” 250 ” 20061120.log
    To find all whitelisted sessions type find ” 200 ” 20061120.log
    To find all bad sessions type: find ” 999 ” 20061120.log

    The reason why dates and times are in UTC (not GMT) is that the logfiles can be consolidated across different servers and timezones.
    In the next version, that is almost ready, the dates in the database are also in UTC.

    Cheers,
    Chris

  35. Jeff S Says:

    Thanks Chris. “find” isn’t quite what I was looking for, because “blocked” really means “potentially blocked” and if the sender resends, then it passes. So in that case seeing an item blocked is misleading. I was hoping for something that filters out the blocked items that were subsequently passed.

  36. BootP Says:

    The theory rocks – “looks” like a silver bullet. So far, all is well. Comments on following please:

    I am running this on my ISA server which is also a border firewall. It SEEMS to be blocking on all three of the triplets. Did you sneak in a silent upgrade?? Somewhere I remember seeing that if doesn’t filter on source IP if running on IIS SMTP.

    Multi-MX source server issue: This seems to be the only “gotcha.” One fix would be to insert the IP addresses of all the “Big” mail servers. Since they don’t change often, a simple text file update would probably work – and someone to keep it up to date. Is there any thought to an auto-update?? As in fill in the MX servers we want to whitelist and then have DNS auto-populate the whitelist??? THAT would be awesome.

    SQL – gees, how about SSE??? It is dyne Oh mite and free. Though, if it will work on MS-SQL it will work on SSE.

    Definitely on the right track. Keep this thing simple and clean – just run a bit faster.

    Thanks for the great work!! JUST the ticket for me.

    BootP

    PS – almost forgot – Exchange 2007 will have it’s own internal SMTP engine. Not sure how this sort of animal will fare in that environment. PLUS – major gotcha – it will need to run on x64 hardware and in an x64 OS.

  37. Ryan O'Dwyer Says:

    Hi Chris,
    Great job, donation on its way,
    no issues so far running it on MS Small Business Server 2003.
    Cheers,
    Ryan

  38. stephane Says:

    Hello, what a great tool this is. stoping over 80% of spam.

    I am getting this error from time to time:

    Could not load file or assembly ‘System.EnterpriseServices.Wrapper.dll’ or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

    Thanks for your time in helping me fix this error :)

  39. Matt Borcherding Says:

    *Nice* tool, but we could really, really use a way to easily import whitelist entries.

    Several known sources use multiple email servers to send emails, so they will frequently get blocked. The resend isn’t always from the same server. I found lists of servers that should be whitelisted in several places, but this seems to probably be the best one:

    http://greylisting.org/whitelisting.shtml

    – Matt Borcherding

  40. Loris Says:

    Hi Chris,

    I’ve got the same date problem as vosweb. When are you releasing a new version? :)
    Would be great to make it work in switzerland.

    Cheers
    Loris

  41. Mike Says:

    Hi, like the tool and saves me lot of e-mail, BUT,
    I have reports of MISSING mail which are never delivered!
    It’s seems only to happen to mails with to: and cc: field used.
    I have isue’s of a cc: not receiving it mail the to: arrived fine.
    But today i had it the other way arround.

    The log file says 200 but the mail never arrives at our mail server?

    Any sugesstions?

    Mike

Leave a Reply

You must be logged in to post a comment.

Host your project

Write for Grynx:

Do you have what it takes? If you're the right person then email us.

Archives:

Support Grynx:

Help us continue our work with a donation

Website promotion SEO Managed Advertising

5 Most popular articles:

Google

Categories:

Do it yourself - DIY
Our projects collection

19 queries. 0.231 seconds

Home