[qmailadmin] Re: help: vpopmail 5.3.20, qmailadmin 1.2.0: cannot change directory

2004-03-18 Thread Jens Benecke
Tom Collins wrote:

 On Mar 18, 2004, at 7:45 AM, Jens Benecke wrote:
 occasionally I have the error Cannot change directory (error #171 in
 
 If it doesn't show a directory name, it's trying to change to an blank
 directory.

I suspected that, yes. :)
 
 Please try upgrading your vpopmail to 5.4.3 -- there have been many
 changes since the 5.3.20 release.  I have no idea if any of them will
 help with this problem or not, but it will be easier to troubleshoot if
 you're up to date.

Can I upgrade to 5.4.3 relatively painlessly, or are there big changes that
need to be taken care of?
 
 For some reason *I* can use the account just normally.
 Only some clients get this error. This is very strange.

 Maybe they're trying to log in without a domain name?  Or the domain is
 in all caps, so it only partially works?  What auth backend do you use
 for vpopmail -- that could help narrow down the problem.

mysql. But the vlog table contains no errors.
 
 I found out that it is doing chdir(RealDir) in the source, but I
 couldn't track where RealDir gets defined.
 It's set by vget_assign().

Yes, but I can't find that function in the qmailadmin source. I'ts probably
included somewhere but I don't know where to look (vpopmail headers?).


-- 
Jens Benecke (jens at spamfreemail.de)
http://www.hitchhikers.de - Europaweite kostenlose Mitfahrzentrale
http://www.spamfreemail.de - 100% saubere Postfächer - garantiert!
http://www.rb-hosting.de - PHP ab 9? - SSH ab 19? - günstiger Traffic
.
Please DO NOT CC: me, I read the lists and newsgroups I post in!



Re: [qmailadmin] spamassassin support quick question

2004-03-18 Thread Rick Widmer


Jeremy Kitchen wrote:

I see that it is in the plans for vpopmail to merge in the new
spamassassin features that Ken has written support for, which is great! 
My question is: qmailadmin already has some spamassassin support, and
I'm trying to modify qmailadmin to support the new spamassassin stuff,
so is it ok to remove the old stuff and put the new stuff in?  Or should
I try to have support for both?

I suggest the goal should be to let vpopmail do the work and make 
qmailadmin as much as possible just a web interface to the vpopmail library.

Rick

p.s.  I am still around, I just blew the engine in my truck and right 
now getting it rebuilt is my top priority.



Re: [qmailadmin] spamassassin support quick question

2004-03-18 Thread Jeremy Kitchen
On Thu, 2004-03-18 at 11:20, Rick Widmer wrote:
 Jeremy Kitchen wrote:
 
  I see that it is in the plans for vpopmail to merge in the new
  spamassassin features that Ken has written support for, which is great! 
  My question is: qmailadmin already has some spamassassin support, and
  I'm trying to modify qmailadmin to support the new spamassassin stuff,
  so is it ok to remove the old stuff and put the new stuff in?  Or should
  I try to have support for both?
  
 
 I suggest the goal should be to let vpopmail do the work and make 
 qmailadmin as much as possible just a web interface to the vpopmail library.

yea, but there's that old spam command stuff which is interfering with
the changes I'm making.

I just wrote it to stomp on the old stuff since we have no customers
actually using the --enable-spam-command stuff, and have high demand for
being able to switch the spamassassin stuff on/off on a per user basis
via qmailadmin.

I'm making a second post to actually post the patch.

-Jeremy

-- 
Jeremy Kitchen
Systems Administrator
[EMAIL PROTECTED]
Kitchen @ #qmail on EFNet - Join the party!
.
Inter7 Internet Technologies, Inc.
www.inter7.com
866.528.3530 toll free
847.492.0470 int'l
847.492.0632 fax
GNUPG key ID: 93BDD6CE



[qmailadmin] qmailadmin spamassassin on/off functionality

2004-03-18 Thread Jeremy Kitchen
So far it's just on/off switch, but it's a start :)

Enjoy.

This is also going to be posted to the qmailadmin sourceforge project
within the hour.

The patch was made against qmailadmin 1.2.0 but I don't forsee any
difficulty with making against any other version.

Beware, if you're using the old method of --enable-spam-command this
patch removes that functionality (the spam command stuff for ./configure
is still there, but none of the functionality is)

Any pre-existing spam command'ed accounts should work fine, this is
simply a patch to go along with the spamc calling in vdelivermail that
Ken posted a few weeks ago.

-Jeremy

-- 
Jeremy Kitchen
Systems Administrator
[EMAIL PROTECTED]
Kitchen @ #qmail on EFNet - Join the party!
.
Inter7 Internet Technologies, Inc.
www.inter7.com
866.528.3530 toll free
847.492.0470 int'l
847.492.0632 fax
GNUPG key ID: 93BDD6CE
diff -urN qmailadmin-1.2.0-orig/template.c qmailadmin-1.2.0-spam/template.c
--- qmailadmin-1.2.0-orig/template.c	2004-01-25 18:41:07.0 -0600
+++ qmailadmin-1.2.0-spam/template.c	2004-03-18 13:19:21.0 -0600
@@ -729,6 +729,13 @@
 return;
   }
 
