mapiplugin.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import MAPI
  2. from MAPI.Util import *
  3. from MAPI.Time import *
  4. from MAPI.Struct import *
  5. from wraplogger import WrapLogger
  6. from pluginmanager import PluginManager
  7. from plugintemplates import *
  8. class DAgentPluginManager(object):
  9. def __init__(self, plugindir, logger):
  10. self.logger = WrapLogger(logger)
  11. self.pluginmanager = PluginManager(plugindir, self.logger)
  12. self.pluginmanager.loadPlugins(IMapiDAgentPlugin)
  13. def PostConverting(self, session, addrbook, store, folder, message):
  14. return self.pluginmanager.processPluginFunction('PostConverting', session, addrbook, store, folder, message)
  15. def PreDelivery(self, session, addrbook, store, folder, message):
  16. return self.pluginmanager.processPluginFunction('PreDelivery', session, addrbook, store, folder, message)
  17. def PostDelivery(self, session, addrbook, store, folder, message):
  18. return self.pluginmanager.processPluginFunction('PostDelivery', session, addrbook, store, folder, message)
  19. def PreRuleProcess(self, session, addrbook, store, rulestable):
  20. return self.pluginmanager.processPluginFunction('PreRuleProcess', session, addrbook, store, rulestable)
  21. def SendNewMailNotify(self, session, addrbook, store, folder, message):
  22. return self.pluginmanager.processPluginFunction('SendNewMailNotify', session, addrbook, store, folder, message)
  23. class SpoolerPluginManager(object):
  24. def __init__(self, plugindir, logger):
  25. self.logger = WrapLogger(logger)
  26. self.pluginmanager = PluginManager(plugindir, self.logger)
  27. self.pluginmanager.loadPlugins(IMapiSpoolerPlugin)
  28. def PreSending(self, session, addrbook, store, folder, message):
  29. return self.pluginmanager.processPluginFunction('PreSending', session, addrbook, store, folder, message)