1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

smtpsrv: Pass EHLO/HELO domain to the post-data hook

Some utilities might want to access the EHLO/HELO domain in the
post-data hook (for example, to do additional SPF validations).

This patch implements that support, including sanitizing the EHLO domain
on the environment variable to reduce the risk of problems.
This commit is contained in:
Alberto Bertogli
2020-09-14 21:17:32 +01:00
parent 5bebb00af9
commit 1cc7b9a864
4 changed files with 63 additions and 0 deletions

View File

@@ -41,6 +41,10 @@ The environment will contain the following variables:
- `$PATH`: The server's `$PATH` env variable.
- `$PWD`: The working directory, which will be the config directory.
- `$REMOTE_ADDR`: IP address of the remote side of the connection.
- `$EHLO_DOMAIN`: EHLO/HELO domain, as given by the client; sanitized for
safety.
- `$EHLO_DOMAIN_RAW`: Same as `$EHLO_DOMAIN`, but not sanitized; be careful as
it can contain problematic characters.
- `$MAIL_FROM`: MAIL FROM address.
- `$RCPT_TO`: RCPT TO addresses, space separated.
- `$AUTH_AS`: Authenticated user; empty if the connection has not