Bug 4091 - spamd: "--virtual-config-dir": add support for simple alphabetic hash
Summary: spamd: "--virtual-config-dir": add support for simple alphabetic hash
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 3.0.2
Hardware: All All
: P5 enhancement
Target Milestone: 4.0.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-20 20:34 UTC by brian mastro
Modified: 2019-06-15 20:34 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
patch to add feature mentioned patch None brian mastro [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description brian mastro 2005-01-20 20:34:05 UTC
enhancement: add an option to "--virtual-config-dir=" where if you use %U[1-9]
it'll include [1-9], characters from the $safename variable, so virtual
configurations where path name such as:

/mailhome/b/brian/
/mailhome/c/chris/
/mailhome/be/benny/

are possible.

example:... --virtual-config-dir='/mailhome/%U2/%l'


--- spamd       2005-01-20 21:02:16.000000000 -0500
+++ spamd.new   2005-01-20 21:05:15.000000000 -0500
@@ -1448,6 +1448,7 @@
   my $dir = $opt{'virtual-config-dir'};
   my $userdir;
   my $prefsfile;
+  my $partname;

   if ( defined $dir ) {
     my $safename = $username;
@@ -1459,6 +1460,9 @@
     $dir =~ s/\%u/${safename}/g;
     $dir =~ s/\%l/${localpart}/g;
     $dir =~ s/\%d/${domain}/g;
+    $dir =~ m/\%U(.)/;
+    $partname = substr($safename,0,$1);
+    $dir =~ s/\%U./${partname}/g;
     $dir =~ s/\%\%/\%/g;

     $userdir   = $dir;
Comment 1 brian mastro 2005-01-20 20:35:42 UTC
Created attachment 2613 [details]
patch to add feature mentioned

change anyway you see fit.
Comment 2 Justin Mason 2006-12-12 12:40:23 UTC
moving RFEs and low-priority stuff to 3.3.0 target
Comment 3 Justin Mason 2010-01-27 02:21:19 UTC
moving most remaining 3.3.0 bugs to 3.3.1 milestone
Comment 4 Justin Mason 2010-01-27 03:17:03 UTC
reassigning, too
Comment 5 Justin Mason 2010-03-23 16:34:14 UTC
moving all open 3.3.1 bugs to 3.3.2
Comment 6 Karsten Bräckelmann 2010-03-23 17:43:14 UTC
Moving back off of Security, which got changed by accident during the mass Target Milestone move.
Comment 7 Kevin A. McGrail 2013-06-21 16:14:31 UTC
Moving all open bugs where target is defined and 3.4.0 or lower to 3.4.1 target
Comment 8 Kevin A. McGrail 2015-04-12 14:10:45 UTC
Brian, apologies for the length of time on this.  If you would like to add a bit to the docs for the feature so it isn't just a hidden feature, it looks trivial and I'd commit it.

regards,
KAM
Comment 9 Kevin A. McGrail 2018-09-04 15:04:55 UTC
Needs docs to add.  Moving to 3.4.3