GIT_REPO_DIR="postfix_config"
GIT_REPO="https://@@acount@@:@@pwd@@@git.pixelpark.com/ppadmin/${GIT_REPO_DIR}.git"
POSTFIX_MYORIGIN='pixelpark.net'
+POSTFIX_RELAYHOST='[mx.pixelpark.net]'
echo
echo "Some information:"
log "Installing and configuring Postfix ..."
local -a main_options_remove=(
+ 'address_verify_map'
+ 'address_verify_relay_transport'
+ 'broken_sasl_auth_clients'
'command_directory'
'daemon_directory'
'data_directory'
'debug_peer_level'
'debugger_command'
+ 'hash_queue_depth'
'html_directory'
'lmtp_tls_loglevel'
'mail_owner'
'manpage_directory'
+ 'masquerade_domains'
+ 'master_service_disable'
+ 'maximal_queue_lifetime'
'queue_directory'
+ 'readme_directory'
+ 'recipient_canonical_maps'
+ 'recipient_delimiter'
+ 'relay_domains'
'sample_directory'
'sender_dependent_default_transport_maps'
'sender_dependent_relayhost_maps'
'smtpd_client_restrictions'
'smtpd_helo_restrictions'
'smtpd_recipient_restrictions'
+ 'smtpd_relay_restrictions'
+ 'smtpd_sasl_auth_enable'
+ 'smtpd_sasl_authenticated_header'
'smtpd_sasl_local_domain'
'smtpd_sender_restrictions'
'smtpd_tls_auth_only'
'smtpd_use_tls'
'tls_random_prng_update_period'
'tls_random_source'
+ 'transport_maps'
'unknown_local_recipient_reject_code'
+ 'unverified_recipient_reject_code'
)
local -a main_options_set=(
+ 'alias_database = ${default_database_type}:/etc/aliases'
+ 'alias_maps ='
'append_dot_mydomain = no'
'biff = no'
'default_database_type = hash'
'inet_protocols = all'
+ 'local_recipient_maps ='
+ 'local_transport = error:5.1.1 Mailbox unavailable'
'mailbox_size_limit = 0'
'message_size_limit = 358400000'
+ 'mydestination ='
"mydomain = ${POSTFIX_MYORIGIN}"
"myhostname = ${hostname}"
+ 'mynetworks = 127.0.0.0/8'
+ "relayhost = ${POSTFIX_RELAYHOST}"
'smtp_generic_maps = ${default_database_type}:/etc/postfix/generic'
'smtp_tls_note_starttls_offer = yes'
'smtp_tls_security_level = none'
'smtpd_banner = $myhostname ESMTP $mail_name $mail_version'
+ 'virtual_alias_maps = ${default_database_type}:/etc/postfix/virtual'
)
local option=
for option in "${main_options_remove[@]}" ; do
echo "Removing postfix option '${option}' ..."
- sed -i -e "s/^\\(${option}( |$).*\\)/#\\1/" "/etc/postfix/main.cf"
+ postconf -X "${option}"
+ #sed -i -e "s/^\\(${option}( |$).*\\)/#\\1/" "/etc/postfix/main.cf"
done
for option in "${main_options_set[@]}" ; do
git clone "${url}"
cd "${GIT_REPO_DIR}"
+ echo "Copying virtual ..."
+ cp -pv maps/virtual-nullclient-webmaster /etc/postfix/virtual
+ postmap hash:/etc/postfix/virtual
+
+ echo "Copying master.cf ..."
+ cp -pv master-nullclient.cf /etc/postfix/master.cf
+
cd ..
echo "Removing '${GIT_REPO_DIR}'"
rm -rf "${GIT_REPO_DIR}"
cd
+ echo
+ echo "${HASH_LINE}"
+ echo "Generated main postfix configuration:"
+ echo
+ postconf -n
+ echo
+ echo "${HASH_LINE}"
+ echo "Generated master postfix configuration:"
+ echo
+ postconf -M
+ echo
+
}
#-----------------------------------------------------------
dist_upgrade
install_clamav
install_puppet
+ install_postfix
config_rsyslog_to_remote
remove_ipv6_localhost