On 2005-08-23, at 0407, Robin Bowes wrote:
John Simpson wrote:
if you can write a plug-in which reads a cdb file, i've already written a script which generates a list of every valid email address on a vpopmail system. i wrote it because i also wrote a patch for qmail-smtpd which checks RCPT TO arguments against the cdb file.

John,

How will this handle extensions?

For example, [EMAIL PROTECTED]

remember i'm talking about two different things. one is a SCRIPT which examines your vpopmail setup and generates a cdb file (actually it generates a text list, which the "cdbmake-12" script can use to create a cdb file.) the other is a PATCH that i've written for qmail which uses the cdb file to determine whether or not to allow RCPT commands.

the script takes what it sees and adds it to the cdb file. for this address, it would add "[EMAIL PROTECTED]" as a key, pointing to null (zero length data.)

the patch i've written for qmail... that's where you will find the logic you seem to be describing. for this example, qmail-smtpd would search the cdb file for the following keys:

    [EMAIL PROTECTED]
    [EMAIL PROTECTED]
    [EMAIL PROTECTED]
    [EMAIL PROTECTED]
    @example.com

and allow the RCPT command to succeed when it sees any of them.

Would I need to strip the extensions and look up [EMAIL PROTECTED]

Also, what about catchall? If a domain has a catch all then I'd need to look it up and use that.

if a domain has a catchall, the script prints a line of the form "@example.com". it determines a "catchall" condition by examining the domain's .qmail-default file. if the file contains "vdelivermail" but not "bounce-no-mailbox", it bypasses the process of searching out individual mailboxes and aliases, and just prints "@example.com". otherwise, it examines the other .qmail-* files, as well as the output of "valias -s example.com", and comes up with a list of the aliases.

How is the cdb generated? Presumably it must be re-created either at regular intervals or whenever users are added/deleted/modified?

i've got a cron job that runs once a minute- it updates a lot of things, running qmail-newmrh and qmail-newu if needed (it examines the timestamps of the relevant files)... it runs the script to generate a text file, diff's it against the current one, and if it has changed, it runs cdbmake-12 to build a new cdb file and then renames the current file so that it becomes the one that will be checked against a minute from now.

it's also listed on my site... look for "cron.qmail".

http://qmail.jms1.net/patches/validrcptto.cdb.shtml explains the patch, and the bottom half of the page talks about the script. if it can help you, feel free...

I can't read your web page as IE is the corporate standard in my workplace and I am not able to change it easily.

hrmmm... maybe you can use this as a reason to make them let you install firefox on your machine, especially if you promise not to un- install IE in the process...

--------------------------------------------------
| John M. Simpson - KG4ZOW - Programmer At Large |
| http://www.jms1.net/           <[EMAIL PROTECTED]> |
--------------------------------------------------
| Mac OS X proves that it's easier to make UNIX  |
| pretty than it is to make Windows secure.      |
--------------------------------------------------


Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to