I was looking for a way to have time limited email addresses on Uberspace. This can easily be implemented but you cannot reject emails then they are transmitted to the email server, only after they have already been received. Hence, even if you do not see them, spam needs to be processed.
To circumvent this problem, I wrote a python script which will create .qmail files so the mail server knows which address to reject and which not. After some time has passed (in my case, I chose 1 day), the script will remove these files and replace them with new ones.
The script is called via cron once a day.
Here is my script:
With this script running once a day, you have three email addresses which are valid at the same time. All three email addressses will be handled by the .temp_mail_addr file.
Check my impressum for a live demo: Impressum
If now a crawler sees this temporal email address, it can only sent you spam for a maximum of 2 days. You could also cut down on this time frame by making the addresses hour based but for me, this was enough to remove all spam on these addresses.