forwardemail / forwardemail/forwardemail.net
Support optional SMTP\_HELO\_HOST to separate EHLO identity from WEB\_HOST
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 203
- PR merge metrics
- No merged PRs in 30d
Description
Many self-hosted setups serve the web UI on a subdomain (for example, mail.example.com) while sending mail as the root domain (example.com). Today, adjusting that behavior requires a manual code change because the server always uses WEB\_HOST (or DOMAIN) for both the UI and SMTP HELO/EHLO.
Suggested Approach
We could introduce a new environment variable, SMTP\_HELO\_HOST. When set, the server would use it for the HELO/EHLO hostname; otherwise it would fall back to the existing WEB\_HOST or DOMAIN.
Details
* **Code change in smtp-server.js**
Update the instantiation of SMTPServer so that the name option checks SMTP\_HELO\_HOST first:
```diff
this.server = new SMTPServer({
- name: process.env.WEB_HOST || process.env.DOMAIN,
+ name: process.env.SMTP_HELO_HOST || process.env.WEB_HOST || process.env.DOMAIN,
// other options…
});
```
* **Defaults and documentation**
In .env.defaults, document the new variable:
```ini
# Optional HELO/EHLO hostname. Falls back to WEB_HOST or DOMAIN if unset.
SMTP_HELO_HOST=
```
Add a section to README.md explaining how to:
1. Serve the UI on mail.example.com while advertising EHLO as example.com (by setting SMTP\_HELO\_HOST=example.com)
2. Continue default behavior for single-host setups by leaving it blank
Benefits
* Avoids manual patches for common self-hosted patterns
* Keeps existing behavior unchanged for users who don’t set the new variable
* Improves clarity in configuration and documentation
Contributor guide
Research direction
Update the SMTPServer name option in smtp-server.js, then document SMTP_HELO_HOST in .env.defaults and README.md. Start by checking the existing WEB_HOST or DOMAIN configuration and confirm that the new variable takes precedence while leaving the current fallback behavior unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100