CartMetrix - Do you know yours?

5/15/2007

Adding Human Readable Date to MySQL Query

SELECT *, FROM_UNIXTIME( 't_stamp_column') AS date FROM 'tablename'

For formatting the date see MySQL's date functions information.

Popularity: 19%

5/7/2007

ValidRcptTo.cdb Patch for Qmailrocks

Received a call from a client this morning about not receiving any email for the last few days. Viewing the queue on their server showed 50,000 messages in the local queue. Tailing the logs, showed dozens of messages being received every minute to non-existent addresses to valid domains on the server. Qmail was accepting the messages only to eventually bounce them after failing to deliver locally to the fake local address. If only Qmail could check for valid email addresses in the initial SMTP connection and reject mail for addresses that do not exist.

ValidRcptTo.cdb is a patch for Qmail that does just this. There are several implementations of this functionality, but John Simpson’s version handles aliases, vpopmail and system accounts, Qmail’s .qmail-default aliases and utilizes a cdb database for speed.

Patching my existing QMR install proved to be troublesome. qmail-smtpd.c and the Makefile blew rejects. I manually worked these rejected code chunks into the QMR Qmail source and produced a new patch file to use on the other installs I manage.

For full details on using ValidRcptTo see John’s page.

Original ValidRcptTo.cdb Patch

QMR 2.2.1 ValidRcptTo.db Patch

John also maintains a bundle of other worthwhile Qmail patches at his site.

Popularity: 18%

Qmailscan Report

more /var/spool/qmailscan/quarantine.log | grep “`date ‘+%d %b %Y’`” | cut -f5 | sort | uniq -c | sort

Popularity: 16%

5/4/2007

Centering a Page with CSS

Add this to your stylesheet:

body    {
        text-align: center;
}

div#main        {
        margin: 10px auto;
        width: 600px;   
        text-align: left;
}

Use this for the page body:

<body>
<div id=“main”>

… main body html …

</div>
</body>

Popularity: 12%


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It