Re: [vchkpw] vpopmail problem

2006-09-03 Thread tonix (Antonio Nati)

At 10.56 03/09/2006, you wrote:

Hi all

Some help please

We are running a mail server at one of our clients and have picked up
the following error when using squirrel mail.

Sep  3 10:44:41 mail imapd: LOGIN FAILED, [EMAIL PROTECTED],
ip=[127.0.0.1]
Sep  3 10:44:41 mail authdaemond: vmysql: sql error[3]: MySQL server has
gone away
Sep  3 10:44:46 mail imapd: LOGOUT, ip=[127.0.0.1], rcvd=52, sent=332

we are running the following

apache+mod_ssl-1.3.34+2.8.25_3
courier-authlib-base-0.58_2
courier-authlib-vchkpw-0.58_2
courier-imap-4.1.0,1 IMAP
qmail
freebsd 6.1


Last versions of MySQL now have a general timeout on the connection.

You should patch vpopmail with the following patch, and recompile all 
(vpopmail, courier-authlib) in order to solve the problem.

This patch should be also in latest vpopmail release (if I remember fine).

See following message and attached patch:

Date: Mon, 29 May 2006 10:05:09 -0400
From: Ron Gage [EMAIL PROTECTED]
To: vchkpw@inter7.com
User-Agent: Internet Messaging Program (IMP) H3 (4.0.3)
Subject: [vchkpw] [bug][patch] - vchkpw/vmysql and Mysql 5

Greetings:

I don't know if anyone in here is encountering this problem (yet), but it has
been affecting me for the past few weeks - ever since I upgraded my MySQL
server to 5.0.19.  It took quite a bit of digging, but I believe I have found
the problem.

To describe the problem: when you run vpopmail in MySQL mode, with
courier-authdaemond and MySQL v5.0 or later, you will find that for the first 8
hours, everything works just fine, but after 8 hours, nobody will be able to
authenticate to the email server and you will see MySQL server has gone away
errors in the maillog.

The cause of the problem is that in MySQL 5.0 (and probably some 4.1 releases),
MySQL implements a new timeout definition for connections, a timeout that
ignores traffic.  This timeout will shut down the socket thread from the MySQL
side.  The problem is that the client (vchkpw and friends) do not
know/understand about this timeout and socket termination so they continue on
in ignorate bliss until they try to send to the socket and find that it's no
longer valid - literally the server has gone away.

The fix is to simply destroy the internal flags and file handles 
related to that

socket, rebuild a new one, and try again.

The included patch (inline and attached) implements this fix.  Please note that
there doesn't appear to be any way at this time to disable the timeout feature
in MySQL.

Please feel free to comment, tear apart, beat up, or otherwise rip to 
shreads my

fix!



--
Ron Gage
(LPIC1 MCP A+ Net+)
Westland, Michigan



