commit 7faa287d3b133bfcd2fab732558eea182c9b73d1
parent d98b3fdc3f5e5b1b73c369db3acb53976a8d9bac
Author: Brian C. Lane <bcl@brianlane.com>
Date: Tue, 31 Dec 2019 09:47:15 -0800
Update README with redirect examples
Diffstat:
M | README.md | | | 31 | +++++++++++++++++++++++++++++++ |
1 file changed, 31 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -27,6 +27,37 @@ email will be used to create a new maildir under the `-maildirs` path. For
example, sending an email to user@another.com will create a new maildir at
`/var/spool/maildirs/user`.
+You will likely want to create your maildirs someplace else. On my system the
+`/var/spool/maildirs` directory is owned by the user that is running `letterbox`.
+
+
+## Redirect port 25
+
+*Never* run this as root.
+
+Use a higher port, like 2525, and configure your system's firewall to redirect port 25 to it.
+For example, using nft, you can do this by adding:
+
+ # redirect 25 to 2525
+ table nat {
+ chain prerouting {
+ type nat hook prerouting priority 0;
+ tcp dport 25 dnat :2525
+ }
+ chain postrouting {
+ type nat hook postrouting priority 0;
+ }
+ }
+
+Or with iptables:
+
+ *nat
+ -A PREROUTING -p tcp -d SERVERIP --dport 25 -j REDIRECT --to-ports 2525
+ COMMIT
+
+Replace the SERVERIP with the IP of the server letterbox is running on.
+
+
# WARNING
This code is not meant to be run on the open network. Make sure it is protected behind a firewall,