I'm trying to write a script which moves a particular email to Archive after getting its text, however I've looked all over the place and tried plenty of solutions. My understanding is that when a message is archived, all of its labels are removed and it only appears in the All Mail folder.
This is my current code to try to remove any labels associated with the message, I believe that this should archive the message, however it seems to do nothing. There are no errors when running this code.
one, two = self.connection.store(msg_id, '-X-GM-LABELS', "\Inbox \Important \Sent \Seen")
Thanks!