Expanding on the work of the infamous [EMAIL PROTECTED] (infamous, that is, because no-one knows his real name :), I have come up with a set of patches to qmail and checkpassword that let you have virtual POP3 users in a MySQL database. For more details hop over to http://iain.cx/unix/qmail/mysql.php, just don't mention the invisible menus and headings - I'm having a problem with libttf. -- blurb follows -- Why would you want to use my patches over takeshi's? Because you can do more stuff. Everything that qmail and checkpassword do that's related to local mail delivery can be stored in the database. This means virtual domains (rewriting [EMAIL PROTECTED] to [EMAIL PROTECTED]), receipt hosts (rcpthosts table complements control/rcpthosts), .qmail aliases (associating alias-root with the virtual user "mail4root"), mail(dir|box) ownership (qmail-getpw bigcompany-sales returns bigcompany\0800\0100\0/popmail/bigcompany\0-\0sales\0) and POP3 authentication (bigcompany can read mail). The latter can use encrypted, MySQL-hashed or plaintext passwords. You can also do crazy things with judicious database hacking, including giving real system users separate POP3 passwords by putting their real uid, gid and home directory in the mailbox table (haha, they may sniff my mail password but they still can't login as me via ssh) and have mailing lists by putting several entries in the alias table. I admit I need to document this more: documentation is work-in-progress at the minute but there is at least something on the web page. Perhaps the most significant feature is that I've tried to stay in the qmail spirit by providing loads of error checking so for example if the MySQL server goes down (and we all know that they don't) or if we can't alloc our strallocs, the various tools will return 111 and try again later. Please audit my code and tell me if I'd made any howlers. All of this has been tested on Linux 2.2.1[024] and FreeBSD 3.[13] but feedback is always welcome. -- blurb precedes -- -- #include <sys/types.h> /* #include <sys/socket.h> ? */ int main() { struct in_addr *c = malloc(5); inet_aton("73.97.105.110", c); printf("%s\n", c); }
