Skip to content

Instantly share code, notes, and snippets.

@adiberr
Last active September 20, 2024 22:14
Show Gist options
  • Select an option

  • Save adiberr/9d82e4f10c73f40ad021e0d0efd5a2c8 to your computer and use it in GitHub Desktop.

Select an option

Save adiberr/9d82e4f10c73f40ad021e0d0efd5a2c8 to your computer and use it in GitHub Desktop.
Homelab Mail Server

install mailserver

add an account

hostname config

install postfix

sudo apt install postfix

stelite system

postfix config

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
~ myhostname = vm01.homelab.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
+ sender_canonical_maps = hash:/etc/postfix/canonical
myorigin = /etc/mailname
mydestination = localhost.$mydomain, localhost
relayhost = homelab.local
~ mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.1.X/32
mailbox_size_limit = 0
recipient_delimiter = +
~ inet_interfaces = all
~ inet_protocols = all

postfix canonical config

sudo echo '[email protected]  [email protected]' >> /etc/postfix/canonical
sudo postmap /etc/postfix/canonical
sudo systemctl reload postfix

postgrey whitelist

install logwatch

sudo apt install logwatch

logwatch config

logwatch test


 ################### Logwatch 7.5.5 (01/22/21) #################### 
        Processing Initiated: Fri Sep 20 23:12:15 2024
        Date Range Processed: yesterday
                              ( 2024-Sep-19 )
                              Period is day.
        Detail Level of Output: 10
        Type of Output/Format: mail / text
        Logfiles for Host: vm01.homelab.local
 ################################################################## 
 
 --------------------- Cron Begin ------------------------ 
 
 ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment