Open jhelwig opened 7 years ago
Hey @jhelwig I use the mail-mover without the 'pre-new' hook so it is run in the end, beside being a use-case / configuration problem, I think we should decide if you may be able to run mail-mover multiple time in a single call of afew, to me it's no but maybe there other's use case where it is useful.
For some context, what got me down the road of trying to call afew --move-mail
from pre-new
was the combination of "call afew --move-mails in an offlineimap presynchook" in the afew readme (https://github.com/afewmail/afew/blob/master/README.rst#move-mode) and notmuch's description of the pre-new
hook ("Typically this hook is used for fetching or delivering new mail to be imported into the database." https://notmuchmail.org/manpages/notmuch-hooks-5/).
Hey, I think the user is in control, but yeah running only once the 'notmuch new' should be the default, so maybe if it was run, we should just prevent it to run again ?
If you could provide a patch it would be easier to solve I think.
If
afew --move-mail
is added to the notmuchpre-new
hook, you'll end up potentially fork-bombing yourself as the hook ends up being called over and over again due to MailMover runningnotmuch new
(https://github.com/afewmail/afew/blob/master/afew/MailMover.py#L118). It would be nice if there was a configuration option for MailMover to tell it to pass--no-hooks
tonotmuch new
to prevent the infinite recursion.