exim-docker/exim.conf.m4

74 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2024-12-21 12:46:39 +01:00
dnl values
define(`HOSTNAME', esyscmd(`echo -n $HOSTNAME'))dnl
define(`LOCALMAILNAME', esyscmd(`echo -n $LOCALMAILNAME'))dnl
define(`SMARTHOST', esyscmd(`echo -n $SMARTHOST'))dnl
define(`SMARTHOST_USER', esyscmd(`echo -n $SMARTHOST_USER'))dnl
define(`SMARTHOST_PASS', esyscmd(`echo -n $SMARTHOST_PASS'))dnl
define(`RELAYNETS', esyscmd(`echo -n $RELAYNETS'))dnl
2025-02-28 20:01:44 +01:00
define(`WHITELISTED_RECIPIENTS', esyscmd(`echo -n $WHITELISTED_RECIPIENTS'))dnl
2024-12-21 12:46:39 +01:00
ifelse(SMARTHOST, `', `
errprint(`Error: SMARTHOST not set')
m4exit(1)
')
ifelse(HOSTNAME, `', `
errprint(`Error: HOSTNAME not set')
m4exit(1)
')
2024-12-21 14:34:08 +01:00
dnl ----------------------------------------------------------------
2024-12-21 12:46:39 +01:00
dnl template for exim.conf
primary_hostname = HOSTNAME
acl_smtp_rcpt = acl_check_rcpt
2024-12-21 13:37:17 +01:00
tls_advertise_hosts =
2024-12-21 13:35:41 +01:00
2024-12-21 12:46:39 +01:00
begin routers
smarthost_route:
driver = manualroute
domains = *
transport = smarthost_smtp
route_list = * SMARTHOST
begin transports
smarthost_smtp:
driver = smtp
port = 25
multi_domain
ifelse(SMARTHOST_USER, `', `', `dnl
hosts_require_auth = *
')
ifelse(SMARTHOST_USER, `', `', `
begin authenticators
plain:
driver = plaintext
public_name = PLAIN
client_send = ^SMARTHOST_USER^SMARTHOST_PASS
login:
driver = plaintext
public_name = LOGIN
client_send = : SMARTHOST_USER : SMARTHOST_PASS
')
begin acl
acl_check_rcpt:
accept
hosts = RELAYNETS
2025-02-28 20:03:53 +01:00
ifelse(WHITELISTED_RECIPIENTS, `', `', `
2025-02-28 20:01:44 +01:00
domains = WHITELISTED_RECIPIENTS
')
2024-12-21 12:46:39 +01:00
deny
2025-02-28 20:01:44 +01:00
message = "550 5.7.1 Relaying denied"
2024-12-21 12:46:39 +01:00
ifelse(LOCALMAILNAME, `', `', `
begin rewrite
*@* ${1}@LOCALMAILNAME Ffrs
')