<commit_before># Setup Postfix

function ee_mod_setup_postfix()
{

	EE_EMAIL=$($EE_CONFIG_GET wordpress.email)
	if [[ $EE_EMAIL = "" ]]; then
		EE_EMAIL=$(git config user.email)
	fi

	EE_HOSTNAME=$(hostname -f)

	#We previously not used this package. So, if some one don't have Postfix-MySQL installed,
	#Postfix will not work
	ee_lib_echo "Installing Postfix-MySQL, please wait..."
	$EE_APT_GET install postfix-mysql \
	|| ee_lib_error "Unable to install Postfix-MySQL, exit status = " $?

	ee_lib_echo "Setting up Postfix, please wait..."
	#Configure Master.cf
	sed -i 's/#submission/submission/' /etc/postfix/master.cf &&
	sed -i 's/#smtps/smtps/' /etc/postfix/master.cf \
	|| ee_lib_error "Unable to setup details in master.cf file, exit status = " $?	

	# Handle SMTP authentication using Dovecot"
	# On Debian6 following command not work
	# postconf "smtpd_sasl_type = dovecot"

	postconf -e "smtpd_sasl_type = dovecot"
	postconf -e "smtpd_sasl_path = private/auth"
	postconf -e "smtpd_sasl_auth_enable = yes"

	postconf -e "smtpd_relay_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination"

	# other destination domains should be handled using virtual domains 
	postconf -e "mydestination = localhost"

	# using Dovecot's LMTP for mail delivery and giving it path to store mail
	postconf -e "virtual_transport = lmtp:unix:private/dovecot-lmtp"

	# virtual mailbox setups
	postconf -e "virtual_uid_maps = static:5000"
	postconf -e "virtual_gid_maps = static:5000"
	postconf -e "virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf"
	postconf -e "virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf"
	#postconf "message_size_limit = 20971520"


	# Setting up Postfix MySQL configuration
	mkdir -p /etc/postfix/mysql
	cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf &>> $EE_COMMAND_LOG && \<commit_msg>Updated Posfix support for Debian 6<commit_after># Setup Postfix

function ee_mod_setup_postfix()
{

	EE_EMAIL=$($EE_CONFIG_GET wordpress.email)
	if [[ $EE_EMAIL = "" ]]; then
		EE_EMAIL=$(git config user.email)
	fi

	EE_HOSTNAME=$(hostname -f)

	#We previously not used this package. So, if some one don't have Postfix-MySQL installed,
	#Postfix will not work
	ee_lib_echo "Installing Postfix-MySQL, please wait..."
	$EE_APT_GET install postfix-mysql \
	|| ee_lib_error "Unable to install Postfix-MySQL, exit status = " $?

	ee_lib_echo "Setting up Postfix, please wait..."
	#Configure Master.cf
	sed -i 's/#submission/submission/' /etc/postfix/master.cf &&
	sed -i 's/#smtps/smtps/' /etc/postfix/master.cf \
	|| ee_lib_error "Unable to setup details in master.cf file, exit status = " $?	

	# Handle SMTP authentication using Dovecot"
	# On Debian6 following command not work ( Postfix < 2.8 )
	# postconf "smtpd_sasl_type = dovecot"
  # The -e option is no longer needed with Postfix version 2.8 and later.

	postconf -e "smtpd_sasl_type = dovecot"
	postconf -e "smtpd_sasl_path = private/auth"
	postconf -e "smtpd_sasl_auth_enable = yes"

	postconf -e "smtpd_relay_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination"

	# other destination domains should be handled using virtual domains 
	postconf -e "mydestination = localhost"

	# using Dovecot's LMTP for mail delivery and giving it path to store mail
	postconf -e "virtual_transport = lmtp:unix:private/dovecot-lmtp"

	# virtual mailbox setups
	postconf -e "virtual_uid_maps = static:5000"
	postconf -e "virtual_gid_maps = static:5000"
	postconf -e "virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf"
	postconf -e "virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf"
	#postconf "message_size_limit = 20971520"


	# Setting up Postfix MySQL configuration
	mkdir -p /etc/postfix/mysql
	cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf &>> $EE_COMMAND_LOG && \
{'fraction_non_alphanumeric': 0.10261569416498995, 'fraction_numerical': 0.009808853118712274, 'mean_word_length': 4.689556509298998, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1367431', 'n_tokens_mistral': 1498, 'n_tokens_neox': 1412, 'n_words': 364}