-
I'm trying to get started with stalwart-smtp and I'm running into problems with address rewriting. In order to get my feet wet, I simply want to rewrite all addresses to either [session.rcpt]
relay = true
[session.from]
rewrite = [
{ if = "sender", matches = ".*", then = "[email protected]" },
{ else = false },
]
[session.to]
rewrite = [
{ if = "rcpt", matches = ".*", then = "[email protected]" },
{ else = false },
] Whatever I do, the addresses are not being rewritten. Can anyone tell me what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
This was an error in the documentation, it has been fixed now. The correct attribute names are |
Beta Was this translation helpful? Give feedback.
-
I've tried those too, and in |
Beta Was this translation helpful? Give feedback.
-
Version 0.3.4 has just been released fixing this issue. To upgrade just replace the binary. |
Beta Was this translation helpful? Give feedback.
I found the problem. It was tricky because rewriting is working on the test suite but on the compiled binary it is not possible to use the required envelope keys. This has now been fixed and a patch will be released tomorrow.
Just to confirm how it is supposed to work:
sender
andsender-domain
are available onsession.mail.rewrite
andsession.rcpt.rewrite
rcpt
andrcpt-domain
are only available fromsession.rcpt.rewrite
.