AutoUnsubscriber icon indicating copy to clipboard operation
AutoUnsubscriber copied to clipboard

Dev

Open pocketOfShells opened this issue 6 years ago • 3 comments

pocketOfShells avatar Oct 31 '19 00:10 pocketOfShells

Works Great, but there is only On my way! Error left:

After the Program fetches the Mails and searches for Links

Line97, in getEmails If sender[0][1] in spammers: IndexError: list index out of Range

DFC1990 avatar Oct 10 '20 17:10 DFC1990

I get this error on this PR with Yahoo mail:

Log in successful

Getting emails with unsubscribe in the body

Getting links and addresses

Traceback (most recent call last):
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 300, in <module>
    main()
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 297, in main
    Auto.usageLoop()
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 289, in usageLoop
    self.fullProcess()
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 279, in fullProcess
    self.getEmails()
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 93, in getEmails
    msg = pyzmail.PyzMessage.factory(raw[UID][b'BODY[]'])
KeyError: b'BODY[]'

Gmail works but throws this error when trying to delete:

Logging into email server to delete emails

Log in successful

Searching for emails to delete from [email protected]
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/imapclient/imapclient.py", line 1124, in _search
    data = self._raw_command_untagged(b"SEARCH", args)
  File "/home/user/.local/lib/python3.10/site-packages/imapclient/imapclient.py", line 1608, in _raw_command_untagged
    typ, data = self._raw_command(command, args, uid=uid)
  File "/home/user/.local/lib/python3.10/site-packages/imapclient/imapclient.py", line 1670, in _raw_command
    return self._imap._command_complete(to_unicode(command), tag)
  File "/usr/lib64/python3.10/imaplib.py", line 1055, in _command_complete
    raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.IMAP4.error: SEARCH command error: BAD [b'Could not parse command']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 300, in <module>
    main()
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 297, in main
    Auto.usageLoop()
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 289, in usageLoop
    self.fullProcess()
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 283, in fullProcess
    self.deleteEmails()
  File "/home/user/Desktop/AutoUnsubscriber/AutoUnsubscriber.py", line 223, in deleteEmails
    DelUIDs = self.imap.search(['TEXT','unsubscribe', fromSender])
  File "/home/user/.local/lib/python3.10/site-packages/imapclient/imapclient.py", line 1098, in search
    return self._search(criteria, charset)
  File "/home/user/.local/lib/python3.10/site-packages/imapclient/imapclient.py", line 1129, in _search
    raise exceptions.InvalidCriteriaError(
imapclient.exceptions.InvalidCriteriaError: b'Could not parse command'

This error may have been caused by a syntax error in the criteria: ['TEXT', 'unsubscribe', 'FROM [email protected]']
Please refer to the documentation for more information about search criteria syntax..
https://imapclient.readthedocs.io/en/master/#imapclient.IMAPClient.search

0cwa avatar Mar 11 '22 03:03 0cwa

Works Great, but there is only On my way! Error left:

After the Program fetches the Mails and searches for Links

Line97, in getEmails If sender[0][1] in spammers: IndexError: list index out of Range

I never got this error.

0cwa avatar Mar 16 '22 04:03 0cwa