Saturday, May 10, 2008

clamsmtp rbl support patch

clamsmtp is lightweight anti virus smtp proxy. You can put it in front or back of your smtp server. But if you run it in front of your smtp server and relay traffic back to your original smtp server, you cannot use any rbl server.

So, I decided to write a patch which adds this new rbl option to clamsmtpd server. You can download patch from here clamsmtp rbl patch

Tuesday, May 6, 2008

qmail linefeed problems hotmail , dcc and others

While I was testing DCC Checksum , I discovered that some email messages are truncated and dcc reports that body part is missing with an error message "missing message body". I figured out that not only the body part is missing also the headers also truncated.

A quick investigation with tcpdump showed that spamc is sending truncated messages to spamd server which is passed to dcc server. A second tcpdump run on smtp server showed that some messages is rejected by qmail server with "451 See http://pobox.com/~djb/docs/smtplf.html." message. This was hitting a small amount of mails but the ones especially coming from hotmail.com.

I have quickly fixed the problem with djb's fixcrio application which comes with DJB's ucspi-tcp package. No more "missing message body" error messages anymore with dcc :)

Running fixcrio is easy. Just put the command before qmail-smtpd where you run it.

Thursday, May 1, 2008

VI tricks part one

I have finished first part of my VI editor tricks article. Part one explains main commands and tricks like sort data, replacing selected lines and feeding vi document content as input to any program while getting output as new document.
You can read VI tricks part one here.

Sunday, April 20, 2008

FreeBSD GJournal (Filesystem Journal)

Freebsd 7.0 has a new geom extenstion called gjournal. You can easily create a journaled filesystem with gjournal on bsd systems.
First of all, gjournal support has to be built in kernel. It's currently built in 7.x series. The kernel option is called UFS_GJOURNAL

You should disable soft updates on filesystems where gjournal is used. Because journalling takes place and there is no need to use soft updates for data recovery on a crash.

While the filesystem is journalled, the mount option async will boost the performance.


For example, let's say we have a disk called ad1 and it has existing filesystem on it.

All we have to do is create a label.

# gjournal label -f /dev/ad1

notice the -f option. It will force convert operation of an existing file system to journal. Journal device will be separate and called in this example as /dev/ad1.journal.

now it's time to load geom gjournal kernel module.

# gjournal load

now add journalling support to our existing filesystem.

# tunefs -J enable /dev/ad1.journal

it's better now to disable soft updates.

# tunefs -n disable /dev/ad1.journal


now we mount our new journalled filesystem with async option.

# mount -o asyn /dev/ad1.journal /mnt

in our example, we don't have any slices on our disk. In slice case new devices will be created (eg. /dev/ad1s1.journal)

Tuesday, February 5, 2008

Sqlite compression

Sqlite database has no built-in compression support. But it has a feature called loadable extension, which let's developers to create any addon feature for sqlite database. I have wrote some documentation about sqlite loadable extension and how to add compress/uncompress ability to sqlite database to compress your data's on the fly.
Here is my article

Sunday, January 13, 2008

ucspi-tcp mysql patch

Finally, I had spare time to finish my ucspi-tcp mysql patch . Putting tcpserver rules in a mysql table has many advantages like centralized access rule lists and easy management.

Wednesday, September 12, 2007

prevent caching of swf,flv or other files

The header fields Cache-Control and Pragma can be used to cache or prevent caching of web content. Using this header fields on html meta tags doesn't seem to work. Forcing them from http server, seems the best way that works with Internet Explorer.

Following example shows how to configure no cache option on Apache web servers
You should add following statements into your httpd.conf file (mod_header should be enabled of course)

Header set Cache-Control "no-cache, must-revalidate"
Header set Pragma no-cache

Another example in php language

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");


For further details and how to configure IIS server please see this article on Microsoft's site.