Thanks for this, I was in middle of implementing something like this when I read the post and realized it would work. It did raise a question for me though. If I'm using the valias with mysql, how would I enable those accounts to be check for viruses since vdelivermail would need to be called to have it forward it according to the mysql table? I can't use a .qmail-<alias> file that sends it to the script which then sends it to vdelivermail for the reason you had mentioned.
On Apr 7, 2005 12:41 AM, Kurt Bigler <[EMAIL PROTECTED]> wrote: > on 4/5/05 5:41 PM, Kurt Bigler <[EMAIL PROTECTED]> wrote: > > > on 4/5/05 6:28 AM, Kyle Wheeler <[EMAIL PROTECTED]> wrote: > > > >> | preline yourfilter | maildir /path/to/vpopdomains/`echo $USER | tr A-Z > >> a-z`/`echo $EXT | tr A-Z a-z`/Maildir/ > > > > Thanks, that's great. > > > >>> In the mean time, what is the best (simplest, most reliable) way to > >>> achieve this simplistic delivery functionality? > >> > >> I think "maildir" (or "safecat") is what you want to use. If you think > >> the environment manipulation is a bit much, I agree, but them's the > >> breaks, at the moment. > > > > Ok, but that's not too bad. It just bugs me to have to install yet another > > package, just to do what vpopmail already knows how to do. > > > > But thanks, that's what I needed to know! > > > > But I have a question to the vpopmail developers: > > > > If I were to implement this, as a option to vdelivermail, say: > > > > -d Deliver only. Do not preline and skip all .qmail processing > > > > would you find this to be something worth integrating? I'm not sure that > > I'd have time now, but it seems worth asking the question. > > I actually implemented this in my copy of vdelivermail.c. It was actually > easier than I thought, and there were fewer issues, apparently, although I'm > not intimately familiar enough to know that I haven't missed something. > > Here's what I did: > > I tentatively reclaimed the unused there-for-compatibility command-line > argument 1. If that argument equals '-d', intended to mean "Deliver Only" > (but could also mean Disable .qmail processing), then processing proceeds as > if the .qmail file did not exist, which I guess is just what Kyle Wheeler > was suggesting. That appears to be all there is do it. > > This change allows you do basic filtering in your .qmail files without > needing any of: > > procmail > maildrop > maildir/safecat > > In my book this is a very good thing. It not only avoids the need for > dependencies on extra packages, but offers all the advantages that > vdelivermail already provides, including quota checking. As README.quotas > says: > > > NOTE: Non-system domain quotas are only enforcable when vdelivermail is the > > local delivery agent. If you pipe your mail into anything else, like > > maildrop, then the non-system domain quota will be ignored. > > So with this change, you can now have the following line in your user/.qmail > file: > > | myfilter | vdelivermail -d bounce-no-mailbox > > and it will not result in infinite vdelivermail recursion. And so you can > have a pure-vpopmail solution for your QmailAdmin-enabled Spam Detection > option. > > Here are the changes to vdelivermail.c in vpopmail-5.4.10 needed to > implement this: > > ============================================================== > --- vdelivermail.orig.c Wed Apr 6 05:07:36 2005 > +++ vdelivermail.c Wed Apr 6 05:15:06 2005 > @@ -52,6 +52,7 @@ > struct vqpasswd *vpw; > off_t message_size = 0; > char bounce[AUTH_SIZE]; > +char option[AUTH_SIZE];/*kkb*/ > int CurrentQuotaSizeFd; > > #ifdef QMAIL_EXT > @@ -177,6 +178,11 @@ > vexit(111); > } > > + /*kkb begin*/ > + /* get the obsolete/option argument */ > + strncpy(option, argv[1], sizeof(option)); > + /*kkb end*/ > + > /* get the last parameter in the .qmail-default file */ > strncpy(bounce, argv[2], sizeof(bounce)); > > @@ -733,6 +739,14 @@ > int deliver_err; > > chdir(dir); > + > + /*kkb begin*/ > + if ( strcmp(option, "-d") == 0 ) { > + > + /* feature disabled, so just return */ > + return(-1); > + } > + /*kkb end*/ > > /* format the file name */ > if ( (fs = fopen(".qmail","r")) == NULL ) { > ============================================================== > > It was probably eaiser for me to do that than it would have been to download > and make procmail, maildrop, or safecat! > > If there's not something wrong with this that I'm missing, I'd love to see > this (or something similar) get integrated into vpopmail. > > -Kurt > >