diff --git a/offlineimap.conf b/offlineimap.conf index 66bfff6..646d4e7 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -295,17 +295,6 @@ remoterepository = RemoteExample #postsynchook = notifysync.sh -# This option stands in the [Account Test] section. -# -# You can specify a newmail hook to execute an external command upon receipt -# of new mail in the INBOX. -# -# This example plays a sound file of your chosing when new mail arrives. -# -#newmail_hook = lambda: os.system( -#"cvlc --play-and-stop --play-and-exit /path/to/sound/file.mp3 > /dev/null 2>&1") - - # This option stands in the [Account Test] section. # # The historical backend is 'plain' which writes out the state in plain text @@ -1130,6 +1119,19 @@ remoteuser = username #readonly = False +# This option stands in the [Repository RemoteExample] section. +# +# You can specify a newmail hook to execute an external command upon receipt +# of new mail in the INBOX. +# +# The pythonfile must be set to import any required library. +# +# This example plays a sound file of your chosing when new mail arrives. +# +#newmail_hook = lambda: os.system( +#"cvlc --play-and-stop --play-and-exit /path/to/sound/file.mp3 > /dev/null 2>&1") + + [Repository GmailExample] # A repository using Gmail's IMAP interface. diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index 298d1ee..1bed3bf 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -883,10 +883,10 @@ class BaseFolder(object): for thread in threads: thread.join() - # Execute new mail hook if we have new mail + # Execute new mail hook if we have new mail. if self.have_newmail: if self.newmail_hook != None: - self.newmail_hook(); + self.newmail_hook() def __syncmessagesto_delete(self, dstfolder, statusfolder): """Pass 2: Remove locally deleted messages on dst.