Re: Deferral on database failure
I have done this by using a global variable which is set to 1 in the function vauth_getpw when there are no records found for this user i.e. if (mysql_num_rows(res) == 0) { permanent_error = 1; return (NULL); } in the vdelivermail.c i then use this variable permanent_error to defer the mail if the variable permanent_error is not 1. Regards Manny - Original Message - From: "Ken Jones" <[EMAIL PROTECTED]> To: "Troy Settle" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, July 09, 2001 7:29 PM Subject: Re: Deferral on database failure > Troy Settle wrote: > > > > All, > > > > In searching through the archives, I found this posting from Ken last > > October: > > > > > > We are thinking to upgrade to the new version of Vpopmail because the > > > > old one(currently installed vpopmail) has one critical bug in the > > > > current version we are using needs to be addressed is that mail > > > > bounces when vdelivermail can't connect to MySQL for whatever reason > > > > (usually because MySQL is down or busy). > > > > > > Hmm.. That's an interesting point. If vdelivermail can't retrieve > > > a users information because it can't connect to the database, it > > > should cause a deferral. I'll put that on the TODO list. > > > > Has this been done? I don't see it in the TODO list or Changelog (4.9.10). > > If not, what would it take to get it done? > > No it has not been done. The error return code from > the function in questino, vauth_getpw only returns > NULL (for use not found) and a value (for a user found) > There is no other error types. If we changed it to > return a -1, for example, it may break other code. > It could return an OutOfBand error, in a global > error variable. > > What would be the best way to do this? > 1) Have vauth_getpw return -1 and review all the code >using vauth_getpw > or > 2) return an out of band error value? > > Ken Jones _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Deferral on database failure
I thought this was fixed in version 4.10.1; i.e. from Current Change Log 05/02/01 - [EMAIL PROTECTED] & [EMAIL PROTECTED] - added check if mysql is down, email is deferred instead of bounced or deleted. Can you please clarify? thanks in advance Faruque At 03:59 PM 7/9/01 +0200, Ken Jones wrote: >Troy Settle wrote: > > > > All, > > > > In searching through the archives, I found this posting from Ken last > > October: > > > > > > We are thinking to upgrade to the new version of Vpopmail because the > > > > old one(currently installed vpopmail) has one critical bug in the > > > > current version we are using needs to be addressed is that mail > > > > bounces when vdelivermail can't connect to MySQL for whatever reason > > > > (usually because MySQL is down or busy). > > > > > > Hmm.. That's an interesting point. If vdelivermail can't retrieve > > > a users information because it can't connect to the database, it > > > should cause a deferral. I'll put that on the TODO list. > > > > Has this been done? I don't see it in the TODO list or Changelog (4.9.10). > > If not, what would it take to get it done? > >No it has not been done. The error return code from >the function in questino, vauth_getpw only returns >NULL (for use not found) and a value (for a user found) >There is no other error types. If we changed it to >return a -1, for example, it may break other code. >It could return an OutOfBand error, in a global >error variable. > >What would be the best way to do this? >1) Have vauth_getpw return -1 and review all the code >using vauth_getpw >or >2) return an out of band error value? > >Ken Jones
RE: Deferral on database failure
Points well taken. I suppose a perl script running every 10 minutes to keep the cdb files up to date and another once a day to clean up old Maildir's would be a better way to go (saves hacking up sqwebmail and courier-imap as well). Anyone have a snippit of perl code to work with vpopmail's cdb files? I'd rather not fork out to call ~vpopmail/bin/*. TIA, -- Troy Settle Pulaski Networks 540.994.4254 http://www.psknet.com ** -Original Message- ** From: inter7 [mailto:inter7]On Behalf Of Ken Jones ** Sent: Monday, July 09, 2001 11:23 AM ** To: [EMAIL PROTECTED] ** Subject: Re: Deferral on database failure ** ** ** How hard? Trust me, it is not easy. ** ** IBM spent over 500 million getting redudancy/failover to work ** in DBII. mysql doesn't have it, postgres doesn't have it ** oracle does but they have millions. Sybase has something ** close, but it can fail. ** ** There are so many cases of problems, time race conditions, ** it is a friggin' nightmare. ** ** If you want cdb, then convert your mysql data to cdb data. ** ** KEnet Webmaster wrote: ** > ** > Actually that makes sense. ** > ** > Right now, when you choose an authentication methode (ie ** mysql) you are ** > stuck with that one. I was thinking the other day myself, I ** wanted to use ** > Mysql because, as I understood the instructions, I could in ** the future add ** > in questions on the sqregister page like Password retrieval ** questions and ** > stuff like that to be stored in the database with their username. ** > ** > I suddenly thought tho, while its unlikely that the mysql ** server will be ** > down, without the entire server being down, what would happen ** if for some ** > reason mysql stops functioning and cannot authenticate the ** users? Well, ** > the users would suddenly find themselves without access to their mail. ** > ** > I think its a marvelous idea to make it so that the mysql ** authentication can ** > be used, but in the event of a failure to authenticate from mysql, the ** > server will check the vpasswd file for the username and ** password as a back ** > up authentication. ** > ** > This would of course require that the vadd and vdel programs ** would have to ** > update the mysql database, AND the vpasswd files when a user ** is added or ** > removed. Is not actually replication, but rather redundancy. ** However, as ** > I am not a programmer, I dont know how hard it would be to ** have the programs ** > write to both the mysql DB and the vpasswd files. Not to mention the ** > actualy vpopmail porgram having to have the code to understand ** that when it ** > gets a failed mysql authentication, to check the vpasswd file ** before denying ** > the user. ** > ** > - Original Message - ** > From: "Ken Jones" <[EMAIL PROTECTED]> ** > To: <[EMAIL PROTECTED]> ** > Sent: Monday, July 09, 2001 10:57 AM ** > Subject: Re: Deferral on database failure ** > ** > > ** > > Sounds like a disaster waiting to happen. ** > > Ever try to build a replicated database (which is kinda what ** > > you are talking about). The things you have to watch for ** > > are almost endless. ** > > ** > > But hey :) if you want to build it, test it, and then support ** > > it on the mailing list for the next two years, rock on! ** > > ** > > What problem are you trying to solve with having a cdb file? ** > > Lookup speed? ** > > ** > > Ken ** > > ** > > Troy Settle wrote: ** > > > ** > > > I don't know how expensive this would be, but what about ** building in a ** > cache ** > > > mechinism? Where vauth_getpw can update a cdb stored ** locally and use ** > that ** > > > cdb in the event of a database failure. ** > > > ** > > > The mechnism would need to be able to add/remove/update ** records in the ** > cdb ** > > > based on the contents of the sql database. ** > > > ** > > > -- ** > > > Troy Settle ** > > > Pulaski Networks ** > > > 540.994.4254 ** > > > http://www.psknet.com ** > > > ** > > > ** -Original Message- ** > > > ** From: inter7 [mailto:inter7]On Behalf Of Ken Jones ** > > > ** Sent: Monday, July 09, 2001 10:00 AM ** > > > ** To: Troy Settle ** > > > ** Cc: [EMAIL PROTECTED] ** > > > ** Subject: Re: Deferral on database failure ** > > > ** ** > > > ** ** > > > ** Troy Settle wrote: ** > > > ** > ** > > > ** > All, ** > > > ** > ** > > > ** > In searching through the archives, I found this ** posting from Ken ** > last ** > > > ** > October: ** > >
Re: Deferral on database failure
How hard? Trust me, it is not easy. IBM spent over 500 million getting redudancy/failover to work in DBII. mysql doesn't have it, postgres doesn't have it oracle does but they have millions. Sybase has something close, but it can fail. There are so many cases of problems, time race conditions, it is a friggin' nightmare. If you want cdb, then convert your mysql data to cdb data. KEnet Webmaster wrote: > > Actually that makes sense. > > Right now, when you choose an authentication methode (ie mysql) you are > stuck with that one. I was thinking the other day myself, I wanted to use > Mysql because, as I understood the instructions, I could in the future add > in questions on the sqregister page like Password retrieval questions and > stuff like that to be stored in the database with their username. > > I suddenly thought tho, while its unlikely that the mysql server will be > down, without the entire server being down, what would happen if for some > reason mysql stops functioning and cannot authenticate the users? Well, > the users would suddenly find themselves without access to their mail. > > I think its a marvelous idea to make it so that the mysql authentication can > be used, but in the event of a failure to authenticate from mysql, the > server will check the vpasswd file for the username and password as a back > up authentication. > > This would of course require that the vadd and vdel programs would have to > update the mysql database, AND the vpasswd files when a user is added or > removed. Is not actually replication, but rather redundancy. However, as > I am not a programmer, I dont know how hard it would be to have the programs > write to both the mysql DB and the vpasswd files. Not to mention the > actualy vpopmail porgram having to have the code to understand that when it > gets a failed mysql authentication, to check the vpasswd file before denying > the user. > > - Original Message - > From: "Ken Jones" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, July 09, 2001 10:57 AM > Subject: Re: Deferral on database failure > > > > > Sounds like a disaster waiting to happen. > > Ever try to build a replicated database (which is kinda what > > you are talking about). The things you have to watch for > > are almost endless. > > > > But hey :) if you want to build it, test it, and then support > > it on the mailing list for the next two years, rock on! > > > > What problem are you trying to solve with having a cdb file? > > Lookup speed? > > > > Ken > > > > Troy Settle wrote: > > > > > > I don't know how expensive this would be, but what about building in a > cache > > > mechinism? Where vauth_getpw can update a cdb stored locally and use > that > > > cdb in the event of a database failure. > > > > > > The mechnism would need to be able to add/remove/update records in the > cdb > > > based on the contents of the sql database. > > > > > > -- > > > Troy Settle > > > Pulaski Networks > > > 540.994.4254 > > > http://www.psknet.com > > > > > > ** -Original Message- > > > ** From: inter7 [mailto:inter7]On Behalf Of Ken Jones > > > ** Sent: Monday, July 09, 2001 10:00 AM > > > ** To: Troy Settle > > > ** Cc: [EMAIL PROTECTED] > > > ** Subject: Re: Deferral on database failure > > > ** > > > ** > > > ** Troy Settle wrote: > > > ** > > > > ** > All, > > > ** > > > > ** > In searching through the archives, I found this posting from Ken > last > > > ** > October: > > > ** > > > > ** > > > We are thinking to upgrade to the new version of Vpopmail > > > ** because the > > > ** > > > old one(currently installed vpopmail) has one critical bug in > the > > > ** > > > current version we are using needs to be addressed is that mail > > > ** > > > bounces when vdelivermail can't connect to MySQL for > > > ** whatever reason > > > ** > > > (usually because MySQL is down or busy). > > > ** > > > > > ** > > Hmm.. That's an interesting point. If vdelivermail can't retrieve > > > ** > > a users information because it can't connect to the database, it > > > ** > > should cause a deferral. I'll put that on the TODO list. > > > ** > > > > ** > Has this been done? I don't see it in the TODO list or > > > ** Changelog (4.9.10). > > > ** > If not, what would it take to get it done? > > > ** > > > ** No it has not been done. The error return code from > > > ** the function in questino, vauth_getpw only returns > > > ** NULL (for use not found) and a value (for a user found) > > > ** There is no other error types. If we changed it to > > > ** return a -1, for example, it may break other code. > > > ** It could return an OutOfBand error, in a global > > > ** error variable. > > > ** > > > ** What would be the best way to do this? > > > ** 1) Have vauth_getpw return -1 and review all the code > > > **using vauth_getpw > > > ** or > > > ** 2) return an out of band error value? > > > ** > > > ** Ken Jones > > > ** > > > ** > >
Re: Deferral on database failure
Actually that makes sense. Right now, when you choose an authentication methode (ie mysql) you are stuck with that one. I was thinking the other day myself, I wanted to use Mysql because, as I understood the instructions, I could in the future add in questions on the sqregister page like Password retrieval questions and stuff like that to be stored in the database with their username. I suddenly thought tho, while its unlikely that the mysql server will be down, without the entire server being down, what would happen if for some reason mysql stops functioning and cannot authenticate the users? Well, the users would suddenly find themselves without access to their mail. I think its a marvelous idea to make it so that the mysql authentication can be used, but in the event of a failure to authenticate from mysql, the server will check the vpasswd file for the username and password as a back up authentication. This would of course require that the vadd and vdel programs would have to update the mysql database, AND the vpasswd files when a user is added or removed. Is not actually replication, but rather redundancy. However, as I am not a programmer, I dont know how hard it would be to have the programs write to both the mysql DB and the vpasswd files. Not to mention the actualy vpopmail porgram having to have the code to understand that when it gets a failed mysql authentication, to check the vpasswd file before denying the user. - Original Message - From: "Ken Jones" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 09, 2001 10:57 AM Subject: Re: Deferral on database failure > > Sounds like a disaster waiting to happen. > Ever try to build a replicated database (which is kinda what > you are talking about). The things you have to watch for > are almost endless. > > But hey :) if you want to build it, test it, and then support > it on the mailing list for the next two years, rock on! > > What problem are you trying to solve with having a cdb file? > Lookup speed? > > Ken > > Troy Settle wrote: > > > > I don't know how expensive this would be, but what about building in a cache > > mechinism? Where vauth_getpw can update a cdb stored locally and use that > > cdb in the event of a database failure. > > > > The mechnism would need to be able to add/remove/update records in the cdb > > based on the contents of the sql database. > > > > -- > > Troy Settle > > Pulaski Networks > > 540.994.4254 > > http://www.psknet.com > > > > ** -Original Message- > > ** From: inter7 [mailto:inter7]On Behalf Of Ken Jones > > ** Sent: Monday, July 09, 2001 10:00 AM > > ** To: Troy Settle > > ** Cc: [EMAIL PROTECTED] > > ** Subject: Re: Deferral on database failure > > ** > > ** > > ** Troy Settle wrote: > > ** > > > ** > All, > > ** > > > ** > In searching through the archives, I found this posting from Ken last > > ** > October: > > ** > > > ** > > > We are thinking to upgrade to the new version of Vpopmail > > ** because the > > ** > > > old one(currently installed vpopmail) has one critical bug in the > > ** > > > current version we are using needs to be addressed is that mail > > ** > > > bounces when vdelivermail can't connect to MySQL for > > ** whatever reason > > ** > > > (usually because MySQL is down or busy). > > ** > > > > ** > > Hmm.. That's an interesting point. If vdelivermail can't retrieve > > ** > > a users information because it can't connect to the database, it > > ** > > should cause a deferral. I'll put that on the TODO list. > > ** > > > ** > Has this been done? I don't see it in the TODO list or > > ** Changelog (4.9.10). > > ** > If not, what would it take to get it done? > > ** > > ** No it has not been done. The error return code from > > ** the function in questino, vauth_getpw only returns > > ** NULL (for use not found) and a value (for a user found) > > ** There is no other error types. If we changed it to > > ** return a -1, for example, it may break other code. > > ** It could return an OutOfBand error, in a global > > ** error variable. > > ** > > ** What would be the best way to do this? > > ** 1) Have vauth_getpw return -1 and review all the code > > **using vauth_getpw > > ** or > > ** 2) return an out of band error value? > > ** > > ** Ken Jones > > ** > > ** >
Re: Deferral on database failure
Sounds like a disaster waiting to happen. Ever try to build a replicated database (which is kinda what you are talking about). The things you have to watch for are almost endless. But hey :) if you want to build it, test it, and then support it on the mailing list for the next two years, rock on! What problem are you trying to solve with having a cdb file? Lookup speed? Ken Troy Settle wrote: > > I don't know how expensive this would be, but what about building in a cache > mechinism? Where vauth_getpw can update a cdb stored locally and use that > cdb in the event of a database failure. > > The mechnism would need to be able to add/remove/update records in the cdb > based on the contents of the sql database. > > -- > Troy Settle > Pulaski Networks > 540.994.4254 > http://www.psknet.com > > ** -Original Message- > ** From: inter7 [mailto:inter7]On Behalf Of Ken Jones > ** Sent: Monday, July 09, 2001 10:00 AM > ** To: Troy Settle > ** Cc: [EMAIL PROTECTED] > ** Subject: Re: Deferral on database failure > ** > ** > ** Troy Settle wrote: > ** > > ** > All, > ** > > ** > In searching through the archives, I found this posting from Ken last > ** > October: > ** > > ** > > > We are thinking to upgrade to the new version of Vpopmail > ** because the > ** > > > old one(currently installed vpopmail) has one critical bug in the > ** > > > current version we are using needs to be addressed is that mail > ** > > > bounces when vdelivermail can't connect to MySQL for > ** whatever reason > ** > > > (usually because MySQL is down or busy). > ** > > > ** > > Hmm.. That's an interesting point. If vdelivermail can't retrieve > ** > > a users information because it can't connect to the database, it > ** > > should cause a deferral. I'll put that on the TODO list. > ** > > ** > Has this been done? I don't see it in the TODO list or > ** Changelog (4.9.10). > ** > If not, what would it take to get it done? > ** > ** No it has not been done. The error return code from > ** the function in questino, vauth_getpw only returns > ** NULL (for use not found) and a value (for a user found) > ** There is no other error types. If we changed it to > ** return a -1, for example, it may break other code. > ** It could return an OutOfBand error, in a global > ** error variable. > ** > ** What would be the best way to do this? > ** 1) Have vauth_getpw return -1 and review all the code > **using vauth_getpw > ** or > ** 2) return an out of band error value? > ** > ** Ken Jones > ** > **
RE: Deferral on database failure
I don't know how expensive this would be, but what about building in a cache mechinism? Where vauth_getpw can update a cdb stored locally and use that cdb in the event of a database failure. The mechnism would need to be able to add/remove/update records in the cdb based on the contents of the sql database. -- Troy Settle Pulaski Networks 540.994.4254 http://www.psknet.com ** -Original Message- ** From: inter7 [mailto:inter7]On Behalf Of Ken Jones ** Sent: Monday, July 09, 2001 10:00 AM ** To: Troy Settle ** Cc: [EMAIL PROTECTED] ** Subject: Re: Deferral on database failure ** ** ** Troy Settle wrote: ** > ** > All, ** > ** > In searching through the archives, I found this posting from Ken last ** > October: ** > ** > > > We are thinking to upgrade to the new version of Vpopmail ** because the ** > > > old one(currently installed vpopmail) has one critical bug in the ** > > > current version we are using needs to be addressed is that mail ** > > > bounces when vdelivermail can't connect to MySQL for ** whatever reason ** > > > (usually because MySQL is down or busy). ** > > ** > > Hmm.. That's an interesting point. If vdelivermail can't retrieve ** > > a users information because it can't connect to the database, it ** > > should cause a deferral. I'll put that on the TODO list. ** > ** > Has this been done? I don't see it in the TODO list or ** Changelog (4.9.10). ** > If not, what would it take to get it done? ** ** No it has not been done. The error return code from ** the function in questino, vauth_getpw only returns ** NULL (for use not found) and a value (for a user found) ** There is no other error types. If we changed it to ** return a -1, for example, it may break other code. ** It could return an OutOfBand error, in a global ** error variable. ** ** What would be the best way to do this? ** 1) Have vauth_getpw return -1 and review all the code **using vauth_getpw ** or ** 2) return an out of band error value? ** ** Ken Jones ** **
Re: Deferral on database failure
Troy Settle wrote: > > All, > > In searching through the archives, I found this posting from Ken last > October: > > > > We are thinking to upgrade to the new version of Vpopmail because the > > > old one(currently installed vpopmail) has one critical bug in the > > > current version we are using needs to be addressed is that mail > > > bounces when vdelivermail can't connect to MySQL for whatever reason > > > (usually because MySQL is down or busy). > > > > Hmm.. That's an interesting point. If vdelivermail can't retrieve > > a users information because it can't connect to the database, it > > should cause a deferral. I'll put that on the TODO list. > > Has this been done? I don't see it in the TODO list or Changelog (4.9.10). > If not, what would it take to get it done? No it has not been done. The error return code from the function in questino, vauth_getpw only returns NULL (for use not found) and a value (for a user found) There is no other error types. If we changed it to return a -1, for example, it may break other code. It could return an OutOfBand error, in a global error variable. What would be the best way to do this? 1) Have vauth_getpw return -1 and review all the code using vauth_getpw or 2) return an out of band error value? Ken Jones