MD-MRTG Version 1.10

MD-MRTG Version 1.10
Copyright 2006 by Dave Koontz

Here is the newest version of MD-MRTG designed to work with the new Counter Systems in MDaemon v9.0 and higher. It is important to note that this version will not work with previous versions of MDaemon.

1.10 February 1st, 2006
———————–
– *** This version will NOT work on versions of MDaemon prior to 9.0 ***
– MDaemon 9.0 & Higher Support (Beta 9.00i and up)
– Code changed to reflect new MDaemon GUICounts.dat file (stat location)
– MultiPop messages are now relfected in SMTP-IN counts
– Junk Percentage Stats no longer include emails in Bad Message Que
– Junk Percentage stats more accurate (thanks sysadmin_at_dsty.ac.jp)
– VB Script Code Reformatted and conventions more consistent between scripts

ORDB.org blacklisting all IP addresses

Since yesterday, March 25 ORDB.org – one of the old SPAM blacklist databases – started to blacklist all IP addresses. As a result, all mail servers using a spam filtering solution that still references ORDB (relays.ordb.org) started to immediately block all incoming e-mails. I got some reports into my personal e-mail yesterday, that finally got fixed by my provider today.

If you’re running MDaemon 9.60 or newer (released June 12, 2007) then MDaemon’s installer automatically removed relays.ordb.org from your spam blocker configuration, but if you’re on an earlier version you might want to double check your configuration.

To check to see whether or not you’re using ORDB, open the MDaemon GUI, go to the Security menu, look for either “DNS Blacklist” (in newer versions) or “Spam Blocker” (older versions), and see if you see any mention of “ordb.org” in your list — If you find it, select and remove that entry and you should be good to go.

Although ORDB.org was shut down on December 18, 2006, yesterday they changed their behaviour, and instead of timing out, they are blocking all IP addresses, that is, every e-mail server queried is being reported as an open relay — Depending on your configuration, this may result in all mail being blocked, or it may simply increase the chances that legitimate mail is treated as spam.

Attaching HTML signatures

MDaemon’s content filter has an “Append a corporate signature” rule which can be used to add a block of text to the bottom of message.  However, if you attempt to use HTML, the HTML code gets inserted into plain text signatures too.

I created a content filter rule hack around this limitation.

Basically what this rule does is the following:

Action01) Add the “plain-text” version of the signature with a special tag (/zzz/)
Action02) Clean up the special tag from the plain-text version.
Action03) Remove most of the signature from the HTML version.
Action04) Remove the rest of the signature from the HTML version and insert the HTML signature.

So, if you’re feeling brave, backup your \MDaemon\App\ directory and get started.

To “install” this content filter rule, copy the below lines and paste them into the very top of very bottom of your \MDaemon\App\cfrules.dat file, then go into MDaemon’s Content Filter and activate the rule.

[Rule001]
RuleName=HTML sig - TEST RULE
Enable=No
ThisRuleCondition=All
ProcessQueue=BOTH
Condition01=FROM|contains local account|AND|
Action01=add footer|"/zzz/1 corporate signature/zzz/","/zzz/2 corporate signature/zzz/","/zzz/3 corporate signature/zzz/"
Action02=body search and replace|"^/zzz/(.*)/zzz/$","\1","0,1"
Action03=body search and replace|"(<br>|^)/zzz/.*/zzz/<br>","","0,1"
Action04=body search and replace|"(<br>|^)/zzz/.*/zzz/</html>","<br><font color="#ff0000"><i>1 corporate signature</i></font><br><font color="#3366ff" size="-2">2 corporate signature</font><br><a href="http://www.example.com/">3 corporate signature</a><br></html>","0,1"

The rule is hardcoded to only function if a message is FROM a local account, but you’ll want to test this in your environment to make sure that no other mail gets a signature added. I’d suggest adding a “If the TO HEADER contains” condition to test the rule.

After “installing” the rule, open the rule in the Content Filter GUI editor (MDaemon –> Security –> Content Filter), edit the rule, then edit the “then add footer” (Action01) section to contain your corporate signature. However, add a /zzz/ to the start and end of each line. In other words, if you want your signature to look like this:


My Name
My Title
My Company
www.example.com

then what you’d enter would be

/zzz/– /zzz/
/zzz/My Name/zzz/
/zzz/My Title/zzz/
/zzz/My Company/zzz/
/zzz/www.example.com/zzz/

Don’t worry, the /zzz/ won’t show up to users, this is just a trick to allow the following actions to identify the signature. Action02 cleans up the /zzz/ code from the plain text version.

Action03 and Action04 are where the “magic” happens, these actions modify the HTML portion of the message and remove the signature we just finished adding, and then Action04 adds the HTML version of the signature.

Edit the very last “and body – search and replace” condition, don’t touch the “Search Expression” at all, only change the “Replace With”, replace it with your corporate signature, and add a tag to the end.

Hopefully this works, it appears to work in my own testing, but I’d appreciate comments if you either are successful, or can’t get it working. Please comment here, don’t use the “Feedback” link requesting technical support.

Note that while you can add HTML, it’s not yet possible to add a corporate logo — You can link to an image on the web, but many/most mail clients won’t display said image.

UPDATED (2011/02/01): Made minor tweaks to content filter rule