diff --git a/install_postfixadmin.sh b/install_postfixadmin.sh index 5cc28cd..a7ae94b 100755 --- a/install_postfixadmin.sh +++ b/install_postfixadmin.sh @@ -389,7 +389,7 @@ if [[ -z "$APACHE_VHOST_DIR" ]] ; then fi fi -[[ -n "${COMPOSER}" ]] || COMPOSER=${DEFAULT_COMPOSER} +[[ -n "${COMPOSER}" ]] || COMPOSER=${DEFAULT_COMPOSER} [[ -n "$POSTFIX_DB_TYPE" ]] || fatal "Database Type of Postfix Database (POSTFIX_DB_TYPE) not present!" [[ -n "$POSTFIX_DB_HOST_MYSQL" ]] || POSTFIX_DB_HOST_MYSQL="$DEFAULT_POSTFIX_DB_HOST_MYSQL" @@ -430,7 +430,7 @@ if [[ "$POSTFIX_DB_TYPE" = "mysql" ]] ; then fi else - + echononl "\tGet MySQL command.." mysql_command="$(which mysql)" if [[ $? -eq 0 ]]; then @@ -453,9 +453,9 @@ if [[ "$POSTFIX_DB_TYPE" = "mysql" ]] ; then elif [[ -f "/etc/mysql/debian.cnf" ]] ; then MYSQL_CREDENTIALS="--defaults-file=/etc/mysql/debian.cnf" else - fatal "Parameter 'MYSQL_CREDENTIALS' cannot be determined automated. + fatal "Parameter 'MYSQL_CREDENTIALS' cannot be determined automated. - Use configuration file "$conf_file" to set + Use configuration file "$conf_file" to set parameter manually." fi fi @@ -475,7 +475,7 @@ fi if [[ "$ENCRYPTION_METHOD" =~ dovecot ]]; then [[ -n "$DOVEADM_PW" ]] || DOVEADM_PW=$DEFAULT_DOVEADM_PW -fi +fi [[ -n "$DELETED_MAILBOX_DIR" ]] || DELETED_MAILBOX_DIR=$DEFAULT_DELETED_MAILBOX_DIR [[ -n "$DELETED_DOMAINS_DIR" ]] || DELETED_DOMAINS_DIR=$DEFAULT_DELETED_DOMAINS_DIR @@ -767,7 +767,7 @@ fi if ! $database_exists ; then echononl "\tCreate Postfix Database '$POSTFIX_DB_NAME'" - if [ "$POSTFIX_DB_TYPE" = "mysql" ]; then + if [ "$POSTFIX_DB_TYPE" = "mysql" ]; then echo -n " (MySQL).." mysql $MYSQL_CREDENTIALS -N -s -e \ "CREATE DATABASE IF NOT EXISTS $POSTFIX_DB_NAME CHARACTER SET utf8 COLLATE utf8_general_ci" >> $log_file 2>&1 @@ -817,7 +817,7 @@ else else _db_backup_file_name="${POSTFIX_DB_NAME}-pfa.${backup_date}.sql" fi - if [[ "$POSTFIX_DB_TYPE" = "mysql" ]]; then + if [[ "$POSTFIX_DB_TYPE" = "mysql" ]]; then echo -n " (MySQL).." mysqldump $MYSQL_CREDENTIALS --opt $POSTFIX_DB_NAME > ${WEBSITE_BASEDIR}/${_db_backup_file_name} 2> $log_file if [[ $? -eq 0 ]]; then @@ -1011,7 +1011,7 @@ else fi - + echo -e "\n\n\t\033[37m\033[1mBase install Postfixadmin..\033[m\n" @@ -1358,13 +1358,13 @@ if [[ "$PHP_TYPE" = "fcgid" ]] ; then #!/bin/sh export PHPRC="${WEBSITE_BASEDIR}/conf/" export TMPDIR="${WEBSITE_BASEDIR}/tmp" -# PHP child process management (PHP_FCGI_CHILDREN) should -# always be disabled with mod_fcgid, which will only route one -# request at a time to application processes it has spawned; -# thus, any child processes created by PHP will not be used -# effectively. (Additionally, the PHP child processes may not -# be terminated properly.) By default, and with the environment -# variable setting PHP_FCGI_CHILDREN=0, PHP child process +# PHP child process management (PHP_FCGI_CHILDREN) should +# always be disabled with mod_fcgid, which will only route one +# request at a time to application processes it has spawned; +# thus, any child processes created by PHP will not be used +# effectively. (Additionally, the PHP child processes may not +# be terminated properly.) By default, and with the environment +# variable setting PHP_FCGI_CHILDREN=0, PHP child process # management is disabled. PHP_FCGI_CHILDREN=0 export PHP_FCGI_CHILDREN @@ -1697,17 +1697,17 @@ EOF # - X-Frame-Options # - - # - The X-Frame-Options header (RFC), or XFO header, protects your visitors - # - against clickjacking attacks. An attacker can load up an iframe on their - # - site and set your site as the source, it's quite easy: + # - The X-Frame-Options header (RFC), or XFO header, protects your visitors + # - against clickjacking attacks. An attacker can load up an iframe on their + # - site and set your site as the source, it's quite easy: # - # - # - - # - Using some crafty CSS they can hide your site in the background and create some - # - genuine looking overlays. When your visitors click on what they think is a harmless - # - link, they're actually clicking on links on your website in the background. That - # - might not seem so bad until we realise that the browser will execute those requests - # - in the context of the user, which could include them being logged in and authenticated + # - Using some crafty CSS they can hide your site in the background and create some + # - genuine looking overlays. When your visitors click on what they think is a harmless + # - link, they're actually clicking on links on your website in the background. That + # - might not seem so bad until we realise that the browser will execute those requests + # - in the context of the user, which could include them being logged in and authenticated # - to your site! # - # - Troy Hunt has a great blog on 'Clickjack attack – the hidden threat right in front : @@ -1715,49 +1715,49 @@ EOF # - # - http://www.troyhunt.com/2013/05/clickjack-attack-hidden-threat-right-in.html # - - # - Valid values include DENY meaning your site can't be framed, SAMEORIGIN which allows - # - you to frame your own site or ALLOW-FROM https://example.com/ which lets you specify + # - Valid values include DENY meaning your site can't be framed, SAMEORIGIN which allows + # - you to frame your own site or ALLOW-FROM https://example.com/ which lets you specify # -sites that are permitted to frame your own site. # - Header always set X-Frame-Options "SAMEORIGIN" # - X-Xss-Protection # - - # - This header is used to configure the built in reflective XSS protection found - # - in Internet Explorer, Chrome and Safari (Webkit). Valid settings for the header - # - are 0, which disables the protection, 1 which enables the protection - # - and 1; mode=block which tells the browser to block the response if it + # - This header is used to configure the built in reflective XSS protection found + # - in Internet Explorer, Chrome and Safari (Webkit). Valid settings for the header + # - are 0, which disables the protection, 1 which enables the protection + # - and 1; mode=block which tells the browser to block the response if it # - detects an attack rather than sanitising the script. # - Header always set X-Xss-Protection "1; mode=block" # - X-Content-Type-Options # - - # - Nice and easy to configure, this header only has one valid value, nosniff. - # - It prevents Google Chrome and Internet Explorer from trying to mime-sniff - # - the content-type of a response away from the one being declared by the server. - # - It reduces exposure to drive-by downloads and the risks of user uploaded content - # - that, with clever naming, could be treated as a different content-type, like + # - Nice and easy to configure, this header only has one valid value, nosniff. + # - It prevents Google Chrome and Internet Explorer from trying to mime-sniff + # - the content-type of a response away from the one being declared by the server. + # - It reduces exposure to drive-by downloads and the risks of user uploaded content + # - that, with clever naming, could be treated as a different content-type, like # - an executable. # - Header always set X-Content-Type-Options "nosniff" # - Content Security Policy # - - # - The CSP header allows you to define a whitelist of approved sources of content - # - for your site. By restricting the assets that a browser can load for your site, - # - like js and css, CSP can act as an effective countermeasure to XSS attacks. I - # - have covered CSP in a lot more detail in my blog Content Security Policy - An - # - Introduction (https://scotthelme.co.uk/content-security-policy-an-introduction/). + # - The CSP header allows you to define a whitelist of approved sources of content + # - for your site. By restricting the assets that a browser can load for your site, + # - like js and css, CSP can act as an effective countermeasure to XSS attacks. I + # - have covered CSP in a lot more detail in my blog Content Security Policy - An + # - Introduction (https://scotthelme.co.uk/content-security-policy-an-introduction/). # - - # - Here is a basic policy to enforce TLS on all assets and prevent + # - Here is a basic policy to enforce TLS on all assets and prevent # - mixed content warnings. # - # - Allow Google Analytics, Google AJAX CDN and Same Origin # - script-src 'self' www.google-analytics.com ajax.googleapis.com; # - # - Emmbedding Google Fonts - # - style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; + # - style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; # - # - Allow YouTube Videos (iframe embedded) # - frame-src 'self' https://www.youtube.com @@ -1767,9 +1767,9 @@ EOF # - Referrer-Policy # - - # - The HTTP referer (originally a misspelling of referrer[1]) is an HTTP header - # - field that identifies the address of the webpage (i.e. the URI or IRI) that - # - linked to the resource being requested. By checking the referrer, the new + # - The HTTP referer (originally a misspelling of referrer[1]) is an HTTP header + # - field that identifies the address of the webpage (i.e. the URI or IRI) that + # - linked to the resource being requested. By checking the referrer, the new # - webpage can see where the request originated. # - Header set Referrer-Policy "strict-origin-when-cross-origin" @@ -1889,7 +1889,7 @@ fi echononl "\tCreate system user '$VACATION_USER'" if ! grep -q "$VACATION_USER" /etc/passwd > /dev/null 2>&1 ; then adduser --system --home /var/spool/vacation --no-create-home --uid 65501 --gid 65501 --shell /usr/sbin/nologin $VACATION_USER > "$log_file" 2>&1 - + if [[ $? -ne 0 ]]; then echo_failed error "$(cat $log_file)" @@ -1960,7 +1960,7 @@ fi # - #echononl "\tWorkaround, because encoding does not work as exspected." ## - Vacation script changed. Since Version 3.2 we need another perl regexp. -## - The old one was: +## - The old one was: ## - perl -i -n -p -e "s/(\s*\'ctype\'\s* =>\s*)\'text\/plain.*$/\1\'text\/plain; charset=iso-8859-1\',/" \ ## - ##perl -i -n -p -e "s/(\s*\'Content-Type\'\s* =>\s*)\"text\/plain.*$/\1\"text\/plain; charset=iso-8859-1\",/" \ @@ -1995,7 +1995,7 @@ fi # - /etc/mail/postfixadmin/vacation.conf # - /etc/postfixadmin/vacation.conf # - -# - Instead of changing this script, we put the needed entries +# - Instead of changing this script, we put the needed entries # - to file /etc/postfixadmin/vacation.conf: # - echononl "\tCreate directory '/etc/postfixadmin' " @@ -2101,15 +2101,15 @@ fi # - Create an entry in /etc/hosts for the (non-existant domain) -# - $AUTOREPLY_HOSTNAME -# - +# - $AUTOREPLY_HOSTNAME +# - # - add: # - # - 127.0.0.1 $AUTOREPLY_HOSTNAME # - echononl "\tCreate entry in /etc/hosts for '$AUTOREPLY_HOSTNAME'" if ! grep -q "$AUTOREPLY_HOSTNAME" /etc/hosts > $log_file 2>&1 ; then - perl -i -n -p -e"s#(^\s*127.0.0.1\s+localhost.*)#\1\n\n127.0.0.1 ${AUTOREPLY_HOSTNAME}#" /etc/hosts > $log_file 2>&1 + perl -i -n -p -e"s#(^\s*127.0.0.1\s+localhost.*)#\1\n\n127.0.0.1 ${AUTOREPLY_HOSTNAME}#" /etc/hosts > $log_file 2>&1 if [[ $? -eq 0 ]] ; then echo_ok else @@ -2120,7 +2120,7 @@ else echo_skipped fi -# - Define the transport type in the Postfix master file +# - Define the transport type in the Postfix master file # - /etc/postfix/master.cf # - # - vacation unix - n n - - pipe @@ -2219,8 +2219,7 @@ else pfa_conf_file="${WEBSITE_BASEDIR}/postfixadmin-${PF_ADMIN_VERSION}/config.inc.php" cp -a "$pfa_conf_file" "${pfa_conf_file}.ORIG" fi - - + # - Use 'Re: $SUBJECT' as the default subject template for vacation # - in postfixadmin @@ -2281,26 +2280,26 @@ else fi > $log_file perl -i -n -p -e "s#^(\s*\\\$CONF\['default_language'\]\s*=.*)#//!\1\n\\\$CONF['default_language'] = 'de';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['database_type'\]\s*=.*)#//!\1\n\\\$CONF['database_type'] = '$_database_type';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['database_host'\]\s*=.*)#//!\1\n\\\$CONF['database_host'] = 'localhost';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['database_user'\]\s*=.*)#//!\1\n\\\$CONF['database_user'] = '$POSTFIX_DB_USER';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['database_password'\]\s*=.*)#//!\1\n\\\$CONF['database_password'] = '$POSTFIX_DB_PASS';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['database_name'\]\s*=.*)#//!\1\n\\\$CONF['database_name'] = '$POSTFIX_DB_NAME';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['database_prefix'\]\s*=.*)#//!\1\n\\\$CONF['database_prefix'] = '';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['admin_email'\]\s*=.*)#//!\1\n\\\$CONF['admin_email'] = '$WEBMASTER_EMAIL';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['encrypt'\]\s*=.*)#//!\1\n\\\$CONF['encrypt'] = '$ENCRYPTION_METHOD';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true if grep -q -E "^\\\$CONF\['dovecotpw'\]\s*=.*" "$pfa_conf_file" 2> /dev/null ; then perl -i -n -p -e "s#^(\\\$CONF\['dovecotpw'\]\s*=.*)#//!\1\n\\\$CONF['dovecotpw'] = '$DOVEADM_PW';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true else cat <> $pfa_conf_file @@ -2339,7 +2338,7 @@ echononl "\tAdjust Postfix Admin's Configuration - Part 2" _failed=false > $log_file perl -i -n -p -e "s#^(\s*\\\$CONF\['default_aliases'\]\s*=.*)#//\n//! 'default_aliases' will be overridden - see end of configfile\n//\n\1#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true cat <> $pfa_conf_file 2> $log_file @@ -2359,10 +2358,10 @@ EOF perl -i -n -p -e "s#^(\s*\\\$CONF\['language_hook'\]\s*=.*)#//\n//! 'language_hook' will be overridden - see end of configfile\n//\n\1#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['password_validation'\]\s*=.*)#//\n//! 'password_validation' will be overridden - see end of configfile\n//\n\1#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true cat <> $pfa_conf_file 2> $log_file // Password validation @@ -2388,19 +2387,19 @@ cat <> $pfa_conf_file 2> $log_file ); /* - language_hook example function - + language_hook example function + Called if \$CONF['language_hook'] == '' Allows to add or override \$PALANG interface texts. - If you add new texts, please always prefix them with 'x_' (for example + If you add new texts, please always prefix them with 'x_' (for example \$PALANG['x_mytext'] = 'foo') to avoid they clash with texts that might be added to languages/*.lang in future versions of PostfixAdmin. Please also make sure that all your added texts are included in all sections - that includes all 'case "XY":' sections and the 'default:' section (for users that don't have any of the languages specified - in the 'case "XY":' section). + in the 'case "XY":' section). Usually the 'default:' section should contain english text. If you modify an existing text/translation, please consider to report it @@ -2446,23 +2445,23 @@ EOF perl -i -n -p -e "s#^(\s*\\\$CONF\['domain_path'\]\s*=.*)#//!\1\n\\\$CONF['domain_path'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['domain_in_mailbox'\]\s*=.*)#//!\1\n\\\$CONF['domain_in_mailbox'] = 'NO';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['aliases'\]\s*=.*)#//!\1\n\\\$CONF['aliases'] = '100';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['mailboxes'\]\s*=.*)#//!\1\n\\\$CONF['mailboxes'] = '100';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['maxquota'\]\s*=.*)#//!\1\n\\\$CONF['maxquota'] = '0';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['domain_quota_default'\]\s*=.*)#//!\1\n\\\$CONF['domain_quota_default'] = '0';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['quota'\]\s*=.*)#//!\1\n\\\$CONF['quota'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['domain_quota'\]\s*=.*)#//!\1\n\\\$CONF['domain_quota'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['quota_multiplier'\]\s*=.*)#//!\1\n\\\$CONF['quota_multiplier'] = '1048576';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true if $_failed ; then echo_failed error "$(cat $log_file)" @@ -2540,8 +2539,8 @@ cat <> $pfa_conf_file 2> $log_file // ReplyType options // If you want to define additional reply options put them in array below. // The array has the format seconds between replies => $PALANG text -// Special values for seconds are: -// 0 => only reply to the first mail while on vacation +// Special values for seconds are: +// 0 => only reply to the first mail while on vacation // 1 => reply on every mail // 60*60*24*7 => Reply if last autoreply was at least a week ago // @@ -2574,8 +2573,8 @@ fi ## - EOM; ## - echononl "\tCreate welcome message.." -if [[ -n "$WELCOME_MESSAGE" ]] ; then - cat <> $pfa_conf_file 2> $log_file +if [[ -n "$WELCOME_MESSAGE" ]] ; then + cat <> $pfa_conf_file 2> $log_file // Welcome Message // This message is send to every newly created mailbox. @@ -2618,35 +2617,35 @@ echononl "\tAdjust Postfix Admin's Configuration - Part 5" _failed=false > $log_file perl -i -n -p -e "s#^(\s*\\\$CONF\['alias_control_admin'\]\s+=.*)#//!\1\n\\\$CONF['alias_control_admin'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['alias_control'\]\s*=.*)#//!\1\n\\\$CONF['alias_control'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['special_alias_control'\]\s*=.*)#//!\1\n\\\$CONF['special_alias_control'] = 'NO';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['backup'\]\s*=.*)#//!\1\n\\\$CONF['backup'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['fetchmail'\]\s*=.*)#//!\1\n\\\$CONF['fetchmail'] = 'NO';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['user_footer_link'\]\s+=.*)#//!\1\n\\\$CONF['user_footer_link'] = 'https://${WEBSITE_NAME}/main.php';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['footer_text'\]\s+=.*)#//!\1\n\\\$CONF['footer_text'] = 'Main Menu';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['footer_link'\]\s+=.*)#//!\1\n\\\$CONF['footer_link'] = 'http://${WEBSITE_NAME}/main.php';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['emailcheck_resolve_domain'\]\s*=.*)#//!\1\n\\\$CONF['emailcheck_resolve_domain'] = 'NO';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['show_status'\]\s*=.*)#//!\1\n\\\$CONF['show_status'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['show_status_key'\]\s*=.*)#//!\1\n\\\$CONF['show_status_key'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['show_undeliverable'\]\s*=.*)#//!\1\n\\\$CONF['show_undeliverable'] = 'NO';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['show_popimap'\]\s*=.*)#//!\1\n\\\$CONF['show_popimap'] = 'NO';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['used_quotas'\]\s*=.*)#//!\1\n\\\$CONF['used_quotas'] = 'NO';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true perl -i -n -p -e "s#^(\s*\\\$CONF\['new_quota_table'\]\s*=.*)#//!\1\n\\\$CONF['new_quota_table'] = 'YES';#" \ - $pfa_conf_file >> $log_file 2>&1 || _failed=true + $pfa_conf_file >> $log_file 2>&1 || _failed=true if $_failed ; then echo_failed error "$(cat $log_file)" @@ -2679,7 +2678,7 @@ fi # - $CONF['configured'] = true; echononl "\tSet '\$CONF['configured'] = true'" perl -i -n -p -e "s#^(\s*\\\$CONF\['configured'\]\s*=.*)#//!\1\n\\\$CONF['configured'] = true;#" \ - $pfa_conf_file > $log_file 2>&1 + $pfa_conf_file > $log_file 2>&1 if [[ $? -eq 0 ]] ; then echo_ok else @@ -2740,7 +2739,7 @@ echo "" # - AFTER DELETION MAILBOX -# - +# - # - activate script for moving a mailbox from the mailboxdirectory # - and save it to the backupb directory /var/deleted-maildirs # - @@ -2749,7 +2748,7 @@ echononl "\tCreate folder '${DELETED_MAILBOX_DIR}" if [[ ! -d "${DELETED_MAILBOX_DIR}" ]] ; then mkdir $DELETED_MAILBOX_DIR > $log_file 2>&1 if [[ $? -eq 0 ]] ; then - echo_ok + echo_ok else echo_failed error "$(cat $log_file)" @@ -2803,11 +2802,11 @@ else fi # - Change the posdeletion scripts to your needs: -# - +# - # - set: # - basedir=/var/vmail # - trashbase=$DELETED_MAILBOX_DIR -# - +# - # - trashdir="${trashbase}/$2/`date +%F_$H-%M`_${subdir}" # - echononl "\tAdjust 'postfixadmin-mailbox-postdeletion.sh'" @@ -2829,9 +2828,9 @@ fi # - Edit ${WEBSITE_BASEDIR}/htdocs/config.inc.php # - -# - in section add line +# - in section add line # - $CONF['mailbox_postdeletion_script']='sudo -u vmail /usr/local/bin/postfixadmin-mailbox-postdeletion.sh'; -# - +# - echononl "\tAdjust 'config.inc.php' to make script available" perl -i -n -p -e "s#^(\s*[/*]?\s*\\\$CONF\['mailbox_postdeletion_script'\]\s*=.*)#//!\1\n\\\$CONF['mailbox_postdeletion_script'] = 'sudo -u vmail /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';#" \ $pfa_conf_file > $log_file 2>&1 @@ -2894,7 +2893,7 @@ fi # - AFTER DELETION MAILDOMIAN -# - +# - # - activate script for moving a mailbox from the mailboxdirectory # - and save it to the backupb directory $DELETED_DOMAINS_DIR # - @@ -2903,7 +2902,7 @@ echononl "\tCreate folder '${DELETED_DOMAINS_DIR}" if [[ ! -d "${DELETED_DOMAINS_DIR}" ]] ; then mkdir $DELETED_DOMAINS_DIR > $log_file 2>&1 if [[ $? -eq 0 ]] ; then - echo_ok + echo_ok else echo_failed error "$(cat $log_file)" @@ -2960,11 +2959,11 @@ fi # - Change the posdeletion scripts to your needs: -# - +# - # - set: # - basedir=/var/vmail # - trashbase=$DELETED_DOMAINS_DIR -# - +# - # - trashdir="${trashbase}/`date +%F_%H-%M`_$1" # - echononl "\tAdjust 'postfixadmin-domain-postdeletion.sh'" @@ -2985,9 +2984,9 @@ fi # - edit ${WEBSITE_BASEDIR}/htdocs/config.inc.php # - -# - in section add line +# - in section add line # - $CONF['domain_postdeletion_script']='sudo -u vmail /usr/local/bin/postfixadmin-domain-postdeletion.sh'; -# - +# - echononl "\tAdjust 'config.inc.php' to make script available" perl -i -n -p -e "s#^(\s*[/*]?\s*\\\$CONF\['domain_postdeletion_script'\]\s*=.*)#//!\1\n\\\$CONF['domain_postdeletion_script'] = 'sudo -u vmail /usr/local/bin/postfixadmin-domain-postdeletion.sh';#" \ $pfa_conf_file >> $log_file 2>&1 @@ -3054,9 +3053,9 @@ fi ## - specified database. ## - ## - Now you have to setup Postfix to recognize all these entries. To do so, -## - you must specify database requests (in different files) and load them +## - you must specify database requests (in different files) and load them ## - into Postfix configuration. In particular that are the following files: -## - +## - ## - pgsql_relay-domain-maps.cf ## - pgsql_sender_login_maps.cf ## - pgsql_transport_maps.cf @@ -3498,7 +3497,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_address_r if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then cat < /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_address_rewriting.cf -## - this address rewriting acts as address extension +## - this address rewriting acts as address extension ## - with delimeter "-" ## - hosts = $POSTFIX_DB_HOST_PGSQL @@ -3690,14 +3689,14 @@ info "Browse to \033[1mhttps://${WEBSITE_NAME}/setup.php\033[m to create a 'setu \t Instructions on how to do this are pointed out at the setup site, maybe like this: -\t - Generate setup_password hash and set \033[1m$CONF['setup_password']\033[m +\t - Generate setup_password hash and set \033[1m$CONF['setup_password']\033[m \t in file \033[1mconfig.local.php\033[m as printed out. \t - Browse to \033[1mhttp://${WEBSITE_NAME}/setup.php\033[m once again to update \t the database -\t Browse to \033[1mhttp://${WEBSITE_NAME}\033[m and login using an existent admin account +\t Browse to \033[1mhttp://${WEBSITE_NAME}\033[m and login using an existent admin account \t[ \033[33m\033[1mNotice\033[m ]: \033[1mScroll back to see if all seems to be fine!\033[m @@ -3751,7 +3750,7 @@ dbname = postfix query = SELECT quota FROM mailbox WHERE username='%s' AND active = true EOF -## - add configuration parameter virtual_mailbox_limit_maps +## - add configuration parameter virtual_mailbox_limit_maps ## - in Postfix /etc/postfix/main.cf ## - ## - add: