Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Empty email trash iphone daily
-
Hey all, thanks for your help with my last project.
I was wondering if you could help me out with a new idea. On this one I have no clue where to start, so go slow for me.
I need help writing a script that accesses my mail on my iPhone, and deletes the trash automatically. Ideally every day, however, I'd like to be able to change it. Oh, and I use the ios app for email, but it's a Gmail account.
This means pythonista will always be running in the background but I'm fine with that.
Is this even possible? Thanks in advance for the help.
Steve
-
There's no way for Pythonista to interface with the iOS Mail app - iOS doesn't provide any APIs for that. You could instead use the
imaplib
module to access your Gmail mailbox directly. But in any case there's no way to set up a regular task like that - Pythonista can't run in the background for very long before iOS pauses/terminates it.I don't use Gmail very much, but maybe there's an option in their web interface to empty the trash regularly, or delete mails that were left in the trash for some amount of time. Desktop mail clients (like Thunderbird or the macOS Mail app) usually have that kind of feature as well, so if you have one set up, you can probably configure it there.
-
Well that's a bummer.