Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120824731
kolab-mta.postinst
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
5 KB
Referenced Files
None
Subscribers
None
kolab-mta.postinst
View Options
#!/bin/sh
#
# Univention mail Postfix
#
# Copyright 2005-2011 Univention GmbH
#
# http://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions of this program provided by Univention to you as
# well as other copyrighted, protected or trademarked materials like
# Logos, graphics, fonts, specific documentations and configurations,
# cryptographic keys etc. are subject to a license agreement between
# you and Univention and not subject to the GNU AGPL V3.
#
# In the case you use this program under the terms of the GNU AGPL V3,
# the program is provided in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License with the Debian GNU/Linux or Univention distribution in file
# /usr/share/common-licenses/AGPL-3; if not, see
# <http://www.gnu.org/licenses/>.
. /usr/share/univention-lib/all.sh
# Bug 22369: remove all UCR remains from univention-mail-postfix-forward and univention-mail-postfix-kolab2
# Required during update step to UCS 3.0-0.
# Note: empty $2 (on initial install) is also less-than, because lt "[treats] an empty version as earlier than any version"
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt 3.0.7 && [ ! -z "$2" ] ; then
remove_ucr_template /etc/postfix/main.cf
remove_ucr_template /etc/postfix/master.cf
remove_ucr_info_file univention-mail-postfix-forward.info
remove_ucr_info_file univention-mail-postfix-kolab2.info
fi
#DEBHELPER#
eval "$(univention-config-registry shell)"
# migration from old variables while updating to UCS 3.0 (Bug #22369)
if [ "$1" = "configure" -a -n "$2" ] && dpkg --compare-versions "$2" lt 6.0.15; then
if [ -n "$postfix_masquerade_domains" -a -z "$mail_postfix_masquerade_domains" ] ; then
univention-config-registry set "mail/postfix/masquerade/domains=$postfix_masquerade_domains"
fi
if [ -n "$postfix_masquerade_exceptions" -a -z "$mail_postfix_masquerade_exceptions" ] ; then
univention-config-registry set "mail/postfix/masquerade/exceptions=$postfix_masquerade_exceptions"
fi
if [ -n "$mail_relay" -a -z "$mail_relayhost" ] ; then
univention-config-registry set "mail/relayhost=$mail_relay"
fi
fi
# from univention-mail-postfix
univention-config-registry set \
postfix/autostart?yes \
mail/postfix/virtual/enabled=no \
mail/postfix/transport/ldap/enabled=no \
mail/postfix/inet/interfaces?127.0.0.1 \
mail/postfix/ldap/timeout?15 \
mail/postfix/policy/listfilter?no \
'mail/postfix/masquerade/domains?$mydomain' \
mail/postfix/masquerade/exceptions?root \
mail/alias/root?systemmail@$hostname.$domainname \
mail/alias/postmaster?root \
mail/messagesizelimit?10240000 \
mail/postfix/tls/client/level?may
# from univention-mail-server
univention-config-registry set \
mail/postfix/virtual/enabled=yes \
mail/postfix/transport/ldap/enabled=yes \
mail/postfix/inet/interfaces=all
eval "$(univention-config-registry shell)"
# set UCR variables only on fresh installations
if [ "$1" = "configure" -a -z "$2" ] ; then
# Reservce 70 for the disfunctional line below
# mail/postfix/smtpd/restrictions/recipient/70="check_policy_service unix:private/recipient_policy_incoming" \
univention-config-registry set \
mail/postfix/smtpd/restrictions/recipient/10="permit_mynetworks" \
mail/postfix/smtpd/restrictions/recipient/20="reject_unauth_pipelining" \
mail/postfix/smtpd/restrictions/recipient/30="reject_rbl_client zen.spamhaus.org" \
mail/postfix/smtpd/restrictions/recipient/40="reject_non_fqdn_recipient" \
mail/postfix/smtpd/restrictions/recipient/50="reject_invalid_helo_hostname" \
mail/postfix/smtpd/restrictions/recipient/30="reject_unknown_recipient_domain" \
mail/postfix/smtpd/restrictions/recipient/60="reject_unauth_destination" \
mail/postfix/smtpd/restrictions/recipient/80="permit"
fi
for file in transport virtual canonical access relocated; do
if [ ! -e /etc/postfix/$file ]; then
touch /etc/postfix/$file
fi
postmap /etc/postfix/$file
done
adduser --quiet --system --home /var/lib/systemmail --shell /bin/bash systemmail
newaliases
adduser postfix sasl
univention-config-registry commit /etc/mailname
# restart to activate new listener module
/etc/init.d/univention-directory-listener crestart
# stop saslauthd
if [ -x /etc/init.d/saslauthd ]; then
/etc/init.d/saslauthd stop || true
fi
# Run join script
call_joinscript 67kolab-mta.inst
# start kolab-saslauthd
ucr commit /etc/default/kolab-saslauthd
invoke-rc.d kolab-saslauthd start
if [ -z "$postfix_autostart" ] || [ "$postfix_autostart" = "yes" ]; then
invoke-rc.d postfix restart
fi
# configure firewall
ucr set security/packetfilter/package/kolab-mta/tcp/25/all="ACCEPT" \
security/packetfilter/package/kolab-mta/tcp/25/all/en="SMTP" \
security/packetfilter/package/kolab-mta/tcp/465/all="ACCEPT" \
security/packetfilter/package/kolab-mta/tcp/465/all/en="SMTPS" \
security/packetfilter/package/kolab-mta/tcp/587/all="ACCEPT" \
security/packetfilter/package/kolab-mta/tcp/587/all/en="Submission"
[ -x "/etc/init.d/univention-firewall" ] && invoke-rc.d univention-firewall restart
exit 0
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Fri, Apr 24, 10:26 AM (4 h, 56 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18877772
Default Alt Text
kolab-mta.postinst (5 KB)
Attached To
Mode
rKMETA kolab
Attached
Detach File
Event Timeline