SyntaxError: invalid syntax (help)

Trying to search/delete for specific user with one letter name, “a”, and always changing domains.
Some addresses from this spam:

Need help please, fixing invalid syntax error.


from imap_tools import MailBox, A
with MailBox('').login('', 'PWD', 'Bulk') as mailbox:
#    DELETE messages that contains 'a@*.*' in body from Bulk folder


λ python
Traceback (most recent call last):
  File "C:\Users\Desktop\Desktop\Python Spam Buster\", line 6, in <module>
  File "C:\Users\Desktop\AppData\Local\Programs\Python\Python310\lib\site-packages\imap_tools\", line 176, in delete
    uid_str = clean_uids(uid_list)
  File "C:\Users\Desktop\AppData\Local\Programs\Python\Python310\lib\site-packages\imap_tools\", line 30, in clean_uids
    raise TypeError('uid "{}" is not string'.format(str(uid)))
TypeError: uid "<imap_tools.message.MailMessage object at 0x000001A96BC7BD90>" is not string

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.