############################################################# ## Patch for vpopmail to make the mysql logging less verbose ## ## More information regarding this is available at : ## http://bluedot.net/mail/archive/read.php?f=2&i=7140&t=7140 ## This patch mimics suggestion #2 at the above url ## ## Michael Bowe Aug-2002 ############################################################# --- vchkpw.c Mon Feb 4 14:09:14 2002 +++ ../../vpopmail-5.2.1/vchkpw.c Sat Aug 3 12:31:54 2002 @@ -486,10 +486,37 @@ } #ifdef ENABLE_MYSQL_LOGGING /* always log to mysql if mysql logging is enabled and it is not internal error */ + +/* This section removed by MB, to make the vlog logging mimic the syslog logging options if ( (ENABLE_MYSQL_LOGGING > 0) && (verror != VLOG_ERROR_INTERNAL) ) { if ( (logmysql(verror, TheUser, TheDomain, ThePass, TheName, IpAddr, LogLine) ) != 0 ) { syslog(LOG_NOTICE,"vchkpw: can't write MySQL logs"); } } +*/ + +/* This section added by MB, to make the vlog logging mimic the syslog logging options */ +if ( (verror == VLOG_ERROR_PASSWD) && ( ENABLE_LOGGING==1 || ENABLE_LOGGING==2 || ENABLE_LOGGING==3 || ENABLE_LOGGING==4 ) ) { + if ( (logmysql(verror, TheUser, TheDomain, ThePass, TheName, IpAddr, LogLine) ) != 0 ) { + syslog(LOG_NOTICE,"vchkpw: can't write MySQL logs"); + } +} else if ( verror == VLOG_ERROR_INTERNAL ) { + if ( (logmysql(verror, TheUser, TheDomain, ThePass, TheName, IpAddr, LogLine) ) != 0 ) { + syslog(LOG_NOTICE,"vchkpw: can't write MySQL logs"); + } +} else if ( verror == VLOG_ERROR_LOGON ) { + if ( (logmysql(verror, TheUser, TheDomain, ThePass, TheName, IpAddr, LogLine) ) != 0 ) { + syslog(LOG_NOTICE,"vchkpw: can't write MySQL logs"); + } +} else if ( verror == VLOG_ERROR_ACCESS ) { + if ( (logmysql(verror, TheUser, TheDomain, ThePass, TheName, IpAddr, LogLine) ) != 0 ) { + syslog(LOG_NOTICE,"vchkpw: can't write MySQL logs"); + } +} else if ( verror == VLOG_AUTH && ( ENABLE_LOGGING == 1 || ENABLE_LOGGING == 4 ) ) { + if ( (logmysql(verror, TheUser, TheDomain, ThePass, TheName, IpAddr, LogLine) ) != 0 ) { + syslog(LOG_NOTICE,"vchkpw: can't write MySQL logs"); + } +} + #endif }