Index: pykota/trunk/pykota/config.py
===================================================================
--- pykota/trunk/pykota/config.py (revision 3184)
+++ pykota/trunk/pykota/config.py (revision 3190)
@@ -631,4 +631,25 @@
                 return stab
         
+    def getPrinterSNMPErrorMask(self, printername) :    
+        """Returns the SNMP error mask for a particular printer, or None if not defined."""
+        try : 
+            errmask = self.getPrinterOption(printername, "snmperrormask").lower()
+        except PyKotaConfigError :    
+            return None         # tells to use hardcoded value
+        else :    
+            try :
+                if errmask.startswith("0x") :
+                    value = int(errmask, 16)
+                elif errmask.startswith("0") :    
+                    value = int(errmask, 8)
+                else :    
+                    value = int(errmask)
+                if 0 <= value < 65536 :
+                    return value
+                else :    
+                    raise ValueError
+            except ValueError :    
+                raise PyKotaConfigError, _("Incorrect value %s for the snmperrormask directive in section %s") % (errmask, printername)
+        
     def getWinbindSeparator(self) :          
         """Returns the winbind separator's value if it is set, else None."""
Index: pykota/trunk/pykota/accounters/snmp.py
===================================================================
--- pykota/trunk/pykota/accounters/snmp.py (revision 3180)
+++ pykota/trunk/pykota/accounters/snmp.py (revision 3190)
@@ -91,17 +91,16 @@
                                   ]  
                                   
-# TODO : make the following list configurable at runtime, possibly per printer.                                  
-errorConditions = [ 'No Paper',
-                    # 'No Toner',
-                    'Door Open',
-                    'Jammed',
-                    'Offline',
-                    'Service Requested',
-                    'Input Tray Missing',
-                    'Output Tray Missing',
-                    # 'Marker Supply Missing',
-                    'Output Full',
-                    'Input Tray Empty',
-                  ]
+# The default error mask to use when checking error conditions.
+defaultErrorMask = 0x4fcc # [ 'No Paper',
+                          #   'Door Open',
+                          #   'Jammed',
+                          #   'Offline',
+                          #   'Service Requested',
+                          #   'Input Tray Missing',
+                          #   'Output Tray Missing',
+                          #   'Output Full',
+                          #   'Input Tray Empty',
+                          # ]
+                          
 # WARNING : some printers don't support this one :                  
 prtConsoleDisplayBufferTextOID = "1.3.6.1.2.1.43.16.5.1.2.1.1" # SNMPv2-SMI::mib-2.43.16.5.1.2.1.1
@@ -147,7 +146,21 @@
             return True
         else :
+            try :
+                errormask = self.parent.filter.config.getPrinterSNMPErrorMask(self.parent.filter.PrinterName)
+            except AttributeError : # debug mode    
+                errormask = defaultErrorMask
+            if errormask is None :
+                errormask = defaultErrorMask
+            errormaskbytes = [ chr((errormask & 0xff00) >> 8),
+                               chr((errormask & 0x00ff)),
+                             ]
+            errorConditions = self.extractErrorStates(errormaskbytes)
+            self.parent.filter.logdebug("Error conditions for mask 0x%04x : %s" \
+                                               % (errormask, errorConditions))
             for err in errorstates :
                 if err in errorConditions :
+                    self.parent.filter.logdebug("Error condition '%s' encountered. PyKota will wait until this problem is fixed." % err)
                     return True
+            self.parent.filter.logdebug("No error condition matching mask 0x%04x" % errormask)
             return False    
         
