mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/tglx/remail.git
synced 2024-11-24 13:22:39 +01:00
remaild: Also notify on IN_MOVED_TO events
Some MTAs move mails into the maildir after constructing them in some temporary path. Signed-off-by: Andreas Rammhold <andreas@rammhold.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
8e6e7c2cc5
commit
d17b1394e9
1 changed files with 6 additions and 1 deletions
|
@ -31,6 +31,11 @@ class EventHandler(pyinotify.ProcessEvent):
|
|||
self.mailer.queue_newmail(event.pathname)
|
||||
pass
|
||||
|
||||
def process_IN_MOVED_TO(self, event):
|
||||
self.mailer.queue_newmail(event.pathname)
|
||||
pass
|
||||
|
||||
|
||||
class remaild(object):
|
||||
"""
|
||||
The remail daemon.
|
||||
|
@ -132,7 +137,7 @@ class remaild(object):
|
|||
wm = pyinotify.WatchManager()
|
||||
self.inotifier = pyinotify.AsyncNotifier(wm, EventHandler(self))
|
||||
ndir = pathlib.Path(self.config.maildir) / 'new'
|
||||
wm.add_watch(str(ndir.resolve()), pyinotify.IN_CREATE)
|
||||
wm.add_watch(str(ndir.resolve()), pyinotify.IN_CREATE | pyinotify.IN_MOVED_TO)
|
||||
|
||||
def stop_inotifier(self):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue