From 8de1a76003764a2bb83e904aac87ec509a846298 Mon Sep 17 00:00:00 2001 From: Charles N Wyble Date: Tue, 24 Jun 2025 14:25:31 -0500 Subject: [PATCH] all i had forgotten about postfix since i last did this... --- newSrv.sh | 29 ++++++++++++++++++++--------- postfix_canonical | 1 - postfix_generic | 1 + 3 files changed, 21 insertions(+), 10 deletions(-) delete mode 100644 postfix_canonical create mode 100644 postfix_generic diff --git a/newSrv.sh b/newSrv.sh index 306e5e4..d6c138e 100644 --- a/newSrv.sh +++ b/newSrv.sh @@ -52,6 +52,7 @@ function global-systemServiceConfigurationFiles() { echo Now running "$FUNCNAME".... + curl --silent https://dl.knownelement.com/FetchApplyDistPoint/tsys-zshrc > /etc/zshrc curl --silent https://dl.knownelement.com/FetchApplyDistPoint/aliases > /etc/aliases curl --silent https://dl.knownelement.com/FetchApplyDistPoint/rsyslog.conf > /etc/rsyslog.conf @@ -97,6 +98,7 @@ function global-installPackages() { echo Now running "$FUNCNAME".... + # Setup webmin repo, used for RBAC/2fa PAM curl https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh > /tmp/webmin-setup.sh @@ -173,8 +175,9 @@ cockpit \ iptables \ netfilter-persistent \ iptables-persistent \ -telnet \ -postfix +postfix \ +telnet + export KALI_CHECK @@ -226,18 +229,26 @@ echo Now running "$FUNCNAME" apt-file update +systemctl stop postfix +curl --silent https://dl.knownelement.com/FetchApplyDistPoint/postfix_generic> /etc/postfix/generic +dos2unix /etc/postfix/generic +postmap /etc/postfix/generic -curl --silent https://dl.knownelement.com/FetchApplyDistPoint/postfix_canonical > /etc/postfix/canonical -dos2unux /etc/postfix/canonical -postmap /etc/postfix/canonical - -debconf-set-selections <<< "postfix postfix/main_mailer_type string Internet with smarthost" -debconf-set-selections <<< "postfix postfix/relayhost string pfv-netboot.knel.net" postconf -e "inet_protocols = ipv4" postconf -e "inet_interfaces = 127.0.0.1" postconf -e "mydestination= 127.0.0.1" -postconf -e "canonical_maps = hash:/etc/postfix/canonical" +postconf -e "relayhost = tsys-cloudron.knel.net" +postconf -e "smtp_generic_maps = hash:/etc/postfix/generic" +# smtp_generic_maps = hash:/etc/postfix/generic + +systemctl restart postfix + +#This should always work +echo "hi from root to coo@turnsys.com" | mail -s "hi to root(coo@turnsys.com) from $(hostname)" coo@turnsys.com + +#This is in dev and may fail +echo "hi from root to just root" | mail -s "hi directly to root from $(hostname)" root chsh -s $(which zsh) root diff --git a/postfix_canonical b/postfix_canonical deleted file mode 100644 index 99454f6..0000000 --- a/postfix_canonical +++ /dev/null @@ -1 +0,0 @@ -root coo@turnsys.com \ No newline at end of file diff --git a/postfix_generic b/postfix_generic new file mode 100644 index 0000000..0712713 --- /dev/null +++ b/postfix_generic @@ -0,0 +1 @@ +/.*/ tsysrootaccount@knel.net \ No newline at end of file