The GMX Mail Storage Cleaner script automates the deletion of emails in your GMX mailbox. Instead of manually deleting a maximum of 50 emails per request, this script retrieves the total number of emails in a specified folder, fetches their URIs, and deletes them in bulk. This is particularly useful for cleaning up large volumes of emails efficiently.
- Python 3.11
- pip
-
Clone this repository:
git clone https://github.com/phgas/gmx-mail-storage-cleaner.git
-
Change directory:
cd gmx-mail-storage-cleaner
-
Install the required Python packages:
pip install -r requirements.txt
-
Login to your Gmx-Account and press F12 to open Chrome DevTools (if you are using another web browser do self dilligence).
-
Change to the Network tab, activate
Preserve Log
and filter forFetch/XHR
. -
Clear the network log, click on "Posteingang" and in the logs look for
folders?
-> from Requests Headers copy Bearer Token (BEARER_TOKEN_TO_RETRIEVE) -
Clear the network log, delete a mail and in the logs look for
MailBatchDelete?
-> from Requests Headers copy Bearer Token (BEARER_TOKEN_TO_DELETE) -
Create a
.env
file in the project directory and add your two Bearer Tokens:BEARER_TOKEN_TO_RETRIEVE = "Bearer ..." BEARER_TOKEN_TO_DELETE = "Bearer ..."
Run the Python script:
python main.py
- Make sure your
.env
file is correctly set up with your GMX API tokens. - The script handles both
INBOX
andTRASH
folders by default, but you can modify the folder types as needed.