domainaware / parsedmarc

A Python package and CLI for parsing aggregate and forensic DMARC reports
https://domainaware.github.io/parsedmarc/
Apache License 2.0
1.02k stars 223 forks source link

UID command error: BAD [b'No mail number specified'] #102

Closed malkiq closed 5 years ago

malkiq commented 5 years ago

Hello, I've been trying to run the app for a few days.

This is one of the "UID command error: BAD [b'No mail number specified ']" error message from the IMAP server manufacturer. What is happening. Read INBOX

DEBUG: init.py:996:Processing message 1 of 18: UID 7 DEBUG: init.py:996:Processing message 2 of 18: UID 8 DEBUG: init.py:996:Processing message 3 of 18: UID 9

until 18

So far so good. This follows

DEBUG: init.py:1050:Moving aggregate report messages from INBOX to Archive / Aggregate DEBUG: init.py:1056:Moving message 1 of 18: UID 7 ERROR: init.py:1063:IMAP error: Error moving message UID 7: UID command error: BAD [b'No mail number specified '] DEBUG: init.py:1056:Moving message 2 of 18: UID 8 ERROR: init.py:1063:IMAP error: Error moving message UID 8: UID command error: BAD [b'No mail number specified '] DEBUG: init.py:1056:Moving message 3 of 18: UID 9 ERROR: init.py:1063:IMAP error: Error moving message UID 9:

until 18

Messages moved but follow this:

DEBUG: init.py:992:Found 18 messages in INBOX DEBUG: init.py:996:Processing message 1 of 18: UID 7 DEBUG: init.py:996:Processing message 2 of 18: UID 8 DEBUG: init.py:996:Processing message 3 of 18: UID 9

until 18

and so to infinity

when interrupted, it says this:

File "/ usr / local / bin / parsedmarc", line 11, in load_entry_point ('parsedmarc == 6.5.1', ​​'console_scripts', 'parsedmarc') () File "/usr/local/lib/python3.6/dist-packages/parsedmarc/cli.py", line 566, in _main strip_attachment_payloads = sa File "/usr/local/lib/python3.6/dist-packages/parsedmarc/init.py", line 1100, in get_dmarc_reports_from_inbox results = results File "/usr/local/lib/python3.6/dist-packages/parsedmarc/init.py", line 1100, in get_dmarc_reports_from_inbox results = results File "/usr/local/lib/python3.6/dist-packages/parsedmarc/init.py", line 1100, in get_dmarc_reports_from_inbox results = results [Previous line repeated 73 times more] File "/usr/local/lib/python3.6/dist-packages/parsedmarc/init.py", line 1059, in get_dmarc_reports_from_inbox aggregate_reports_folder) File "/usr/local/lib/python3.6/dist-packages/mailsuite/imap.py", line 252, in move_messages self.copy (msg_uids, folder_path) File "/usr/local/lib/python3.6/dist-packages/imapclient/imapclient.py", line 1270, in copy uid = True, unpack = True) File "/usr/local/lib/python3.6/dist-packages/imapclient/imapclient.py", line 1535, in _command_and_check type, data = self._imap.uid (command, args) File "/usr/lib/python3.6/imaplib.py", line 879, in uid type, data = self._simple_command (name, command, args) File "/usr/lib/python3.6/imaplib.py", line 1196, in _simple_command return self._command_complete (name, self.command (name, * args)) File "/usr/lib/python3.6/imaplib.py", line 1019, in _command_complete type, data = self._get_tagged_response (tag) File "/usr/lib/python3.6/imaplib.py", line 1139, in _get_tagged_response self._get_response () File "/usr/lib/python3.6/imaplib.py", line 1047, in _get_response resp = self._get_line () File "/usr/lib/python3.6/imaplib.py", line 1149, in _get_line line = self.readline () File "/usr/lib/python3.6/imaplib.py", line 310, in readline line = self.file.readline (_MAXLINE + 1) File "/usr/lib/python3.6/socket.py", line 586, in readinto return self._sock.recv_into (b) KeyboardInterrupt

What is the solution?

malkiq commented 5 years ago

ERROR:init.py:1063:IMAP error: Error moving message UID 7: copy failed: [CANNOT] Invalid mailbox name: Name must not have '/' characters (0.001 + 0.000 secs). it's from Postfix

seanthegeek commented 5 years ago

Hi,

It looks like I broke something when I refactored the mail functions into mailsuite. I need to reproduce the issue to be able to debug it.

Can you set up a mailbox for me and put some messages in it so I can debug the script on your server?

If so, send creds to [redacted email].

seanthegeek commented 5 years ago

Confirmed fixed in 6.5.2