Articles

SQL Command Reference

Deactivate all inactive users in the last year:
UPDATE `smf_members` SET `is_activated` = 0, `validation_code` = `dateRegistered` WHERE (UNIX_TIMESTAMP() - `lastLogin`) / 86400 >= 365 AND (UNIX_TIMESTAMP() - `dateRegistered`) / 86400 >= 365;

Search and replace text in the "body" field (note that it must be updated in 2 places):
UPDATE smf_messages SET body = replace(body,'OLD','NEW');
Append a value to a field, if it's not already present:

How to check for an open relay

To see if yourserver.com is an open relay, you can run through the following sequence on any box that has a telnet client:
telnet yourserver.com 25
HELO myserver.ca
MAIL FROM:
RCPT TO:
DATA
From: "Relay Test" 
To: Mike 
Subject: Open Relay Test
This is a relay test. A properly configured mail server
should decline to relay this message.
 
.
QUIT