Managing Depleting Gmail Storage Space Caused by Undeliverable Responses in a Decade-Old Account

An issue that has been faced repeatedly involves customers' mailboxes becoming congested due to a buildup of undelivered messages. What exacerbates this problem is that Gmail imposes limitations – if the mailbox surpasses 30GB, deletion attempts result in errors. This situation reaches a point where emails cannot be removed from the inbox, folders, or archives.










Deleting them manually, limited to 50 at a time, translates to removing a total of 500,000 emails. This process demands an extraordinary number of days' worth of laborious effort and could incur substantial costs.

I've developed a script that enables automated cleaning through the use of a webdriver.

https://bitbucket.org/sergejdergatsjev/gmail/src/master/remove_undeliverable_vindazo.py 

See script example below in this file. 

Introduction

In the ever-evolving landscape of digital communication, Gmail stands as one of the pioneers, providing users with a reliable platform to manage their emails efficiently. However, even with its impressive storage capacities, long-term users might find themselves grappling with a depleting storage space issue, particularly when dealing with undeliverable responses. This article delves into the challenges users of decade-old Gmail accounts may face, offering insights and solutions to effectively manage the situation.



The Evolution of Gmail Storage

Gmail's storage capacity has evolved significantly since its inception. In its early days, a few megabytes seemed generous, but today, users are typically offered several gigabytes of storage. This capacity growth has catered to users' increasing reliance on email for various purposes, from personal conversations to business communications.

The Accumulation of Undeliverable Responses

A decade-old Gmail account has witnessed a plethora of interactions, including sent and received emails, subscriptions, and automated responses. Among these interactions, undeliverable responses can prove to be a hidden culprit behind diminishing storage space. These undeliverable responses include bounced emails and failed delivery notifications, often caused by outdated or incorrect email addresses, full mailboxes, or server issues.



The Impact on Storage Space

Undeliverable responses, though seemingly insignificant on their own, can collectively consume a considerable portion of your Gmail storage. Over the years, these accumulated responses can amount to a substantial loss of space. This is particularly true for users who have been actively using their accounts for a decade or more.

Identifying the Problem

Users facing depleting storage space issues must first identify the presence of undeliverable responses. Gmail's search functionality can be used to filter out bounce-back messages and failed delivery notifications. Running periodic searches and then deleting or managing these undeliverable responses is essential to free up storage space.



Solutions and Best Practices

Regular Cleanup: Schedule routine cleanup sessions to go through your inbox, outbox, and sent folders. Delete outdated and unnecessary emails, and pay special attention to undeliverable responses.

Unsubscribe: Unsubscribe from newsletters and mailing lists that you no longer find relevant. This can prevent future undeliverable responses.

Archive Old Emails will not help remove it If certain emails hold sentimental or historical value but aren't frequently accessed, consider archiving them rather than keeping them in your main inbox. But archive is using your space and default for Gmail is 30GB

Upgrade Storage: If your storage needs have genuinely outgrown your account's capacity, consider upgrading to a higher storage plan offered by Google.

Conclusion

A decade-old Gmail account is a testament to years of communication and interactions. However, as with any digital space, it requires occasional maintenance to ensure efficient use. By recognizing the impact of undeliverable responses on storage space and implementing effective strategies to manage them, users can continue to enjoy the benefits of Gmail without the constraints of storage limitations. Regular cleanup, updating contacts, and employing best practices can help users preserve their digital history while optimizing their Gmail experience.

Script example

from selenium.common.exceptions import NoSuchElementException
import sys, traceback
import random
import re

from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver import DesiredCapabilities
from selenium.common.exceptions import NoSuchElementException

from time import sleep
import requests
from tinydb import TinyDB, Query
from tinydb import where
from selenium.webdriver.support.ui import WebDriverWait
from datetime import datetime
import utils


class InviterCommand():
verbose = True
timeout = 5
driver = None
count = 0
max_count = 10000
user = "info@gemail.be"
pwd = "pwd"
login_url = "https://accounts.google.com/"
#form_url = "https://mail.google.com/mail/u/0/#advanced-search/subject=Undeliverable"
form_url = "https://mail.google.com/mail/u/0/#label/REPLYS+JOBALERTS+INVITATIONS"
chrome_path = ''
self.select_all_xpath = '//*[@id=":mk"]/div[1]/span'
self.rm_xpath = '//*[@id=":4"]/div/div[2]/div[1]/div/div/div[2]/div[3]/div'

def random_timeout(self):
return random.randint(3, 10)

def handle(self, *args, **options):
"""
Usage: python manage.py pagecrawler 3
"""
self.start_driver()
self.login()
sleep(self.timeout)
self.driver.get(self.form_url)
sleep(self.timeout)
for i in range(0, self.max_count):
print(i)
self.rm()

def rm(self):
print(datetime.now())
#import pdb;pdb.set_trace()
# in filter xpath
#select_all_xpath = '//*[@id=":mn"]/div[1]/span'
# //*[@id=":1u"]/div[1]/span # label
select_all_xpath = self.select_all_xpath
#import pdb;pdb.set_trace()
try:
print("checkbox")
checkbox = self.driver.find_element('xpath', select_all_xpath)
checkbox.click()
except:
self.driver.get(self.form_url)
sleep(self.timeout)
#import pdb;pdb.set_trace()
try:
print("Checkbox 2")
checkbox = self.driver.find_element('xpath', select_all_xpath)
checkbox.click()
except:
return False

#rm_xpath = '//*[@id=":4"]/div[2]/div[2]/div[1]/div/div/div[2]/div[3]/div'
rm_xpath = self.rm_xpath
sleep(1)
try:
print("rm")
rm = self.driver.find_element('xpath', rm_xpath)
rm.click()
except:
return False
sleep(3)
#import pdb;pdb.set_trace()

def send_keys(self, xpath, text):
print(xpath)
try:
sleep(self.timeout)
element = self.driver.find_element_by_xpath(xpath)
sleep(self.timeout)
element.clear()
sleep(self.timeout)
element.send_keys(text)
sleep(self.timeout)
except:
traceback.print_exc(file=sys.stdout)
import pdb;pdb.set_trace()
return False
return True
def start_driver(self):
#capabilities = DesiredCapabilities.CHROME
#capabilities["goog:loggingPrefs"] = {"performance":"ALL"}
#options = webdriver.ChromeOptions()
#options.add_argument("--start-maximized")
#self.driver = webdriver.Chrome(
# self.chrome_path,
# options=options,
# desired_capabilities=capabilities
# )
self.driver = webdriver.Chrome()
self.driver.implicitly_wait(60)
self.driver.set_page_load_timeout(60)
def login(self):
"""
Login to vdab website
"""
self.driver.get(self.form_url)
sleep(self.timeout)
username = self.driver.find_element('id', 'identifierId')
username.clear()
username.send_keys(self.user)
sleep(self.timeout)
button_next = self.driver.find_element('id', 'identifierNext')
button_next.click()
sleep(self.timeout)
password = self.driver.find_element('name', 'Passwd')
password.clear()
password.send_keys(self.pwd)
sleep(random.randint(1, 4))
self.driver.find_element('id', "passwordNext").click()
sleep(self.timeout)
print("Ingelogd")

if __name__ == "__main__":
cmd = InviterCommand()
cmd.handle()

Comments