[vchkpw] Re: Fw: [qmailadmin] aliases to bitbucket
On Tuesday, July 15, 2003, at 10:02 AM, Jeremy Kister wrote: On Tuesday, July 15, 2003 12:07 PM, Tom Collins wrote: Please note! vdelivermail should NEVER be used in .qmail-user files -- it should only appear in the .qmail-default file. I'm not arguing here, just expressing my ignorance... Why? I currently use things like |/usr/local/bin/spamc | /home/vpopmail/bin/vdelivermail '' /home/vpopmail/domains/example.com/username in my .qmail-user files, when i do not want spamc to be invoked for each user in the domain Based on my understanding, vdelivermail has a somewhat deceptive name. Many people (myself included) thought it would just accept the mail and do whatever you requested as the last parameter (bounce-no-mailbox, deleted, directory for delivery, etc.). In reality, vdelivermail uses environment variables set by qmail-local to try to find the appropriate user and deliver the mail to them. It only delivers to the last parameter if it can't find a match. So, as we learned with the 1.0.19 release of qmailadmin, setting up a user fred with a .qmail file containing vdelivermail would result in an infinite loop of vdelivermail calling itself. Here's how: qmail-local looks for .qmail-fred in the domain's directory. Since .qmail-fred doesn't exist, qmail-local delivers the message to .qmail-default which contains vdelivermail. vdelivermail looks for a user fred in the domain's directory. Having found fred, it checks for a .qmail file before just dropping the message in fred's Maildir. Having found a .qmail file, it processes it. The first line of the .qmail file starts with |, indicating program delivery, so vdelivermail sends the message to the program (which is vdelivermail). On the second call, vdelivermail once again looks for a user fred in the domain's directory. Having found fred, it checks for a .qmail file... And we're stuck in a loop. Instead of using vdelivermail, you may need to use maildrop (Jeff Hedlund can provide details on that one) to process the email and drop it in the user's Maildir. It might be helpful to add another program (vstoremail?) to the vpopmail distribution that would accept a message in STDIN and save it to the Maildir specified as the first parameter. Then it would be possible to have entries in your .qmail file like |/usr/local/bin/spamc | /home/vpopmail/bin/vstoremail /home/vpopmail/domains/example.com/fred/Maildir/ vstoremail would take care of file locking/naming/etc. and exit with the proper error code. -- Tom Collins [EMAIL PROTECTED] http://sniffter.com/ - info on the Sniffter hand-held Network Tester
Re: [vchkpw] Re: Fw: [qmailadmin] aliases to bitbucket
On Tue, 15 Jul 2003, Tom Collins wrote: Based on my understanding, vdelivermail has a somewhat deceptive name. Odd you just brought that up. I never touched maildrop before and I was putting together a rule for per-user spam filtering (which is now easy to turn on and off due to your recent changes to qmailadamin, thanks!) and maybe because it was late at night, the vdelivermail line didn't catch my eye. I was going with the assumption it was a generic delivery agent, which I later saw it wasn't. I set up a wicked loop, but svscan here is started with sane limits, so after it iterated the loop 10 times or so it stopped. Many people (myself included) thought it would just accept the mail and do whatever you requested as the last parameter (bounce-no-mailbox, deleted, directory for delivery, etc.). Heh heh. In reality, vdelivermail uses environment variables set by qmail-local to try to find the appropriate user and deliver the mail to them. It only delivers to the last parameter if it can't find a match. This brings up another question. Right now my maildrop has an ugly hack to determine the directory. Is there a list anywhere of the environment variables that vdelivermail passes to the next program in line? I'm doing this: VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED] That seems so bogus and unnecessary; I'm invoking yet another program making for a total of 6 program startups just to deliver a single piece of mail (original qmail delivery, vdelivermail, preline, maildrop, spamc, vuserinfo). Correct? I need to draw up a map for myself similar to the Qmail Big Picture to make sure I'm getting all this right. Is that homedir value not known by vdelivermail? It seems like it should be there... Instead of using vdelivermail, you may need to use maildrop (Jeff Hedlund can provide details on that one) to process the email and drop it in the user's Maildir. This works well (once you get the homedir location). It might be helpful to add another program (vstoremail?) to the vpopmail distribution that would accept a message in STDIN and save it to the Maildir specified as the first parameter. Then it would be possible to have entries in your .qmail file like |/usr/local/bin/spamc | /home/vpopmail/bin/vstoremail /home/vpopmail/domains/example.com/fred/Maildir/ I think that might be unnecessary. Maildrop (or procmail) should suffice for the final delivery... vstoremail would take care of file locking/naming/etc. and exit with the proper error code. Maildrop should do this too... What do you think? I propose tweaking vdelivermail a bit would be a better use of your time (and I'd love to see you clean up that code like you have qmailadmin, that's a stunning CHANGELOG you've got going). Thoughts? Charles -- Tom Collins [EMAIL PROTECTED] http://sniffter.com/ - info on the Sniffter hand-held Network Tester