Subversion Repositories ALCASAR

Rev

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

Rev 3062 Rev 3064
Line 27... Line 27...
27
## smtp_sasl_security_option = noanonymous, relayhost = [laposte.net]:465, smtp_tls_wrappermode = yes
27
## smtp_sasl_security_option = noanonymous, relayhost = [laposte.net]:465, smtp_tls_wrappermode = yes
28
########## smtp.bbox.net:465 (expose mechanisms : LOGIN PLAIN)
28
########## smtp.bbox.net:465 (expose mechanisms : LOGIN PLAIN)
29
## smtp_sasl_security_option = noanonymous, relayhost = [laposte.net]:465, smtp_tls_wrappermode = yes
29
## smtp_sasl_security_option = noanonymous, relayhost = [laposte.net]:465, smtp_tls_wrappermode = yes
30
########## smtp.gmail.com:587 (expose mechanisms : LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH)
30
########## smtp.gmail.com:587 (expose mechanisms : LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH)
31
## smtp_sasl_security_option = noanonymous, relayhost = [gmail.com]:587, smtp_tls_wrappermode = no
31
## smtp_sasl_security_option = noanonymous, relayhost = [gmail.com]:587, smtp_tls_wrappermode = no
-
 
32
## In this case (gmail) the password must be an "application password" created via the gmail account manager (security tab)
32
 
33
 
33
# ****** Paths *******
34
# ****** Paths *******
34
SED="/bin/sed -i"
35
SED="/bin/sed -i"
35
CONF_FILE="/usr/local/etc/alcasar.conf"
36
CONF_FILE="/usr/local/etc/alcasar.conf"
36
POSTFIX_CONF_FILE="/etc/postfix/main.cf"
37
POSTFIX_CONF_FILE="/etc/postfix/main.cf"
Line 183... Line 184...
183
	if [ "$smtpPort" = "465" ]; then # wrappermode is madatory only if port = 465
184
	if [ "$smtpPort" = "465" ]; then # wrappermode is madatory only if port = 465
184
		$SED "s/^smtp_tls_wrappermode =.*/smtp_tls_wrappermode = yes/g" $POSTFIX_CONF_FILE
185
		$SED "s/^smtp_tls_wrappermode =.*/smtp_tls_wrappermode = yes/g" $POSTFIX_CONF_FILE
185
	else
186
	else
186
		$SED "s/^smtp_tls_wrappermode =.*/smtp_tls_wrappermode = no/g" $POSTFIX_CONF_FILE
187
		$SED "s/^smtp_tls_wrappermode =.*/smtp_tls_wrappermode = no/g" $POSTFIX_CONF_FILE
187
	fi
188
	fi
188
	if [ "$domainName" = "localdomain" ]; then  # use the domain name of $mail_Addr to avoid extern smtp servers reject
-
 
189
		domain_of_smtpIP=`echo $smtp_IP|rev|cut -d '.' -f1-2|rev`
189
	domain_of_smtpIP=`echo $smtpIP|rev|cut -d '.' -f1-2|rev`
190
		$SED "s/^myhostname =.*/myhostname = $domain_of_smtpIP/g" $POSTFIX_CONF_FILE
190
	$SED "s/^myhostname =.*/myhostname = $domain_of_smtpIP/g" $POSTFIX_CONF_FILE # use the domain name of $mail_Addr to avoid extern smtp servers reject
191
	else
-
 
192
		$SED "s/^myhostname =.*/myhostname = $hostName.$domainName/g" $POSTFIX_CONF_FILE
-
 
193
	fi
-
 
194
	[ -d ${SASLPATH} ] || mkdir ${SASLPATH}
191
	[ -d ${SASLPATH} ] || mkdir ${SASLPATH}
195
	echo "[${smtpIP}]:${smtpPort} ${mailAddr}:${mailMdp}" > ${SASLPATH}/sasl_passwd
192
	echo "[${smtpIP}]:${smtpPort} ${mailAddr}:${mailMdp}" > ${SASLPATH}/sasl_passwd
196
	postmap ${SASLPATH}/sasl_passwd
193
	postmap ${SASLPATH}/sasl_passwd
197
	chmod -R 644 ${SASLPATH}
194
	chmod -R 644 ${SASLPATH}
198
	chown root:root ${SASLPATH}/sasl_passwd*
195
	chown root:root ${SASLPATH}/sasl_passwd*