On 2005-11-28, at 0715, Robin Bowes wrote:
John Simpson said the following on 27/11/2005 23:40:and a suggestion: how about adding a "exists [EMAIL PROTECTED]" command, which would check whether the address is "deliverable"(meaning it exists as a mailbox, an alias, a ".qmail- mailbox" file in the domain's directory, or the domain has a ".qmail- default" file which doesn't contain "bounce-no-mailbox") and return a yes/no answer of somekind... and that one command would not require a valid login to use.I'd also find something like this useful.
i actually found vpopmaild.c and a "README.vpopmaild" file which "sorta" documents the protocol, in the vpopmail CVS area. my problem is that i haven't spent a lot of time dealing with vpopmail's internal data structures, and to be honest their variable naming scheme (i.e. "TheDomain", "ThePassword", etc.) just feels too "microsoft-ish" for me. i know it's legal and it works, it just leaves me feeling like i need to wash my hands after i look at it...
what i'm wondering is this- if all it uses is the functions exposed through libvpopmail, it should be possible to make it a separate package for those who need it. it would be usable for a qmail SMTP AUTH patch (qmail-smtpd would connect, send a "login" command, see if the first byte of the response is "+" or "-", then send a "quit" and disconnect) and with as many commands as are there, it looks like qmailadmin could use it instead of having to be compiled against libvpopmail, same for vqadmin (which REALLY needs updating), and anybody who wanted to roll their own program could use it as well.
another idea which occurred to me last night when i wrote that email, was a server that "worked the same" as vpopmaild (in terms of the command/response structure through the socket) but instead of calling libvpopmail functions, it would call courier-authlib functions. i threw together a quick-n-dirty little program that supports "login", "help", and "quit", and i plan on using this to test my qmail-smtpd patch- and once vpopmaild is ready for prime time (either as part of the main vpopmail package, or as a stand-alone package) a user with my patch would be able to use either vpopmaild or my "courierauthd" program, depending on their needs.
where this is all going... i would like to write a patch for qmail- smtpd which would use vpopmaild to replace both the need for an AUTH handler to fork/exec a checkpassword program,I've already writen an auth plugin for qpsmtpd using vpopmaild...
googling for "qpsmtpd vpopmaild" only brings back two archived posts from this mailing list- and i think you wrote both of them. is there a URL where i can look at the code? i won't be able to directly copy it (my patch will be in C rather than perl) but having a known reference to look at will help me to make sure i'm on the right track.
and my own "validrcptto.cdb" patch (which rejects mail sent to non-existentmailboxes, uses a cdb file containing every valid email address on thesystem, and correctly handles "-default" aliases... http://qmail.jms1.net/patches/validrcptto.cdb.shtml has more information aboutthe patch.)... and it would be nice to add a validrcptto plugin using vpopmaild.
one of the reasons i wrote it to use a cdb file was that the cdb file could be scp'd out to "mailhubs", which would be able to reject mail to non-existent mailboxes in domains which exist, without having to call back to the mailbox server at all. sure, there's a delay between the mailbox being added (or password being changed) and the servers "knowing" about the change, but you can use a cron job or a background service to compare timestamps and rebuild and copy cdb files as needed- my own server sees any changes within fifteen seconds.
as for writing a plug-in for validrcptto... it would actually be really easy in perl. the trick is to correctly handle "-default" aliases, and that's just a loop which does regex transforms to walk through a series of addresses...
[EMAIL PROTECTED] (the original address) [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]@domain.xyz (if the domain's .qmail-default !~ /vdelivermail.*bounce \-no\-mailbox/ )
it tries each address in turn. once it finds a match (from a cdb file, a libvpopmail function, a courier-authlib function, or whatever flavour of voodoo you practice) it accepts the recipient. if it reaches the end of the list without finding any matches, the recipient is rejected. if you look at qmail-smtpd.c with the validrcptto.cdb patch, the logic is there in the vrtcheck() function (it's in C, and uses djb's string functions, but once you get used to them the logic is fairly straightforward.)
-------------------------------------------------- | 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. | --------------------------------------------------
Description: This is a digitally signed message part