VirtueMart Saferpay

Posted by Mike Haller on Sunday, February 17. 2008 at 11:58 in Hosting
Today I released v1.0.0 of the E-Payment module Saferpay for VirtueMart 1.0.x. Hopefully it's of help for people who want to integrate the swiss E-Payment solution provider into their VirtueMart shops.

== <> eq

Posted by Mike Haller on Saturday, February 2. 2008 at 10:23 in Hosting
A customer requested to disable all spam filter rules for his accounts. He suspected to miss mails, so he really wanted us to switch off all filters for his accounts.

To implement that within short time, I decided to change the maildrop filter script /etc/courier/maildroprc. I added the following snippet.

# Disable all filters for customer XYZ
if ( $HOST == "example.org" )
{
  log "All filters disabled"
  to $DEFAULT
  exit
}
else
{
  log "Normal filtering rules apply"
}


Well, this snippet does not work as expected. It will always jump into the first case "All filter disabled". As the maildroprc is the general script, which is applied for all incoming mails, the spam filters were disabled practically for all customers. After half a day, my own spam trap account was already fully and couldn't hold any more spam.

So what was going wrong? I read through the courier documentation and found it: == is a numerical comparison. Text comparison must be done using eq. I should have known it better, as I'm a Java Developer. I have never seen any maildroprc example script using eq, so I didn't expect bash-like expressions in there.

The correct snippet:
# Disable all filters for customer XYZ
if ( $HOST eq "example.org" )
{
  log "All filters disabled"
  to $DEFAULT
  exit
}
else
{
  log "Normal filtering rules apply"
}


P.S.: My servers are, hours later, still working on filtering the spam again which was queued. I've got a dedicated machine for running Spamassassin workers, and it's load is .. well high enough.

About

My name is Mike Haller and I'm a software developer and architect at Innovations Software Technology in Germany. I love programming, playing games and reading books. I like good food, making photos and learning and mentoring about the craftsmanship of commercial software development.

Quicksearch

Archives