AHEM! The patch mentioned below had a slight typo in it that would prevent it from working. That's what I get for making One Last Change. Please see the corrected patch attached.
Chris On Wed, 17 Oct 2001, Chris Hardie wrote: > > Hi. This message is in regards to the script posted here: > > http://www.qmail.org/eliminate-dups > > The script's purpose is to eliminate duplicate messages in mail delivery > to a single, catch-all mailbox. This is useful for folks who use > fetchmail-like programs to retrieve the mail via POP and re-deliver it > internally. > > The above script works great for a standard qmail install, but doesn't > work as is for qmail+vpopmail. > > My proposed patch (to make it work ONLY in vpopmail environments) is > attached; please comment. > > The notable changes: > > -Since vpopmail handles multiple domains as one user, we can't assume that > the programs being invoked from within .qmail files will have the > environment/home directory of the virtual domain user, so we have to > specify a full path for the location of the hash file. Each domain needs > its own hash files. > > -The calling method is slightly different to accommodate for vpopmail's > structure; see the patch for details. > > -The MD5 module is now depreciated, see: > http://theoryx5.uwinnipeg.ca/CPAN/data/MD5/README.html > This version uses Digest::MD5. > > I think this will work as is in a qmail+vpopmail environment. > > Note that this contradicts Rusell Nelson's suggestion here: > http://www.ultraviolet.org/mail-archives/qmail.2001/4082.html > > which is why I wanted to make sure I was in my right mind before > proceeding with posting/using/distributing this patch. > > If no one has any changes, I propose posting the "patched" version anew on > the qmail site near the original above link and/or near the vpopmail > section. > > Thanks, > Chris > -- Chris Hardie ----------------------------- ----- mailto:[EMAIL PROTECTED] ---------- -------- http://www.summersault.com/chris/ --
--- eliminate-dups.orig Wed Oct 17 14:02:47 2001 +++ eliminate-dups Wed Oct 17 14:18:29 2001 @@ -1,18 +1,28 @@ #! /usr/bin/perl -# Call from a .qmail file as follows: -# | eliminate-dups hashname -# &user-delivery@domain -#and create a NEW .qmail-delivery file containing +# Modified for use with vpopmail +# by Chris Hardie <[EMAIL PROTECTED]> +# originally by Russell Nelson, http://www.qmail.org/eliminate-dups # -# /home/user/mbox +# Set up ~vpopmail/domains/domain.com/.qmail-default as follows: # -#Now, if delivery to the mbox is deferred, eliminate-dups will NOT be -#run a second time for the same message. +# | /home/vpopmail/bin/vdelivermail '' [EMAIL PROTECTED] +# +# Then create a ~vpopmail/domains/domain.com/.qmail-delivery file as follows: +# +# |bin/eliminate-dups domain.com duphash +# &[EMAIL PROTECTED] +# +# Now, if delivery to the mbox is deferred, eliminate-dups will NOT be +# run a second time for the same message. + +my $basedir = "/home/vpopmail/domains"; -$hashname = shift; +my $domainname = shift; +my $hname = shift; +my $hashname = "$basedir/$domainname/$hname"; -use MD5; -$md5 = new MD5; +use Digest::MD5; +$md5 = new Digest::MD5; $loose = 1; # loose matching if set.