| 1 |
# PostSRSd example configuration file |
| 2 |
# Copyright 2022-2023 Timo Röhling |
| 3 |
# SPDX-License-Identifier: FSFUL |
| 4 |
# |
| 5 |
# The copyright holder gives unlimited permission to copy, distribute and modify |
| 6 |
# this file. |
| 7 |
|
| 8 |
# Local domains |
| 9 |
# Your local domains need not be rewritten, so PostSRSd has to know about them. |
| 10 |
# |
| 11 |
# Example: |
| 12 |
# domains = { "example.com", "example.org", "example.net" } |
| 13 |
# |
| 14 |
domains = {} |
| 15 |
|
| 16 |
# Local domains (file storage) |
| 17 |
# Instead of listing your local domains directly, you can also write them to a |
| 18 |
# file and have PostSRSd read it. This is particularly useful if you have a |
| 19 |
# large number of domains for which you need to act as mail forwarder. PostSRSd |
| 20 |
# reads this file before it chroots and drops root privileges. The file format |
| 21 |
# is one domain per line. |
| 22 |
# |
| 23 |
# Example: |
| 24 |
# domains-file = "@POSTSRSD_CONFIGDIR@/@[email protected]" |
| 25 |
# |
| 26 |
#domains-file = |
| 27 |
|
| 28 |
# Dedicated SRS rewrite domain. |
| 29 |
# The local domain which is used to create the ephemeral SRS envelope |
| 30 |
# addresses. It is recommended that you use a dedicated mail domain for SRS if |
| 31 |
# you serve multiple unrelated domains (e.g. for your customers), to prevent |
| 32 |
# privacy issues. If unset, the first configured local domain is used. |
| 33 |
# |
| 34 |
# Example: |
| 35 |
# srs-domain = "srs.example.com" |
| 36 |
# |
| 37 |
#srs-domain = |
| 38 |
|
| 39 |
# Socketmap lookup table for Postfix integration. |
| 40 |
# Traditionally, PostSRSd interacts with Postfix through the canonicalization |
| 41 |
# lookup tables of the cleanup daemon. If you use a unix socket, be aware that |
| 42 |
# most Postfix instances will jail their cleanup daemon in a /var/spool/postfix |
| 43 |
# chroot, so no other path will be visible to them. Unix sockets are created |
| 44 |
# before PostSRSd chroots and drops root privileges. |
| 45 |
# |
| 46 |
# Examples: |
| 47 |
# socketmap = unix:/var/spool/postfix/srs |
| 48 |
# socketmap = inet:localhost:10003 |
| 49 |
# |
| 50 |
socketmap = unix:/var/spool/postfix/srs |
| 51 |
|
| 52 |
# Socketmap connection keep-alive timeout. |
| 53 |
# After PostSRSd has served a socketmap request, it will keep the connection |
| 54 |
# open for a while longer, in case Postfix has additional queries. PostSRSd |
| 55 |
# will close the connection after the configured time (in seconds) has expired. |
| 56 |
# |
| 57 |
# Examples: |
| 58 |
# keep-alive = 30 |
| 59 |
# |
| 60 |
keep-alive = 30 |
| 61 |
|
| 62 |
# Milter endpoint for MTA integration. |
| 63 |
# PostSRSd can act as a milter to rewrite envelope addresses if it has been |
| 64 |
# built with milter support. Unix sockets are created before PostSRSd chroots |
| 65 |
# and drops root privileges. |
| 66 |
# |
| 67 |
# Examples: |
| 68 |
# milter = unix:/var/spool/postfix/srs_milter |
| 69 |
# milter = inet:localhost:9997 |
| 70 |
# |
| 71 |
#milter = |
| 72 |
|
| 73 |
# Original envelope sender handling. |
| 74 |
# When the envelope sender is rewritten, the original address can either be |
| 75 |
# embedded in the rewritten address, or stored in a local database. Embedding |
| 76 |
# makes PostSRSd work fully stateless, but the full sender address needs to fit |
| 77 |
# into the localpart of the embedded address, effectively limiting the length |
| 78 |
# of forwardable sender addresses to 51 octets. Storing the sender address in a |
| 79 |
# database circumvents this problem, but makes PostSRSd vulnerable to an |
| 80 |
# attacker sending vast amounts of emails with fake sender addresses, all of |
| 81 |
# which need to be stored in the database. |
| 82 |
# |
| 83 |
# If you are unsure which option suits your use-case best, the vast majority of |
| 84 |
# mail addresses will be relatively short, so you should pick "embedded". |
| 85 |
# |
| 86 |
# Examples: |
| 87 |
# original-envelope = embedded |
| 88 |
# original-envelope = database |
| 89 |
# |
| 90 |
original-envelope = embedded |
| 91 |
|
| 92 |
# Database for envelope sender storage. |
| 93 |
# If you decide to store envelope senders in a database, this database will be |
| 94 |
# used. The option is ignored if original-envelope is set to "embedded". Also |
| 95 |
# note that PostSRSd needs to be built with SQLite or Redis support for this. |
| 96 |
# |
| 97 |
# PostSRSd reads this database after it chroots and drops root privileges, so |
| 98 |
# the actual filename is the chroot directory joined with this filename. |
| 99 |
# |
| 100 |
# Examples: |
| 101 |
# envelope-database = "sqlite:@CHROOTABLE_DATADIR@/senders.db" |
| 102 |
# envelope-database = "redis:localhost:6379" |
| 103 |
# |
| 104 |
#envelope-database = "sqlite:@CHROOTABLE_DATADIR@/senders.db" |
| 105 |
|
| 106 |
# Secret keys for signing and verifying SRS addresses. |
| 107 |
# Rewritten addresses are tagged with a truncated HMAC-SHA1 signature, to |
| 108 |
# prevent tampering and forged envelope addresses. You can have more than |
| 109 |
# one signing secret; each line of the secrets file is considered one secret |
| 110 |
# key. If an incoming signature matches any key, it is accepted. Outgoing |
| 111 |
# signatures will always be generated with the first configured secret. |
| 112 |
# |
| 113 |
# For security reasons, you should also make sure that the file is owned and |
| 114 |
# only accessible by root (chmod 600). PostSRSd reads this file before it |
| 115 |
# chroots and drops root privileges. |
| 116 |
# |
| 117 |
# Example: |
| 118 |
# secrets-file = "@POSTSRSD_CONFIGDIR@/@[email protected]" |
| 119 |
# |
| 120 |
secrets-file = "@POSTSRSD_CONFIGDIR@/@[email protected]" |
| 121 |
|
| 122 |
# SRS tag separator |
| 123 |
# This is the character following the initial SRS0 or SRS1 tag of a generated |
| 124 |
# sender address. Valid separators are "=", "+", and "-". Unless you have a |
| 125 |
# very good reason, you should leave this setting at its default. |
| 126 |
# |
| 127 |
separator = "=" |
| 128 |
|
| 129 |
# SRS hash signature length |
| 130 |
# Any SRS address will be signed with a truncated hash to prevent tampering and |
| 131 |
# ensure that only legitimate email bounces will be returned to sender. The |
| 132 |
# default length provides adequate security without taking up too much valuable |
| 133 |
# space. Unless you know what you are doing, you should leave this setting at |
| 134 |
# its default. |
| 135 |
# |
| 136 |
# WARNING: You can break your mail server (or worse, turn it into a spam relay) |
| 137 |
# if you mess up this setting. |
| 138 |
# |
| 139 |
hash-length = 4 |
| 140 |
|
| 141 |
# SRS minimum acceptable hash signature length |
| 142 |
# This is the mininum signature length that PostSRSd considers valid. It is a |
| 143 |
# separate setting because if you decide to increase the hash length, you may |
| 144 |
# want to keep accepting the shorter hashes for a 24 hour grace period. Again, |
| 145 |
# Unless you know what you are doing, you should leave this setting at its |
| 146 |
# default. |
| 147 |
# |
| 148 |
# WARNING: You can break your mail server (or worse, turn it into a spam relay) |
| 149 |
# if you mess up this setting. |
| 150 |
# |
| 151 |
hash-minimum = 4 |
| 152 |
|
| 153 |
# Always rewrite sender addresses |
| 154 |
# You can force PostSRSd to rewrite any sender address, even if it has been |
| 155 |
# rewritten already. You probably do not want to do this, though. |
| 156 |
# |
| 157 |
always-rewrite = off |
| 158 |
|
| 159 |
# Execute PostSRSd as unprivileged user |
| 160 |
# Drop root privileges and run as this user before entering the main loop and |
| 161 |
# handling untrusted input. To prevent PostSRSd from changing users, set this to |
| 162 |
# the empty string. |
| 163 |
# |
| 164 |
# Example: |
| 165 |
# unprivileged-user = "nobody" |
| 166 |
# |
| 167 |
unprivileged-user = "@POSTSRSD_USER@" |
| 168 |
|
| 169 |
# Execute PostSRSd in chroot jail |
| 170 |
# PostSRSd will jail itself in the given directory, which adds an additional |
| 171 |
# layer of protection against the exploitation of security bugs in PostSRSd. To |
| 172 |
# prevent PostSRSd from chrooting, set this to the empty string. |
| 173 |
# |
| 174 |
# Example: |
| 175 |
# chroot-dir = "@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/lib/@PROJECT_NAME@" |
| 176 |
# |
| 177 |
chroot-dir = "@POSTSRSD_CHROOTDIR@" |
| 178 |
|
| 179 |
# Syslog |
| 180 |
# PostSRSd writes log messages to stderr. If you enable this option, PostSRSd |
| 181 |
# will also send all messages to the syslog mail facility. |
| 182 |
# |
| 183 |
syslog = off |
| 184 |
|
| 185 |
# Debug |
| 186 |
# This option makes PostSRSd more verbose in its logging, which can be useful |
| 187 |
# to hunt down configuration problems. |
| 188 |
# |
| 189 |
debug = off |