--- vmysql.c~   2006-05-29 10:17:20.0 -0400
+++ vmysql.c2006-05-29 10:17:20.0 -0400
@@ -465,7 +465,31 @@
 );
 if (mysql_query(mysql_read,SqlBufRead)) {
 fprintf(stderr, vmysql: sql error[3]: %s\n,
mysql_error(mysql_read));
-return(NULL);
+/* Ron Gage - May 29, 2006 - With newer versions of MySQL, there is
such a thing
+as a connection timeout regardless of activity.  By default 
under MySQL

5, this
+timeout is 28800 seconds (8 hours).  If your vpopmail system runs fine
for the
+first 8 hours, then stops authenticating, this timeout is your problem
(especially
+under authdaemond).
+
+What this code does is when an error is encountered, it first tries to
drop and
+rebuild a connection to the SQL server and tries again.  If 
this second

attempt
+fails, then something other than the connection timeout is 
the problem.

 This fix
+need to be implemented in other places but in my setup 
(Slackware 10.2,

netqmail,
+vpopmail, courier-authdaemond, courier-imapd and a few 
others), this is

always where
+the auth attempt died with a SQL server has gone away error.
+*/
+
+fprintf(stderr, Attempting to rebuild connection to SQL server\n);
+vclose();
+verrori = 0;
+if ( (err=vauth_open_read()) != 0 ) {
+  verrori = err;
+  return(NULL);
+}
+if (mysql_query(mysql_read, SqlBufRead)) {
+  fprintf (stderr, vmysql: connection rebuild failed: %s\n,
mysql_error(mysql_read));
+  return(NULL);
+}
 }

 if (!(res_read = mysql_store_result(mysql_read))) {



--- vmysql.c~   2006-05-29 10:17:20.0 -0400
+++ vmysql.c2006-05-29 10:17:20.0 -0400
@@ -465,7 +465,31 @@
 );
 if (mysql_query(mysql_read,SqlBufRead)) {
 fprintf(stderr, vmysql: sql error[3]: %s\n, 
mysql_error(mysql_read));
-return(NULL);
+/* Ron Gage - May 29, 2006 - With newer versions of MySQL, there is 
such a thing
+as a connection timeout regardless of activity.  By default under 
MySQL 5, this
+timeout is 28800 seconds (8 hours).  If your vpopmail system runs fine 
for the
+first 8 hours, then stops authenticating, this timeout is your problem 
(especially
+under authdaemond).
+ 

Re: [vchkpw] vpopmail problem

2005-01-08 Thread focuz info
Hai all,
Thanks for your reply.
Now one more problem occured. I have setup procmail in all users directory. 
There will  be
.qmail-guest . in /home/vpopmail/domains/test.com/.This file is like this
| preline procmail -t ./guest/Maildir/Procmail/procmailrc

In procmail folder procmailrc file is like this
SHELL=/bin/sh
PMDIR=./guest/Maildir/Procmail
LOGFILE=$PMDIR/pmlog
VERBOSE=on
:0
*
./guest/Maildir/
this syntax i  was  following till number of users were below 100. Filtering 
with procmail was also working for users below 100. Now after 100 users i 
added the .qmail-username file,procmailrc file but filtering is not  
working. I had checked the filepaths in procmailrc files, it was currect..
Please suggest me a solution why the filtering with procmail was not working 
for   users created after  100.
Thanks for any help

From: [EMAIL PROTECTED] (Eric Ziegast)
Reply-To: vchkpw@inter7.com
To: vchkpw@inter7.com
Subject: Re: [vchkpw] vpopmail problem Date: Thu, 30 Dec 2004 06:14:30 
-0800

 Can anyone suggest me solution why user directoy are created  in
 /home/vpopmail/domains/domainname/0/   - folder.
This is explained well in the README file that comes with vpopmail.
Look for user directory structure.
Imagine test.com when it gets up to 500 or 5000 or 5 users.
To have all of the users in one directory is not efficient on
all filesystems so vpopmail automatically uses hashing to break
user directories out into subdirectories after the first 100
users.  If I had a script to create vadduser user1 up to
user25000, I might find the user hashing to look like...
/home/vpopmail/domains/DOMAIN/__/Maildir
  user1
  user2
  ...
  user99
  user100
  0/user101
  0/user102
  ...
  0/user199
  0/user200
  1/user201
  1/user202
  ...
  9/user999
  9/user1000
  A/user1001
  ...
  Z/user3600
  a/user3601
  ...
  z/user6200
  0/0/user6201
  ...
  0/z/user12400
  1/0/user12401
  ...
  1/z/user24800
  2/0/user24801
  ...
  2/1/user25000
Instead of assuming that a user's Maildir is in the directory
cd /home/vpopmail/domains/$DOMAIN/$USER/Maildir, Vpopmail
administrators typically use cd `vuserinfo -d [EMAIL PROTECTED],
or even safer, cd `vuserdir [EMAIL PROTECTED].
  #!/bin/sh
  # WARNING: untested code - use at your own risk
  #
  # vuserdir - print out the vpopmail directory for a user
  #or . if it does not exist.
  #
  # Syntax: vuserdir address
  #
  address=$1
  if [ $address = '' ]
  then
echo vuserdir: No address specified 12
echo .
exit 1
  fi
  dir=`vuserinfo -d $address`
  if [ $? = 0 -a -d $dir ]
  then
echo $dir
  else
echo vuserdir: Directory for $address not found: $dir 12
echo .
exit 1
  fi
The hashing is controled by the OPEN_BIG_DIR define in vpopmail's
config.h.  If you never intend to use large user directories (*),
then commenting this out the define before installing might avoid
this behavior, or you can compile MAX_USERS_PER_LEVEL (in vauth.h)
to be a really high number.
Best practice, though, would have you use directory hashing just
like everyone else.  Imagine that someday someone else withh have
to take over your qmail/vpopmail installation and worry about your
local customizations.  It becomes difficult for them to upgrade to
the next version of vpopmail if they have to patch the code each
time.
The directory hashing is also used on domains.  So if you add more
than 100 domains, you'll see /home/vpopmail/domains/0.
--
Eric Ziegast
[EMAIL PROTECTED]
(*) Back in the 80's someone said, No one will ever need more than
640 kilobytes of memory.
_
The MS Office product suite. Make efficiency a habit. 
http://www.microsoft.com/india/office/experience/  Simplify your life.



Re: [vchkpw] vpopmail problem

2005-01-08 Thread focuz info
Hai all,
Thanks for your reply.
Now one more problem occured. I have setup procmail in all users directory. 
There will  be
.qmail-guest . in /home/vpopmail/domains/test.com/.This file is like this
| preline procmail -t ./guest/Maildir/Procmail/procmailrc

In procmail folder procmailrc file is like this
SHELL=/bin/sh
PMDIR=./guest/Maildir/Procmail
LOGFILE=$PMDIR/pmlog
VERBOSE=on
:0
*
./guest/Maildir/
this syntax i  was  following till number of users were below 100. Filtering 
with procmail was also working for users below 100. Now after 100 users i 
added the .qmail-username file,procmailrc file but filtering is not  
working. I had checked the filepaths in procmailrc files, it was currect..
Please suggest me a solution why the filtering with procmail was not working 
for   users created after  100.
Thanks for any help

From: [EMAIL PROTECTED] (Eric Ziegast)
Reply-To: vchkpw@inter7.com
To: vchkpw@inter7.com
Subject: Re: [vchkpw] vpopmail problem Date: Thu, 30 Dec 2004 06:14:30 
-0800

 Can anyone suggest me solution why user directoy are created  in
 /home/vpopmail/domains/domainname/0/   - folder.
This is explained well in the README file that comes with vpopmail.
Look for user directory structure.
Imagine test.com when it gets up to 500 or 5000 or 5 users.
To have all of the users in one directory is not efficient on
all filesystems so vpopmail automatically uses hashing to break
user directories out into subdirectories after the first 100
users.  If I had a script to create vadduser user1 up to
user25000, I might find the user hashing to look like...
/home/vpopmail/domains/DOMAIN/__/Maildir
  user1
  user2
  ...
  user99
  user100
  0/user101
  0/user102
  ...
  0/user199
  0/user200
  1/user201
  1/user202
  ...
  9/user999
  9/user1000
  A/user1001
  ...
  Z/user3600
  a/user3601
  ...
  z/user6200
  0/0/user6201
  ...
  0/z/user12400
  1/0/user12401
  ...
  1/z/user24800
  2/0/user24801
  ...
  2/1/user25000
Instead of assuming that a user's Maildir is in the directory
cd /home/vpopmail/domains/$DOMAIN/$USER/Maildir, Vpopmail
administrators typically use cd `vuserinfo -d [EMAIL PROTECTED],
or even safer, cd `vuserdir [EMAIL PROTECTED].
  #!/bin/sh
  # WARNING: untested code - use at your own risk
  #
  # vuserdir - print out the vpopmail directory for a user
  #or . if it does not exist.
  #
  # Syntax: vuserdir address
  #
  address=$1
  if [ $address = '' ]
  then
echo vuserdir: No address specified 12
echo .
exit 1
  fi
  dir=`vuserinfo -d $address`
  if [ $? = 0 -a -d $dir ]
  then
echo $dir
  else
echo vuserdir: Directory for $address not found: $dir 12
echo .
exit 1
  fi
The hashing is controled by the OPEN_BIG_DIR define in vpopmail's
config.h.  If you never intend to use large user directories (*),
then commenting this out the define before installing might avoid
this behavior, or you can compile MAX_USERS_PER_LEVEL (in vauth.h)
to be a really high number.
Best practice, though, would have you use directory hashing just
like everyone else.  Imagine that someday someone else withh have
to take over your qmail/vpopmail installation and worry about your
local customizations.  It becomes difficult for them to upgrade to
the next version of vpopmail if they have to patch the code each
time.
The directory hashing is also used on domains.  So if you add more
than 100 domains, you'll see /home/vpopmail/domains/0.
--
Eric Ziegast
[EMAIL PROTECTED]
(*) Back in the 80's someone said, No one will ever need more than
640 kilobytes of memory.
_
Manage information better. Optimise your tasks. 
http://www.microsoft.com/india/office/experience/  Experience MS Office 
System.



Re: [vchkpw] vpopmail problem

2005-01-03 Thread Charles Sprickman
On Thu, 30 Dec 2004, Eric Ziegast wrote:
Instead of assuming that a user's Maildir is in the directory
cd /home/vpopmail/domains/$DOMAIN/$USER/Maildir, Vpopmail
administrators typically use cd `vuserinfo -d [EMAIL PROTECTED],
or even safer, cd `vuserdir [EMAIL PROTECTED].
I have something like this in my .bashrc file:
cdd () { cd `vdominfo -d $@`; }
cdu () { cd `vuserinfo -d $@`/Maildir; }
vdd () { vdominfo $@; }
vdu () { vuserinfo $@; }
lsd () { ls -al `vdominfo -d $@`; }
lsu () { ls -al `vuserinfo -d $@`; }
Works well and cuts down on typing...
Charles
--
Eric Ziegast
[EMAIL PROTECTED]
(*) Back in the 80's someone said, No one will ever need more than
   640 kilobytes of memory.


Re: [vchkpw] vpopmail problem

2004-12-30 Thread Eric Ziegast
 Can anyone suggest me solution why user directoy are created  in 
 /home/vpopmail/domains/domainname/0/   - folder.

This is explained well in the README file that comes with vpopmail.
Look for user directory structure.

Imagine test.com when it gets up to 500 or 5000 or 5 users.
To have all of the users in one directory is not efficient on
all filesystems so vpopmail automatically uses hashing to break
user directories out into subdirectories after the first 100
users.  If I had a script to create vadduser user1 up to
user25000, I might find the user hashing to look like...

/home/vpopmail/domains/DOMAIN/__/Maildir
  user1
  user2
  ...
  user99
  user100
  0/user101
  0/user102
  ...
  0/user199
  0/user200
  1/user201
  1/user202
  ...
  9/user999
  9/user1000
  A/user1001
  ...
  Z/user3600
  a/user3601
  ...
  z/user6200
  0/0/user6201
  ...
  0/z/user12400
  1/0/user12401
  ...
  1/z/user24800
  2/0/user24801
  ...
  2/1/user25000
  

Instead of assuming that a user's Maildir is in the directory
cd /home/vpopmail/domains/$DOMAIN/$USER/Maildir, Vpopmail
administrators typically use cd `vuserinfo -d [EMAIL PROTECTED],
or even safer, cd `vuserdir [EMAIL PROTECTED].

  #!/bin/sh
  # WARNING: untested code - use at your own risk
  #
  # vuserdir - print out the vpopmail directory for a user
  #or . if it does not exist.
  #
  # Syntax: vuserdir address
  #
  address=$1
  if [ $address = '' ]
  then
echo vuserdir: No address specified 12
echo .
exit 1
  fi
  dir=`vuserinfo -d $address`
  if [ $? = 0 -a -d $dir ]
  then
echo $dir
  else
echo vuserdir: Directory for $address not found: $dir 12
echo .
exit 1
  fi


The hashing is controled by the OPEN_BIG_DIR define in vpopmail's
config.h.  If you never intend to use large user directories (*),
then commenting this out the define before installing might avoid
this behavior, or you can compile MAX_USERS_PER_LEVEL (in vauth.h)
to be a really high number.

Best practice, though, would have you use directory hashing just
like everyone else.  Imagine that someday someone else withh have
to take over your qmail/vpopmail installation and worry about your
local customizations.  It becomes difficult for them to upgrade to
the next version of vpopmail if they have to patch the code each
time.

The directory hashing is also used on domains.  So if you add more
than 100 domains, you'll see /home/vpopmail/domains/0.

--
Eric Ziegast
[EMAIL PROTECTED]

(*) Back in the 80's someone said, No one will ever need more than
640 kilobytes of memory.


Re: [vchkpw] vpopmail problem

2004-12-30 Thread Kiril Todorov
focuz info wrote:
... a lot.
What problem are you trying to solve actually?
--
'Can death be sleep, when life is but a dream'  --John Keats
/* waiting... dreaming... wishing... */


signature.asc
Description: OpenPGP digital signature


Re: [vchkpw] Vpopmail problem / Probleme avec Vpopmail

2003-11-12 Thread Tom Collins
On Thursday, November 13, 2003, at 07:24  AM, Tanen wrote:
Im getting this error message when i try to use one of command of vpopmail who use MySQL,

Can someone know why ?



Error Message



vmysql: sql error[3]: Access denied for user: '[EMAIL PROTECTED]' to database 'vpopmail'

Try editing ~vpopmail/etc/vpopmail.mysql and setting the username and password of the mysql user that you created for vpopmail's use.

--
Tom Collins  -  [EMAIL PROTECTED]
Note: The Tom Logic offices will be closed through November 18.
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/ 
Info on the Sniffter hand-held Network Tester: http://sniffter.com/



Re: [vchkpw] Vpopmail problem in mysql

2003-08-28 Thread Tobias



Check the file ~vpopmail/etc/vpopmail.mysql that 
the password or the other things are correct.

//Tobias

  - Original Message - 
  From: 
  Zafar Rizvi 
  
  To: [EMAIL PROTECTED] 
  Sent: Thursday, August 28, 2003 5:43 
  PM
  Subject: [vchkpw] Vpopmail problem in 
  mysql
  
  Hi All
   I am 
  installing Qmail on redhat 8 with vpopmail.
  I have two server running for qmail.I have one 
  server Qmail server and on other Qmail server, database(mysql)  qmail is 
  running. Now on both Qmail machine vpopmail is installed with mysql database 
  support and it is configured fine till.
  One standalone qmail server , if we add a domain 
  it successfully created and deleted with other server database support.( means 
  all data stored on other qmail server on which mysql is also 
  running).
  But on which mysql is running and also on it 
  qmail is running and vpopmail in installed with mysql support with same 
  configuration as on other qmail standalone server. Now Problem.
  when i add any domain on this server, it give me 
  error of mysql but creae also. Here is the Error i got.
  **
  [EMAIL PROTECTED] domains]# 
  /home/vpopmail/bin/vadddomain zafar.comPlease enter password for 
  postmaster:enter password again:vmysql: sql error[c]: Access denied 
  for user: '[EMAIL PROTECTED]' to 
  database 'vpopmail1'vmysql: sql error[c]: Access denied for user: '[EMAIL PROTECTED]' to database 
  'vpopmail1'vmysql: sql error[b]: Access denied for user: '[EMAIL PROTECTED]' to database 
  'vpopmail1'vmysql: sql error[3]: Access denied for user: '[EMAIL PROTECTED]' to database 
  'vpopmail1'vmysql: sql error[c]: Access denied for user: '[EMAIL PROTECTED]' to database 
  'vpopmail1'vmysql: sql error[c]: Access denied for user: '[EMAIL PROTECTED]' to database 
  'vpopmail1'vmysql: sql error[b]: Access denied for user: '[EMAIL PROTECTED]' to database 
  'vpopmail1'vmysql: sql error[3]: Access denied for user: '[EMAIL PROTECTED]' to database 
  'vpopmail1'vmysql: sql error[2]: Access denied for user: '[EMAIL PROTECTED]' to database 
  'vpopmail1'Error: Unable to chdir to vpopmail/users 
  directory
  **
  Although when i connect database with that username ,host on that sever 
  it connecting but with vpopmail it generation error, Anbody has idea about 
  that problem.
  
  Waiting for a reply
  Thanks
  ZAfar__ NOD32 1.495 
  (20030827) Information __This message was checked by NOD32 
  Antivirus System.http://www.nod32.com


