Subversion Repositories ALCASAR

Rev

Rev 2994 | Rev 3018 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2994 Rev 3005
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2994 2022-03-08 23:02:14Z rexy $
2
#  $Id: alcasar.sh 3005 2022-04-26 22:12:46Z rexy $
3
 
3
 
4
# ALCASAR is a Free and open source NAC (Network Access Controler) created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
4
# ALCASAR is a Free and open source NAC (Network Access Controler) created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
5
# ALCASAR is based on a stripped Mageia (LSB) with the following open source softwares Coovachilli, freeradius, mariaDB, lighttpd, php, netfilter, e2guardian, ntpd, openssl, dnsmasq, unbound, gammu, clamav, Ulog, fail2ban, vnstat, wkhtml2pdf, ipt_NETFLOW, NFsen and NFdump
5
# ALCASAR is based on a stripped Mageia (LSB) with the following open source softwares Coovachilli, freeradius, mariaDB, lighttpd, php, netfilter, e2guardian, ntpd, openssl, dnsmasq, unbound, gammu, clamav, Ulog, fail2ban, vnstat, wkhtml2pdf, ipt_NETFLOW, NFsen and NFdump
6
# contact : info@alcasar.net
6
# contact : info@alcasar.net
7
 
7
 
Line 2132... Line 2132...
2132
##                       "mail_service"                         ##
2132
##                       "mail_service"                         ##
2133
## - Install Postfix conf for email registration method         ##
2133
## - Install Postfix conf for email registration method         ##
2134
##################################################################
2134
##################################################################
2135
mail_service()
2135
mail_service()
2136
{
2136
{
2137
	[ -e /etc/postfix/main.cf.default ] || cp /etc/postfix/main.cf /etc/postfix/main.cf.default
2137
	[ -e /etc/postfix/main.cf.orig ] || cp /etc/postfix/main.cf /etc/postfix/main.cf.orig
2138
	cat << EOT >> /etc/postfix/main.cf
2138
	cat << EOT >> /etc/postfix/main.cf
-
 
2139
smtp_sasl_auth_enable = yes
-
 
2140
smtp_sasl_security_options = noanonymous
-
 
2141
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
-
 
2142
smtpd_banner = \$myhostname ESMTP
-
 
2143
relayhost =
2139
myhostname = $HOSTNAME.$DOMAIN
2144
myhostname = $HOSTNAME.$DOMAIN
2140
EOT
2145
EOT
2141
# Enable SASL authentication
-
 
2142
	$SED "s?^smtp_sasl_auth_enable =.*?smtp_sasl_auth_enable = yes?g" /etc/postfix/main.cf
-
 
2143
# Disallow methods that allow anonymous authentication
-
 
2144
	$SED "s?^smtp_sasl_security_options =.*?smtp_sasl_security_options = noanonymous?g" /etc/postfix/main.cf
-
 
2145
# Location of sasl_passwd
-
 
2146
	$SED "s?^smtp_sasl_password_maps =.*?smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd?g" /etc/postfix/main.cf
-
 
2147
# Banner anonymisation
-
 
2148
	$SED "s?^smtpd_banner =.*?smtpd_banner = \$myhostname ESMTP?g" /etc/postfix/main.cf
-
 
2149
	chown -R postfix:postfix /var/lib/postfix
2146
	chown -R postfix:postfix /var/lib/postfix
2150
} # end of mail_service
2147
} # end of mail_service
2151
 
2148
 
2152
##################################################################
2149
##################################################################
2153
##                    Fonction "post_install"                   ##
2150
##                    Fonction "post_install"                   ##
Line 2187... Line 2184...
2187
	echo "LDAP_CERT_REQUIRED=" >> $CONF_FILE
2184
	echo "LDAP_CERT_REQUIRED=" >> $CONF_FILE
2188
	echo "SMS=off" >> $CONF_FILE
2185
	echo "SMS=off" >> $CONF_FILE
2189
	echo "SMS_NUM=" >> $CONF_FILE
2186
	echo "SMS_NUM=" >> $CONF_FILE
2190
	echo "MAIL=off" >> $CONF_FILE
2187
	echo "MAIL=off" >> $CONF_FILE
2191
	echo "MAIL_TYPE=" >> $CONF_FILE
2188
	echo "MAIL_TYPE=" >> $CONF_FILE
-
 
2189
	echo "MAIL_SMTP=" >> $CONF_FILE
2192
	echo "MAIL_SMTP_IP=" >> $CONF_FILE
2190
	echo "MAIL_SMTP_IP=" >> $CONF_FILE
2193
	echo "MAIL_PORT=" >> $CONF_FILE
2191
	echo "MAIL_PORT=" >> $CONF_FILE
2194
	echo "MAIL_SMTP=" >> $CONF_FILE
-
 
2195
	echo "MAIL_ADDR=" >> $CONF_FILE
2192
	echo "MAIL_ADDR=" >> $CONF_FILE
2196
	echo "MAIL_WHITEDOMAIN=" >> $CONF_FILE
2193
	echo "MAIL_WHITEDOMAIN=" >> $CONF_FILE
2197
	echo "MAIL_ADMIN=" >> $CONF_FILE
2194
	echo "MAIL_ADMIN=" >> $CONF_FILE
2198
	echo "BL_PUREIP=on" >> $CONF_FILE
2195
	echo "BL_PUREIP=on" >> $CONF_FILE
2199
	echo "BL_SAFESEARCH=off" >> $CONF_FILE
2196
	echo "BL_SAFESEARCH=off" >> $CONF_FILE