- cat >/etc/exim4/conf.d/router/900_exim4-config_local_user <<'EOF'
-### router/900_exim4-config_local_user
-#################################
-
-# This router matches local user mailboxes. If the router fails, the error
-# message is "Unknown user".
-
-local_user:
- debug_print = "R: local_user for $local_part@$domain"
- driver = accept
- domains = +local_domains
-# ian: commented this, in conjunction with a dovecot lmtp
-# change so I get mail for all users.
-# check_local_user
- local_parts = ! root
- transport = LOCAL_DELIVERY
- cannot_route_message = Unknown user
-EOF
- cat >/etc/exim4/conf.d/transport/30_exim4-config_dovecot_lmtp <<'EOF'
-dovecot_lmtp:
- driver = lmtp
- socket = /var/run/dovecot/lmtp
- #maximum number of deliveries per batch, default 1
- batch_max = 200
-EOF
-
- cat >/etc/exim4/conf.d/router/190_exim4-config_fsfsmarthost <<'EOF'
-# smarthost for fsf mail
-# ian: copied from /etc/exim4/conf.d/router/200_exim4-config_primary, and added senders = and
-# replaced DCsmarthost with mail.fsf.org
-fsfsmarthost:
- debug_print = "R: smarthost for $local_part@$domain"
- driver = manualroute
- domains = ! +local_domains
- senders = *@fsf.org
- transport = remote_smtp_smarthost
- route_list = * mail.fsf.org byname
- host_find_failed = ignore
- same_domain_copy_routing = yes
- no_more
-EOF
-
- # https://blog.dhampir.no/content/make-exim4-on-debian-respect-forward-and-etcaliases-when-using-a-smarthost
- # i only need .forwards, so just doing that one.
- cd /etc/exim4/conf.d/router
- b=userforward_higher_priority
- # replace the router name so it is unique
- sed -r s/^\\S+:/$b:/ 600_exim4-config_userforward >175_$b
-
- # begin setup passwd.client
- f=/etc/exim4/passwd.client
- rm -f /etc/exim4/passwd.client
- install -m 640 -g Debian-exim /dev/null $f
- cat /etc/mailpass| while read -r domain port pass; do
- # reference: exim4_passwd_client(5)
- printf "%s:%s\n" "$domain" "$pass" >>$f
- done
- # end setup passwd.client
-
- # by default, only 10 days of logs are kept. increase that.
- sed -ri 's/^(\s*rotate\s).*/\11000/' /etc/logrotate.d/exim4-base
-
- systemctl restart exim4