简体中文 / [English]


Receiving Emails with Your Own Domain and Custom Aliases

 

This article is currently an experimental machine translation and may contain errors. If anything is unclear, please refer to the original Chinese version. I am continuously working to improve the translation.

2024.06.21 Update: During domain migration, I moved me@lyc8503.net to Lark Mail (the international version of Feishu), which is also free, requires no phone number verification, and doesn’t require linking a WeChat account.

2023.10.06 Update: The Forward Email service mentioned below has discontinued free service for all domain suffixes except for a very small whitelist due to abuse (though you can choose to self-host). Later, I tried Mailgun, which not only requires a credit card but also tends to get flagged as abuse and banned easily. Ultimately, I settled on Cloudflare Email Workers to achieve this functionality (CF is relatively more reliable).

Although CF Workers don’t offer as many preset rules or syntax, they allow writing custom logic in JavaScript, making them far more flexible.


For a long time, I used QQ’s Foxmail email address when signing up for various online services. But if one day my QQ account gets disabled, recovering all associated accounts would be a huge hassle.

Now I use admin@lyc8503.net with Tencent Enterprise Mail, which meets basic needs for sending and receiving emails. Even if Tencent ever stops providing service, I can still take my domain elsewhere.

But… Tencent Enterprise Mail only allows a limited number of users. The entire domain belongs to me, yet I can only receive emails with a few predefined prefixes — not ideal.

The Goal

Receive emails via xxx@lyc8503.net, using different addresses for different websites — for example, GitHub@lyc8503.net for GitHub, or other aliases for side accounts (similar to Gmail’s user+alias@gmail.com feature).

This makes email organization easier and offers some privacy protection. If I start receiving spam from a specific alias, I can simply block that alias — kind of like a self-hosted “disposable email” service.

Implementation

Self-hosting an SMTP server is certainly possible, but it requires a VPS, involves complex setup, and carries the risk of being blocked or rejected by major email providers.

After some research, I found Forward Email — an open-source, free email forwarding service. For simplicity, I went with their hosted free plan and followed the setup instructions on their site.

My main domain lyc8503.net is still using Tencent Enterprise Mail, so I dedicated @reg.lyc8503.net specifically for registering on various websites.

Forward Email supports regular expressions, so I set up the forwarding rule as: forward-email=/^(.*)$/:lyc8503+$1@gmail.com

This forwards emails sent to abc@reg.lyc8503.net directly to lyc8503+abc@gmail.com.

Drawbacks

The destination email address (my Gmail) is exposed in DNS records, meaning anyone can look it up. Only upgrading to a more advanced solution or self-hosting can hide the final recipient.

Also, my domain is currently registered with Chinese authorities (ICP备案), so the registration info is publicly accessible via domain lookup. (One-click doxxing)

But then again, email addresses are usually considered backend information and aren’t typically exposed on the frontend. Most domestic services require phone number binding anyway, and foreign services probably won’t bother checking Chinese registration records…

This article is licensed under the CC BY-NC-SA 4.0 license.

Author: lyc8503, Article link: https://blog.lyc8503.net/en/post/mail-using-custom-domain/
If this article was helpful or interesting to you, consider buy me a coffee¬_¬
Feel free to comment in English below o/