Closed sorcix closed 1 month ago
I'm pretty sure this already exists.
From the docs: --smtp-allowed-recipients
: Only allow SMTP recipients matching a regular expression. Use this to restrict incoming mail to only those sent to a pre-defined list. An example would be --smtp-allowed-recipients '@example.com$'
to only allow emails sent to recipients ending in @example.com
.
D'oh. I managed to overlook an option that's named almost the same as what I proposed. That's what I was looking for, thanks.
All good ;-) There's a lot of options unfortunately, so sometimes easy to overlook stuff.
I'm using Mailpit as a simple single-user temporary e-mail server. While I understand it's not meant to be used like this, it actually works really great. The only downside, for my use case, is that it accepts every random message sent to port 25.
Would you accept a PR that adds an additional flag
--smtp-allow-recipients
that takes a regex and rejects/drops e-mails where the recipient doesn't match? Could be used with something like@(temp.example.com|foo.com)$
.