Hi Aaron, > > > We have two classes of programs: > > > - lmtpd, smtpd, pop3d: before we do anything with a message BEGIN, if we > > > return SUCCESS to the client COMMIT, else ROLLBACK - should be quite > > > easy? > > > - imapd: for every IMAP operation: > > > - if it's a read only one leave everything as it is > > > - if it's a rw one BEGIN, if we return SUCCESS to the client COMMIT, > > > else ROLLBACK > > > > > > But probably I miss something and it's much harder to code? > > > > You might be right. Yes, I guess you are.. Unless I'm also overlooking > > something. > > A failed delivery response from the LMTP or SMTP processes doesn't necessarily > mean that nothing was inserted or updated in the database. Only a hard > database error / inconsistency should generate a rollback; for all other > cases, I would suggest simply commit it, even if nothing much was done.
Why? I don't see a reason why anything has to be changed in the database if we return a failure. I even think we mustn't ever change anything in the database on a failed delivery response? Do you have an example where changes should be commited? Thomas -- http://www.tmueller.com for pgp key (95702B3B)