Skip to content

Commit ebe0147

Browse files
committed
fix for administrativ mails
1 parent 9ff9822 commit ebe0147

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

copy/opt/core/var/mdata-setup/includes/31-exim.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ EXIMLOCAL=/opt/local/etc/exim/configure.local
1111
echo "## File generated by mdata-setup script" > $EXIMLOCAL
1212

1313
# Hostname
14-
echo "primary_hostname = $(/usr/sbin/mdata-get sdc:hostname)" >> $EXIMLOCAL
14+
echo "PRIMARY_HOSTNAME = $(/usr/sbin/mdata-get sdc:hostname)" >> $EXIMLOCAL
1515

1616
# Administrativ Emailaddress
1717
RFC2142_MAIL=$(/usr/sbin/mdata-get rfc2142_mail 2>/dev/null)

copy/opt/local/etc/exim/configure

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ ALIASPREFIX = mail.alias:obj:
1111

1212
.include LOCALCONF
1313

14+
# set primary hostname from macro
15+
primary_hostname = PRIMARY_HOSTNAME
16+
1417
# security reasons
1518
smtp_accept_max = 500
1619

17-
domainlist local_domains = $primary_hostname : localhost
20+
domainlist local_domains = PRIMARY_HOSTNAME : localhost
1821

1922
redis_servers = 127.0.0.1//
2023

@@ -29,6 +32,9 @@ spamd_address = 127.0.0.1 11333
2932
#>> !warning: these hosts do not have to authenticate!
3033
hostlist submission_hosts = <; 127.0.0.1;:1
3134

35+
# special handling for rfc 2142 usernames and for root
36+
localpartlist rfc2142_localparts = postmaster : abuse : noc : security : root
37+
3238
#>> hosts that are not allowed to submit mails
3339
#>> it's a ;-separated list to allow IPv6
3440
hostlist blacklist_hosts = <;
@@ -140,14 +146,24 @@ begin acl
140146
#>> router
141147
#>>
142148
begin routers
149+
150+
administrativ_mails:
151+
driver = redirect
152+
local_parts = +rfc2142_localparts
153+
condition = ${if or{ \
154+
{inlist{${domain}}{${listnamed:local_domains}}} \
155+
{eq{${domain}}{}} \
156+
} }
157+
data = ADMIN_CONTACT
158+
redirect_router = lookuphost
159+
143160
#>> dnslookup - for all mails to all recipients
144161
lookuphost:
145162
driver = dnslookup
146163
transport = remote_smtp
147164
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
148165
no_more
149166

150-
151167
#>>
152168
#>> transport
153169
#>>

0 commit comments

Comments
 (0)