From: Christian Heller Date: Tue, 6 Oct 2015 13:47:45 +0000 (+0200) Subject: Enhance mail server config in server postinstall script. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdb.prefix%7D%7D/static/blog?a=commitdiff_plain;h=52810a2158f5c9af7cd4fbef11a903b27a79e7f1;p=config Enhance mail server config in server postinstall script. --- diff --git a/dotfiles_user_server/mailfilter b/dotfiles_user_server/mailfilter new file mode 100644 index 0000000..ff041e0 --- /dev/null +++ b/dotfiles_user_server/mailfilter @@ -0,0 +1,2 @@ +DEFAULT="$HOME/mail/new_inbox/" +logfile "$HOME/.mailfilter.log" diff --git a/dotfiles_user_server/muttrc b/dotfiles_user_server/muttrc index 6be1586..5c91d2e 100644 --- a/dotfiles_user_server/muttrc +++ b/dotfiles_user_server/muttrc @@ -21,8 +21,6 @@ unignore from: subject to cc date # Force some variables for From: and Message-ID: generation. set realname="Christian Heller" -set from="c.heller@plomlompom.de" -set hostname="plomlompom.de" # Allow me to reply myself. set reply_self = yes diff --git a/jessie_start_server.sh b/jessie_start_server.sh index 0f9746c..dcdfbf4 100755 --- a/jessie_start_server.sh +++ b/jessie_start_server.sh @@ -84,10 +84,12 @@ su plom -c 'mkdir -p /home/plom/.vimbackups/' # Set up openssh-server. apt-get -y install openssh-server -# Set up mail client system. -apt-get -y install getmail4 procmail mutt -su plom -c 'mkdir -p /home/plom/mail' +# Set up mail system. +apt-get -y install getmail4 procmail mutt postfix maildrop +su plom -c 'mkdir -p /home/plom/mail/' su plom -c 'mkdir -p /home/plom/mail/inbox/{cur,new,tmp}' +su plom -c 'mkdir -p /home/plom/mail/new_inbox/{cur,new,tmp}' +cp config/systemfiles/mail.cf /etc/postfix/main.cf # Set up screen. apt-get -y install screen diff --git a/systemfiles/main.cf b/systemfiles/main.cf new file mode 100644 index 0000000..4bc9749 --- /dev/null +++ b/systemfiles/main.cf @@ -0,0 +1,20 @@ +# /etc/postfix/main.cf + +# Use maildrop as MDA. +mailbox_command = /usr/bin/maildrop + +# Restrictive relaying policy. +smtpd_relay_restrictions = permit_mynetworks defer_unauth_destination + +# What domains to receive mail for: names of local server. +mydestination = plomlompom.com, localhost + +# What clients to relay mail from: only local server. +mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 + +# Paranoid maximum error notification. +notify_classes=2bounce, bounce, data, delay, policy, protocol, resource, software + +# Use opendkim at given port as mail filter. +#non_smtpd_milters = inet:localhost:12301 +#smtpd_milters = inet:localhost:12301