changeset 190:21d67aae89c0

improve local mail delivery
author drewp@bigasterisk.com
date Mon, 12 Jun 2023 13:03:09 -0700
parents ef443257ae9c
children d7ddfe3837b0
files templates/mail/main.cf.j2 templates/mail/mydestination.j2
diffstat 2 files changed, 19 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/templates/mail/main.cf.j2	Mon Jun 12 13:01:59 2023 -0700
+++ b/templates/mail/main.cf.j2	Mon Jun 12 13:03:09 2023 -0700
@@ -24,12 +24,20 @@
 # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
 # information on enabling SSL in the smtp client.
 
-relayhost = {{ 'prime.bigasterisk.com' if host.name == 'bang' else '' }}
+relayhost = {{ 'prime.bigasterisk.com' if host.name != 'prime' else '' }}
 
-myhostname = {{ 'bang.' if host.name == 'bang' else '' }}bigasterisk.com
 alias_maps = hash:/etc/postfix/aliases
 alias_database = hash:/etc/postfix/aliases
+
+{% if host.name == 'prime' %}
+myhostname = bigasterisk.com
 mydestination = /etc/postfix/mydestination
+{% else %}
+myhostname = {{ host.name }}.bigasterisk.com
+# must relay, even if you think you're the destination name is correct
+mydestination = 
+{% endif %}
+
 relay_domains = $mydestination
 mynetworks_style = subnet
 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.1.0.0/16 10.3.0.0/16 10.5.0.0/24 192.168.0.3/32 [fc7b:54e8:69a9:e165:86c8:9d42:6cc5:b2a1]/128 [fcc8:29d:5660:ec63:754f:37af:de4a:a9df]/128
@@ -37,12 +45,15 @@
 # allow realuser+fakepart@bigasterisk.com
 recipient_delimiter = +
 
-# maildir delivery on prime
+{% if host.name == 'prime' %}
+# mail can only deliver on prime
 mailbox_size_limit = 0
 home_mailbox = Maildir/
 biff = no
 message_size_limit = 50000000
 #mailbox_command = procmail -a "$EXTENSION"
+{% endif %}
+
 
 # http://www.spamcop.net/fom-serve/cache/349.html
 # upgraded, per http://www.wrightthisway.com/Articles/000062.html
@@ -80,9 +91,11 @@
 
 queue_directory = /var/spool/postfix
 
-# Postfix is the final destination for the specified list 
-virtual_alias_domains = adkinslawgroup.com iveseenyoubefore.com fantasyfamegame.com maxradi.us whopickedthis.com quickwitretort.com drewp.quickwitretort.com kelsi.quickwitretort.com photo.bigasterisk.com whatsplayingnext.com williamperttula.com        
+# Postfix is the final destination for the specified list
+{% if host.name == 'prime' %}
+virtual_alias_domains = adkinslawgroup.com iveseenyoubefore.com fantasyfamegame.com maxradi.us whopickedthis.com quickwitretort.com drewp.quickwitretort.com kelsi.quickwitretort.com photo.bigasterisk.com whatsplayingnext.com williamperttula.com
 
 # Optional lookup tables that alias specific mail addresses or domains to other local or remote addresses
 virtual_alias_maps = hash:/etc/postfix/virtual
+{% endif %}
 
--- a/templates/mail/mydestination.j2	Mon Jun 12 13:01:59 2023 -0700
+++ b/templates/mail/mydestination.j2	Mon Jun 12 13:03:09 2023 -0700
@@ -15,3 +15,4 @@
 kelsi.quickwitretort.com
 maxradi.us
 williamperttula.com
+ditto.bigasterisk.com