+  if ( newchar=='9') {
+vpw = vauth_getpw(ActionUser, Domain);
+if (vpw-pw_gid ^ NO_SPAMASSASSIN) {
+	printf(checked );
+}
+  }
+
   if (fs1 == NULL) {
 if (newchar=='0'){
   printf(checked );
@@ -774,33 +781,6 @@
 }
   }
 
-  i = 0;
-  do {
-if (newchar == '3'  (NTmpBuf[0] == '/' ||
-   strstr(NTmpBuf, SPAM_COMMAND)!=NULL) ) {
-  printf(checked );
-  return;
-}
-if ( newchar == '2' ) {
-  if (NTmpBuf[0]=='/') continue;
-  if (NTmpBuf[0]=='|') continue;
-  if ( i0 ) printf(, );
-  if (NTmpBuf[0]=='') {
-printf(%s, strtok(NTmpBuf[1], \n));
-  } else {
-printf(%s, NTmpBuf[0]);
-  } 
-  ++i;
-}
-/* Jeff Hedlund ([EMAIL PROTECTED]) 28 May 2003 */
-/* i9: checked if spam filtering on */
-if ( newchar == '9'  strstr(NTmpBuf, SPAM_COMMAND)!=NULL ) {
-   printf(checked );
-   return;
-}
-  } while(fgets(NTmpBuf,sizeof(NTmpBuf),fs1) != NULL );
-   
-  
   return;
 } else {
 
diff -urN qmailadmin-1.2.0-orig/user.c qmailadmin-1.2.0-spam/user.c
--- qmailadmin-1.2.0-orig/user.c	2004-01-26 12:16:40.0 -0600
+++ qmailadmin-1.2.0-spam/user.c	2004-03-18 13:19:31.0 -0600
@@ -493,11 +493,10 @@
 
 #ifdef MODIFY_SPAM
 GetValue(TmpCGI, spamvalue, spamcheck=, sizeof(spamvalue));
-if(strcmp(spamvalue, on) == 0) {
-   snprintf(NewBuf, sizeof(NewBuf), %s/.qmail, mypw-pw_dir);
-   fs = fopen(NewBuf, w+);
-   fprintf(fs, %s\n, SPAM_COMMAND);
-   fclose(fs);
+if(strcmp(spamvalue, off) == 0) {
+mypw = vauth_getpw(ActionUser, Domain);
+mypw-pw_gid |= NO_SPAMASSASSIN;
+vauth_setpw(mypw, Domain);
 }
 #endif
 
@@ -805,6 +804,7 @@
   }
 #endif
 
+
   GetValue(TmpCGI,Gecos, gecos=, sizeof(Gecos));
   if ( strlen( Gecos ) != 0 ) {
 vpw = vauth_getpw(ActionUser, Domain); 
@@ -857,7 +857,15 @@
 
   /* get value of the spam filter box */
   GetValue(TmpCGI,box, spamcheck=, sizeof(box));
-  if ( strcmp(box,on) == 0 ) spam_check = 1;
+  if ( strcmp(box,on) == 0 ) {
+vpw = vauth_getpw(ActionUser, Domain);
+vpw-pw_gid = ~NO_SPAMASSASSIN;
+vauth_setpw(vpw, Domain);
+  } else {
+vpw = vauth_getpw(ActionUser, Domain);
+vpw-pw_gid |= NO_SPAMASSASSIN;
+vauth_setpw(vpw, Domain);
+  }
 
   /* get the value of the cforward radio button */
   GetValue(TmpCGI,box, cforward=, sizeof(box));
@@ -870,13 +878,6 @@
 snprintf(NewBuf,sizeof(NewBuf),%s/.qmail, vpw-pw_dir);
 unlink(NewBuf);
 
-/* if the mail is to be checked for spam, rewrite the file with command */
-if( spam_check == 1 ) {
-   fs = fopen(NewBuf, w+);
-   fprintf(fs, %s\n, SPAM_COMMAND);
-   fclose(fs);
-}
-
 /* delete any vacation directory */
 snprintf(NewBuf,sizeof(NewBuf),%s/vacation, vpw-pw_dir);
 vdelfiles(NewBuf);
@@ -924,12 +925,7 @@
 /* if they want to save a copy */
 GetValue(TmpCGI,box, fsaved=, sizeof(box));
 if ( strcmp(box,on) == 0 ) {
-  if( spam_check == 1 ) {
-/* if spam check is enabled, that will save the message*/
-fprintf(fs, %s\n, SPAM_COMMAND);
-  } else {
-fprintf(fs,%s/Maildir/\n, vpw-pw_dir);
-  }
+  fprintf(fs,%s/Maildir/\n, vpw-pw_dir);
 } 
 fclose(fs);
 
@@ -958,11 +954,7 @@
 fprintf(fs, | %s/autorespond 86400 3 %s/vacation/message %s/vacation\n,
   AUTORESPOND_PATH, vpw-pw_dir, vpw-pw_dir );
 
-/* save a copy for the user (if checking for spam, it will keep a copy)*/
-if(spam_check==1)
-   fprintf(fs, %s\n, SPAM_COMMAND);
-else
-  fprintf(fs,%s/Maildir/\n, vpw-pw_dir);
+ fprintf(fs,%s/Maildir/\n, vpw-pw_dir);
 fclose(fs);
 
 /* set up the