I recently discovered a clever way to handle temporary email addresses without the hassle of creating a new account. By simply switching the domain portion of your email address from ‘gmail.com’ to ‘googlemail.com’, you can set up an auto-deletion rule to instantly remove any incoming messages sent to that address. This tactic keeps your primary inbox neat and organized, preventing clutter from unwanted emails. Check out this custom filter implementation below:
import re
def temp_email_filter(email):
pattern = r'.*@googlemail\.com$'
if re.match(pattern, email):
return 'discard'
return 'keep'
# Example usage
status = temp_email_filter('[email protected]')
print('Email status:', status)