You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/06/02 03:46:14 UTC

svn commit: r179483 - /spamassassin/trunk/spamd/spamd.raw

Author: jm
Date: Wed Jun  1 18:46:13 2005
New Revision: 179483

URL: http://svn.apache.org/viewcvs?rev=179483&view=rev
Log:
bug 4276: look up valias as well when using vpopmail config in spamd, thanks to Daniel Albers <daniel /at/ lbers.com>

Modified:
    spamassassin/trunk/spamd/spamd.raw

Modified: spamassassin/trunk/spamd/spamd.raw
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/spamd/spamd.raw?rev=179483&r1=179482&r2=179483&view=diff
==============================================================================
--- spamassassin/trunk/spamd/spamd.raw (original)
+++ spamassassin/trunk/spamd/spamd.raw Wed Jun  1 18:46:13 2005
@@ -1701,7 +1701,19 @@
   # If vpopmail config enabled then set $dir to virtual homedir
   #
   if ( $opt{'vpopmail'} ) {
-    $dir = `$dir/bin/vuserinfo -d $username`;
+    my $vpopdir = $dir;
+    $dir = `$vpopdir/bin/vuserinfo -d $username`;
+    if ($? != 0) {
+      #
+      # If vuserinfo failed $username could be an alias
+      #
+      $dir = `$vpopdir/bin/valias $username`;
+      if ($? == 0 && $dir !~ /.+ -> &/) {
+        $dir =~ s,.+ -> (/.+)/Maildir/,$1,;
+      } else {
+        undef($dir);
+      }
+    }
     chomp($dir);
   }
   my $cf_file = $dir . "/.spamassassin/user_prefs";