RE: [vchkpw] Vpopmail problem in mysql

2003-08-28 Thread Shane Chrisp
Title: Message



Also 
check that the user you are connectingto mysql with, that access's the 
vpopmail database has access from 192.168.0.3. You may have only configured the 
user to have access from localhost on the qmail/mysql server

Shane

  
  -Original Message-From: Tobias 
  [mailto:[EMAIL PROTECTED] Sent: Thursday, 28 August 2003 
  11:39 PMTo: Zafar Rizvi; [EMAIL PROTECTED]Subject: Re: 
  [vchkpw] Vpopmail problem in mysql
  Check the file ~vpopmail/etc/vpopmail.mysql that 
  the password or the other things are correct.
  
  //Tobias
  
- Original Message - 
From: 
Zafar Rizvi 

To: [EMAIL PROTECTED] 
Sent: Thursday, August 28, 2003 5:43 
PM
Subject: [vchkpw] Vpopmail problem in 
mysql

Hi All
 I am 
installing Qmail on redhat 8 with vpopmail.
I have two server running for qmail.I have one 
server Qmail server and on other Qmail server, database(mysql)  qmail 
is running. Now on both Qmail machine vpopmail is installed with mysql 
database support and it is configured fine till.
One standalone qmail server , if we add a 
domain it successfully created and deleted with other server database 
support.( means all data stored on other qmail server on which mysql is also 
running).
But on which mysql is running and also on it 
qmail is running and vpopmail in installed with mysql support with same 
configuration as on other qmail standalone server. Now Problem.
when i add any domain on this server, it give 
me error of mysql but creae also. Here is the Error i got.
**
[EMAIL PROTECTED] domains]# 
/home/vpopmail/bin/vadddomain zafar.comPlease enter password for 
postmaster:enter password again:vmysql: sql error[c]: Access denied 
for user: '[EMAIL PROTECTED]' to 
database 'vpopmail1'vmysql: sql error[c]: Access denied for user: '[EMAIL PROTECTED]' to database 
'vpopmail1'vmysql: sql error[b]: Access denied for user: '[EMAIL PROTECTED]' to database 
'vpopmail1'vmysql: sql error[3]: Access denied for user: '[EMAIL PROTECTED]' to database 
'vpopmail1'vmysql: sql error[c]: Access denied for user: '[EMAIL PROTECTED]' to database 
'vpopmail1'vmysql: sql error[c]: Access denied for user: '[EMAIL PROTECTED]' to database 
'vpopmail1'vmysql: sql error[b]: Access denied for user: '[EMAIL PROTECTED]' to database 
'vpopmail1'vmysql: sql error[3]: Access denied for user: '[EMAIL PROTECTED]' to database 
'vpopmail1'vmysql: sql error[2]: Access denied for user: '[EMAIL PROTECTED]' to database 
'vpopmail1'Error: Unable to chdir to vpopmail/users 
directory
**
Although when i connect database with that username ,host on that sever 
it connecting but with vpopmail it generation error, Anbody has idea about 
that problem.

Waiting for a reply
Thanks
ZAfar__ NOD32 
1.495 (20030827) Information __This message was checked by 
NOD32 Antivirus System.http://www.nod32.com