I use empty `.gitignore` files so Git will create the
`test/mail-in/new` and `test/mail-in/tmp` directories on checkout, but
the Maildir mailbox thinks they are messages. Since the files are
*not* messages, skip them when constucting the Maildir message list.
I don't foresee any side effects from this (it's an odd filename for
real Maildir delivery), but I log the skipped filenames just in case.
ombox = _mailbox.mbox(output, factory=None, create=True)
elif mailbox == 'maildir':
mbox = _mailbox.Maildir(input_, factory=None, create=False)
- messages = mbox.items()
+ messages = []
+ for key,msg in mbox.items():
+ subpath = mbox._lookup(key)
+ if subpath.endswith('.gitignore'):
+ _LOG.debug('skipping non-message {}'.format(subpath))
+ continue
+ messages.append((key, msg))
if output is not None:
ombox = _mailbox.Maildir(output, factory=None, create=True)
else: