[ postfixadmin-Bugs-2823018 ] already_notified subroutine - _pkey problem
Brought to you by:
christian_boltz,
gingerdog
|
From: SourceForge.net <no...@so...> - 2009-07-28 11:50:39
|
Bugs item #2823018, was opened at 2009-07-17 11:40 Message generated for change (Settings changed) made by gingerdog You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2823018&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Vacation Group: v 2.2 >Status: Closed >Resolution: Out of Date Priority: 5 Private: No Submitted By: Oskar Szafraniec (oscarek) Assigned to: Nobody/Anonymous (nobody) Summary: already_notified subroutine - _pkey problem Initial Comment: I’m writing in subject of already_notified subroutine. As it’s written in comment there, violation of primary key can happen, and this is true. But after this comment is a line like this: if ($e !~ /_pkey/) { On my system it started to produce 2 things… First, the condition was always true, because the error message didn’t include the “_pkey” string. This can be because of mysql version (I have 5.0.81). Instead of key name the error message had only “key 1” string. Next, because of the above vacation.pl was sending response every time. On our system this was producing 2 vacation-response per email, because emails goes first to localhost for virus-check and then are sent again to the recipient. Both was also served by vacation.pl and produced an “out-of-office” email. This is my free-thoughts about why this was, as I don’t know so much how postfix works (this is our admin’s domain :) So my suggestion is to change maybe the condition to something like this: if ($e !~ /key 1/ && $e !~ /_pkey/) { Key 1 (I think) is always a PRIMARY key, so on my system I’m using just line like this now, with 100% success: if ($e !~ /key 1/) { As English is not my native language, if something is not clear, feel free to ask questions :) My MySQL version is 5.0.81. vacation_notification is as it should be, so it’s structure is not a case (I was checking this number of times today :) I hope my email will be useful. ---------------------------------------------------------------------- Comment By: Oskar Szafraniec (oscarek) Date: 2009-07-28 09:41 Message: for your information, freebsd postfixadmin port is 1 year out of date and this is why we have very old version of vacation.pl with the bug above. so mayby it's time to get the port for freebsd updated? ;) ---------------------------------------------------------------------- Comment By: Oskar Szafraniec (oscarek) Date: 2009-07-28 09:33 Message: you are right, I have old version :( my mistake. sorry. in the current version everything is OK. please feel free to delete above. ---------------------------------------------------------------------- Comment By: GingerDog (gingerdog) Date: 2009-07-27 20:21 Message: Hmm. Looking at the code - I think you're using an out of date version; any chance of updating and letting me know whether this fixes the issue? {{{ # Violation of a primay key constraint may happen here, and that's # fine. All other error conditions are not fine, however. if ($e !~ /(?:_pkey|^Duplicate entry)/) { $logger->error("Failed to insert into vacation_notification table (to:$to from:$from error:'$e' query:'$query')"); # Let's play safe and notify anyway return 1; } }}} ---------------------------------------------------------------------- Comment By: GingerDog (gingerdog) Date: 2009-07-27 20:19 Message: Hi, I thought it was the case that MySQL didn't have a primary key on the table, and so never raised that error message. Perhaps this changed somewhere... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2823018&group_id=191583 |