Re: [qmailtoaster] Odd error in dovecot.log
Well, that makes sense. My mail server is constantly hammered with brute force attacks that don't include domain names. On Tue, Nov 7, 2017 at 6:50 AM, Eric Brochwrote: > Yes, it is odd. But even so it will happen if the domain field is empty, > for whatever reason. If the domain field is empty it will look for the > vpopmail.users db which in our case doesn't exist. > > > > On 11/7/2017 7:12 AM, Boheme wrote: > >> Well, I get why it was establishing a connection, as I had just restarted >> dovecot. Just seemed odd that it was trying to access a table that doesn’t >> exist. But if legacy code from before the table-per-domain refactoring if >> the vpopmail DB layout? >> >> -Sent from my Pip-Boy 3000 >> >> On Nov 7, 2017, at 5:08 AM, Eric Broch wrote: >>> >>> Here's the explanation in the code as a result of the 'mysql_query' and >>> 'mysql_error' call: >>> >>> if (mysql_query(_read,SqlBufRead)) { >>> fprintf(stderr, "vmysql: sql error[3]: %s\n", >>> mysql_error(_read)); >>> /* - 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(_read, SqlBufRead)) { >>>fprintf (stderr, "vmysql: connection rebuild failed: %s\n", >>> mysql_error(_read)); >>>return(NULL); >>> } >>> } >>> >>> Not sure why mysql (mariadb) would return this error. >>> >>> Eric >>> >>> >>> On 11/7/2017 5:47 AM, Eric Broch wrote: That's a good question, Chris. I'll have to delve into the code. On 11/6/2017 9:57 PM, Chris wrote: > Given that the new DB structure for vpopmail involves having a > separate table for each domain, I thought seeing this in my dovecot.log > was > a little weird: > > Nov 06 20:53:43 auth-worker: Error: vmysql: sql error[3]: Table > 'vpopmail.users' doesn't exist > Nov 06 20:53:43 auth-worker: Error: Attempting to rebuild connection > to SQL server > Nov 06 20:53:43 auth-worker: Error: vmysql: connection rebuild failed: > Table 'vpopmail.users' doesn't exist > > Any idea why vmysql is trying to access the users table in the > vpopmail db, given that it doesn't exist? > > -Chris > -- >>> Eric Broch >>> White Horse Technical Consulting (WHTC) >>> >>> >>> - >>> To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com >>> For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com >>> >>> - >> To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com >> For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com >> >> > -- > Eric Broch > White Horse Technical Consulting (WHTC) > > > - > To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com > For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com > >
Re: [qmailtoaster] Odd error in dovecot.log
Yes, it is odd. But even so it will happen if the domain field is empty, for whatever reason. If the domain field is empty it will look for the vpopmail.users db which in our case doesn't exist. On 11/7/2017 7:12 AM, Boheme wrote: Well, I get why it was establishing a connection, as I had just restarted dovecot. Just seemed odd that it was trying to access a table that doesn’t exist. But if legacy code from before the table-per-domain refactoring if the vpopmail DB layout? -Sent from my Pip-Boy 3000 On Nov 7, 2017, at 5:08 AM, Eric Brochwrote: Here's the explanation in the code as a result of the 'mysql_query' and 'mysql_error' call: if (mysql_query(_read,SqlBufRead)) { fprintf(stderr, "vmysql: sql error[3]: %s\n", mysql_error(_read)); /* - 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(_read, SqlBufRead)) { fprintf (stderr, "vmysql: connection rebuild failed: %s\n", mysql_error(_read)); return(NULL); } } Not sure why mysql (mariadb) would return this error. Eric On 11/7/2017 5:47 AM, Eric Broch wrote: That's a good question, Chris. I'll have to delve into the code. On 11/6/2017 9:57 PM, Chris wrote: Given that the new DB structure for vpopmail involves having a separate table for each domain, I thought seeing this in my dovecot.log was a little weird: Nov 06 20:53:43 auth-worker: Error: vmysql: sql error[3]: Table 'vpopmail.users' doesn't exist Nov 06 20:53:43 auth-worker: Error: Attempting to rebuild connection to SQL server Nov 06 20:53:43 auth-worker: Error: vmysql: connection rebuild failed: Table 'vpopmail.users' doesn't exist Any idea why vmysql is trying to access the users table in the vpopmail db, given that it doesn't exist? -Chris -- Eric Broch White Horse Technical Consulting (WHTC) - To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com - To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com -- Eric Broch White Horse Technical Consulting (WHTC) - To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com
Re: [qmailtoaster] Odd error in dovecot.log
Well, I get why it was establishing a connection, as I had just restarted dovecot. Just seemed odd that it was trying to access a table that doesn’t exist. But if legacy code from before the table-per-domain refactoring if the vpopmail DB layout? -Sent from my Pip-Boy 3000 > On Nov 7, 2017, at 5:08 AM, Eric Brochwrote: > > Here's the explanation in the code as a result of the 'mysql_query' and > 'mysql_error' call: > > if (mysql_query(_read,SqlBufRead)) { > fprintf(stderr, "vmysql: sql error[3]: %s\n", > mysql_error(_read)); > /* - 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(_read, SqlBufRead)) { > fprintf (stderr, "vmysql: connection rebuild failed: %s\n", > mysql_error(_read)); > return(NULL); > } > } > > Not sure why mysql (mariadb) would return this error. > > Eric > > >> On 11/7/2017 5:47 AM, Eric Broch wrote: >> That's a good question, Chris. I'll have to delve into the code. >> >> >>> On 11/6/2017 9:57 PM, Chris wrote: >>> Given that the new DB structure for vpopmail involves having a separate >>> table for each domain, I thought seeing this in my dovecot.log was a little >>> weird: >>> >>> Nov 06 20:53:43 auth-worker: Error: vmysql: sql error[3]: Table >>> 'vpopmail.users' doesn't exist >>> Nov 06 20:53:43 auth-worker: Error: Attempting to rebuild connection to SQL >>> server >>> Nov 06 20:53:43 auth-worker: Error: vmysql: connection rebuild failed: >>> Table 'vpopmail.users' doesn't exist >>> >>> Any idea why vmysql is trying to access the users table in the vpopmail db, >>> given that it doesn't exist? >>> >>> -Chris >> > > -- > Eric Broch > White Horse Technical Consulting (WHTC) > > > - > To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com > For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com > - To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com
Re: [qmailtoaster] Odd error in dovecot.log
Chris, This could happen if dovecot sends an empty domain to the vpopmail/mysql authentication query, there my be other reasons that I'm not aware of yet. The function call to vpopmail is 'vauth_getpw(vpop_user, vpop_domain)'. I'm not sure HOW this would happen. Can you send me the surrounding entries in the log? Eric On 11/7/2017 6:08 AM, Eric Broch wrote: Here's the explanation in the code as a result of the 'mysql_query' and 'mysql_error' call: if (mysql_query(_read,SqlBufRead)) { fprintf(stderr, "vmysql: sql error[3]: %s\n", mysql_error(_read)); /* - 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(_read, SqlBufRead)) { fprintf (stderr, "vmysql: connection rebuild failed: %s\n", mysql_error(_read)); return(NULL); } } Not sure why mysql (mariadb) would return this error. Eric On 11/7/2017 5:47 AM, Eric Broch wrote: That's a good question, Chris. I'll have to delve into the code. On 11/6/2017 9:57 PM, Chris wrote: Given that the new DB structure for vpopmail involves having a separate table for each domain, I thought seeing this in my dovecot.log was a little weird: Nov 06 20:53:43 auth-worker: Error: vmysql: sql error[3]: Table 'vpopmail.users' doesn't exist Nov 06 20:53:43 auth-worker: Error: Attempting to rebuild connection to SQL server Nov 06 20:53:43 auth-worker: Error: vmysql: connection rebuild failed: Table 'vpopmail.users' doesn't exist Any idea why vmysql is trying to access the users table in the vpopmail db, given that it doesn't exist? -Chris -- Eric Broch White Horse Technical Consulting (WHTC) - To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com
Re: [qmailtoaster] Odd error in dovecot.log
Here's the explanation in the code as a result of the 'mysql_query' and 'mysql_error' call: if (mysql_query(_read,SqlBufRead)) { fprintf(stderr, "vmysql: sql error[3]: %s\n", mysql_error(_read)); /* - 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(_read, SqlBufRead)) { fprintf (stderr, "vmysql: connection rebuild failed: %s\n", mysql_error(_read)); return(NULL); } } Not sure why mysql (mariadb) would return this error. Eric On 11/7/2017 5:47 AM, Eric Broch wrote: That's a good question, Chris. I'll have to delve into the code. On 11/6/2017 9:57 PM, Chris wrote: Given that the new DB structure for vpopmail involves having a separate table for each domain, I thought seeing this in my dovecot.log was a little weird: Nov 06 20:53:43 auth-worker: Error: vmysql: sql error[3]: Table 'vpopmail.users' doesn't exist Nov 06 20:53:43 auth-worker: Error: Attempting to rebuild connection to SQL server Nov 06 20:53:43 auth-worker: Error: vmysql: connection rebuild failed: Table 'vpopmail.users' doesn't exist Any idea why vmysql is trying to access the users table in the vpopmail db, given that it doesn't exist? -Chris -- Eric Broch White Horse Technical Consulting (WHTC) - To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com
Re: [qmailtoaster] Odd error in dovecot.log
That's a good question, Chris. I'll have to delve into the code. On 11/6/2017 9:57 PM, Chris wrote: Given that the new DB structure for vpopmail involves having a separate table for each domain, I thought seeing this in my dovecot.log was a little weird: Nov 06 20:53:43 auth-worker: Error: vmysql: sql error[3]: Table 'vpopmail.users' doesn't exist Nov 06 20:53:43 auth-worker: Error: Attempting to rebuild connection to SQL server Nov 06 20:53:43 auth-worker: Error: vmysql: connection rebuild failed: Table 'vpopmail.users' doesn't exist Any idea why vmysql is trying to access the users table in the vpopmail db, given that it doesn't exist? -Chris -- Eric Broch White Horse Technical Consulting (WHTC) - To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com
[qmailtoaster] Odd error in dovecot.log
Given that the new DB structure for vpopmail involves having a separate table for each domain, I thought seeing this in my dovecot.log was a little weird: Nov 06 20:53:43 auth-worker: Error: vmysql: sql error[3]: Table 'vpopmail.users' doesn't exist Nov 06 20:53:43 auth-worker: Error: Attempting to rebuild connection to SQL server Nov 06 20:53:43 auth-worker: Error: vmysql: connection rebuild failed: Table 'vpopmail.users' doesn't exist Any idea why vmysql is trying to access the users table in the vpopmail db, given that it doesn't exist? -Chris