Some minor issues fixed.
SMTPUTF8 support option added (by Val Kulkov). Disabled by default because of icu library size.
include $(TOPDIR)/rules.mk
PKG_NAME:=postfix
-PKG_RELEASE:=2
+PKG_RELEASE:=1
PKG_SOURCE_URL:=ftp://ftp.porcupine.org/mirrors/postfix-release/official/
-PKG_VERSION:=3.0.1
-PKG_MD5SUM:=3ec1416e7d4fba9566297c8fcf7a348c
+PKG_VERSION:=3.0.3
+PKG_MD5SUM:=61caffae689c11d09b4c972a394ae3b1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
PKG_LICENSE:=IPL-1.0
CATEGORY:=Mail
TITLE:=Postfix Mail Transmit Agent
URL:=http://www.postfix.org/
- DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +libpcre
+ DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +POSTFIX_EAI:icu +libpcre
endef
define Package/postfix/description
default y
help
Implements support for cdb files using tinycdb
+ config POSTFIX_EAI
+ bool "SMTPUTF8 support"
+ default n
+ help
+ Enable Postfix support for Email Address Internationalization
+ (EAI) as defined in RFC 6531 (SMTPUTF8 extension), RFC 6532
+ (Internationalized email headers) and RFC 6533
+ (Internationalized delivery status notifications).
+ Since version 3.0, Postfix fully supports UTF-8 email
+ addresses and UTF-8 message header values.
endmenu
endef
-CCARGS=-DNO_EPOLL -DNO_SIGSETJMP -DNO_NIS -DNO_EAI
+CCARGS=-DNO_NIS
AUXLIBS=-L$(STAGING_DIR)/usr/lib
default_database_type=cdb
CCARGS+=-DNO_DB
endif
+ifdef CONFIG_POSTFIX_EAI
+ AUXLIBS+=-licuuc
+ CCARGS+=-DHAS_EAI
+ smtputf8_conf = yes
+else
+ CCARGS+=-DNO_EAI
+ smtputf8_conf = no
+endif
+
CCARGS+=-DDEF_DB_TYPE=\"$(default_database_type)\"
config_directory=/etc/postfix# also add this to postfix init file
$(config_directory)/main.cf
$(config_directory)/master.cf
$(config_directory)/aliases
+$(config_directory)/virtual
endef
define Build/Configure
# postconf -d > /tmp/main.cf.new
# 3. Transfer /tmp/main.cf.new file to the build system
# 4. Execute the following command:
-# cat /tmp/main.cf.new | ( echo '# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE'; echo '# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX.'; echo '#'; grep -v ^alias_maps\ = |grep -v ^alias_database\ = |grep -v ^command_directory\ = |grep -v ^config_directory\ = |grep -v ^daemon_directory\ = |grep -v ^data_directory\ = |grep -v ^default_database_type\ = |grep -v ^html_directory\ = |grep -v ^mail_spool_directory\ = |grep -v ^mailq_path\ = |grep -v ^manpage_directory\ = |grep -v ^meta_directory\ = |grep -v ^mydomain\ = |grep -v ^myhostname\ = |grep -v ^mynetworks\ = |grep -v ^mynetworks_style\ = |grep -v ^newaliases_path\ = |grep -v ^queue_directory\ = |grep -v ^readme_directory\ = |grep -v ^sample_directory\ = |grep -v ^sendmail_path\ = |grep -v ^shlib_directory\ = |grep -v ^smtputf8_enable\ = ) > files/main.cf.default
+# cat /tmp/main.cf.new | ( echo '# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE'; echo '# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX.'; echo '#'; grep -v ^alias_maps\ = |grep -v ^alias_database\ = |grep -v ^command_directory\ = |grep -v ^config_directory\ = |grep -v ^daemon_directory\ = |grep -v ^data_directory\ = |grep -v ^default_database_type\ = |grep -v ^html_directory\ = |grep -v ^mail_spool_directory\ = |grep -v ^mailq_path\ = |grep -v ^manpage_directory\ = |grep -v ^meta_directory\ = |grep -v ^mydomain\ = |grep -v ^myhostname\ = |grep -v ^mynetworks\ = |grep -v ^mynetworks_style\ = |grep -v ^newaliases_path\ = |grep -v ^queue_directory\ = |grep -v ^readme_directory\ = |grep -v ^sample_directory\ = |grep -v ^sendmail_path\ = |grep -v ^shlib_directory\ = |grep -v ^smtputf8_enable\ = |grep -v ^virtual_maps\ = ) > files/main.cf.default
# 5. Done. Now you can rebuild the package with new main.cf.default.
#
define Build/Compile
- # Currently postfix has a bug with Makefiles that CCARGS are not passed to the compiler, so we are copying them to CC
+ # Currently postfix has a bug with Makefiles that CCARGS are not passed to the compiler, so we are copying them to CC as a workaround
cd $(PKG_BUILD_DIR); $(MAKE) $(TARGET_CONFIGURE_OPTS) CC='$(TARGET_CC) $(CCARGS)'
cp ./files/main.cf.default $(PKG_BUILD_DIR)/conf/main.cf.default
echo "default_database_type = $(default_database_type)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
echo "alias_database = $(default_database_type):$(config_directory)/aliases" >> $(PKG_BUILD_DIR)/conf/main.cf.default
echo "alias_maps = $(default_database_type):$(config_directory)/aliases" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+ echo "virtual_maps = $(default_database_type):$(config_directory)/virtual" >> $(PKG_BUILD_DIR)/conf/main.cf.default
echo "sendmail_path = $(sendmail_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
echo "newaliases_path = $(newaliases_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
echo "mailq_path = $(mailq_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
echo "mail_spool_directory = $(mail_spool_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
echo "shlib_directory = $(shlib_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
echo "meta_directory = $(meta_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
- echo "smtputf8_enable = no" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+ echo "smtputf8_enable = $(smtputf8_conf)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
endef
define Package/postfix/install
grep -qc main\.cf "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/main.cf" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
grep -qc master\.cf "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/master.cf" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
grep -qc aliases "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/aliases" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
+ grep -qc virtual "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/virtual" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
touch "$${IPKG_INSTROOT}$(config_directory)"/opkg_postinst
if [ -z "$${IPKG_INSTROOT}" ]; then
- ps | grep "postfix/master" | grep -cvq grep >/dev/null && /etc/init.d/postfix reload
+ ps | grep "postfix/master" | grep -cvq grep >/dev/null && /etc/init.d/postfix restart
fi
endef
#!/bin/sh
rm -f $${IPKG_INSTROOT}$(config_directory)/aliases.cdb $${IPKG_INSTROOT}$(config_directory)/aliases.db $${IPKG_INSTROOT}$(data_directory)/master.lock
+ rm -f $${IPKG_INSTROOT}$(config_directory)/virtual.cdb $${IPKG_INSTROOT}$(config_directory)/virtual.db
+
rm -f "$${IPKG_INSTROOT}$(sendmail_path)" "$${IPKG_INSTROOT}$(newaliases_path)" "$${IPKG_INSTROOT}$(mailq_path)"
if [ -f "$${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)" ]; then
lmtp_tls_CApath =
lmtp_tls_block_early_mail_reply = no
lmtp_tls_cert_file =
-lmtp_tls_ciphers = export
+lmtp_tls_ciphers = medium
lmtp_tls_dcert_file =
lmtp_tls_dkey_file = $lmtp_tls_dcert_file
lmtp_tls_eccert_file =
lmtp_tls_loglevel = 0
lmtp_tls_mandatory_ciphers = medium
lmtp_tls_mandatory_exclude_ciphers =
-lmtp_tls_mandatory_protocols = !SSLv2
+lmtp_tls_mandatory_protocols = !SSLv2, !SSLv3
lmtp_tls_note_starttls_offer = no
lmtp_tls_per_site =
lmtp_tls_policy_maps =
-lmtp_tls_protocols = !SSLv2
+lmtp_tls_protocols = !SSLv2, !SSLv3
lmtp_tls_scert_verifydepth = 9
lmtp_tls_secure_cert_match = nexthop
lmtp_tls_security_level =
luser_relay =
mail_name = Postfix
mail_owner = postfix
-mail_release_date = 20150208
-mail_version = 3.0.0
+mail_release_date = 20151010
+mail_version = 3.0.3
mailbox_command =
mailbox_command_maps =
mailbox_delivery_lock = fcntl, dotlock
postscreen_watchdog_timeout = 10s
postscreen_whitelist_interfaces = static:all
prepend_delivered_header = command, file, forward
-process_id = 25939
+process_id = 13574
process_id_directory = pid
process_name = postconf
propagate_unmatched_extensions = canonical, virtual
smtp_cname_overrides_servername = no
smtp_connect_timeout = 30s
smtp_connection_cache_destinations =
-smtp_connection_cache_on_demand = yes
+smtp_connection_cache_on_demand = no
smtp_connection_cache_time_limit = 2s
smtp_connection_reuse_count_limit = 0
smtp_connection_reuse_time_limit = 300s
smtp_tls_CApath =
smtp_tls_block_early_mail_reply = no
smtp_tls_cert_file =
-smtp_tls_ciphers = export
+smtp_tls_ciphers = medium
smtp_tls_dcert_file =
smtp_tls_dkey_file = $smtp_tls_dcert_file
smtp_tls_eccert_file =
smtp_tls_loglevel = 0
smtp_tls_mandatory_ciphers = medium
smtp_tls_mandatory_exclude_ciphers =
-smtp_tls_mandatory_protocols = !SSLv2
+smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_note_starttls_offer = no
smtp_tls_per_site =
smtp_tls_policy_maps =
-smtp_tls_protocols = !SSLv2
+smtp_tls_protocols = !SSLv2, !SSLv3
smtp_tls_scert_verifydepth = 9
smtp_tls_secure_cert_match = nexthop, dot-nexthop
smtp_tls_security_level =
smtpd_tls_auth_only = no
smtpd_tls_ccert_verifydepth = 9
smtpd_tls_cert_file =
-smtpd_tls_ciphers = export
+smtpd_tls_ciphers = medium
smtpd_tls_dcert_file =
smtpd_tls_dh1024_param_file =
smtpd_tls_dh512_param_file =
smtpd_tls_loglevel = 0
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_exclude_ciphers =
-smtpd_tls_mandatory_protocols = !SSLv2
-smtpd_tls_protocols =
+smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
+smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_received_header = no
smtpd_tls_req_ccert = no
smtpd_tls_security_level =
START=50
STOP=50
+EXTRA_COMMANDS="status abort flush"
+EXTRA_HELP=" status Display the service status
+ abort Stop the service abruptly. Running processes are signaled to stop immediately
+ flush Force delivery: attempt to deliver every message in the deferred mail queue"
upgrade() {
config_directory="$IPKG_INSTROOT"/etc/postfix
echo "myhostname = $(uci get system.@system[0].hostname)" >> "$config_directory"/main.cf.default
echo "mydomain = $(uci get system.@system[0].hostname|sed -e "s/[^\.]*\.\(.*\)/\1/")" >> "$config_directory"/main.cf.default
- ifconfig | grep "inet addr" | sed -e "s/.*inet addr:\([0-9.]*\).*Mask:/\1 /" | while read IP NETMASK; do eval "$(ipcalc.sh $IP $NETMASK)"; echo "$NETWORK/$PREFIX"; done | xargs echo "mynetworks =" >> "$config_directory"/main.cf.default
+ (eval $(ipcalc.sh $(uci get network.lan.ipaddr) $(uci get network.lan.netmask)); echo mynetworks = 127.0.0.0/8 $NETWORK/$PREFIX) >> "$config_directory"/main.cf.default
echo "mynetworks_style = subnet" >> "$config_directory"/main.cf.default
grep -qc "^sendmail_path[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^sendmail_path =" "$config_directory"/main.cf.default)"
grep -qc "^setgid_group[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^setgid_group =" "$config_directory"/main.cf.default)"
grep -qc "^myhostname[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^myhostname =" "$config_directory"/main.cf.default)"
grep -qc "^mydomain[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mydomain =" "$config_directory"/main.cf.default)"
- grep -qc "^mynetworks[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mynetworks =" "$config_directory"/main.cf.default)"
+ #grep -qc "^mynetworks[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mynetworks =" "$config_directory"/main.cf.default)" #Setting mynetworks_style is enough
grep -qc "^mynetworks_style[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mynetworks_style =" "$config_directory"/main.cf.default)"
grep -qc "^shlib_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^shlib_directory =" "$config_directory"/main.cf.default)"
grep -qc "^meta_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^meta_directory =" "$config_directory"/main.cf.default)"
postfix post-install upgrade-source
postfix upgrade-configuration
newaliases
+ postmap "$config_directory"/virtual
+ postfix check
fi
}
upgrade
postfix reload
}
+
+status() {
+ postfix status
+}
+
+abort() {
+ postfix abort
+}
+
+flush() {
+ postfix flush
+}
---- a/makedefs
-+++ b/makedefs
-@@ -190,9 +190,9 @@ error() {
+--- a/makedefs 2016-01-28 12:30:14.444082390 -0500
++++ b/makedefs 2016-01-28 13:44:02.092006512 -0500
+@@ -193,7 +193,7 @@ error() {
case $# in
# Officially supported usage.
- 0) SYSTEM=`(uname -s) 2>/dev/null`
-- RELEASE=`(uname -r) 2>/dev/null`
-- VERSION=`(uname -v) 2>/dev/null`
-+ 0) SYSTEM="Linux"
-+ RELEASE="3.10.18"
-+ VERSION="OpenWRT"
- case "$VERSION" in
- dcosx*) SYSTEM=$VERSION;;
- esac;;
-@@ -522,9 +522,9 @@ EOF
- esac
- for name in nsl resolv
- do
-- for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
-+ for lib in /usr/lib64 /usr/lib64/* /usr/lib /usr/lib/* /lib /lib/*
- do
-- test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
-+ test -e $STAGING_DIR/$lib/lib$name.a -o -e $STAGING_DIR/$lib/lib$name.so && {
- SYSLIBS="$SYSLIBS -l$name"
- break
- }
++ 0) SYSTEM="OpenWRT"
+ RELEASE=`(uname -r) 2>/dev/null`
+ # No ${x%%y} support in Solaris 11 /bin/sh
+ RELEASE_MAJOR=`expr "$RELEASE" : '\([0-9]*\)'` || exit 1
+@@ -207,6 +207,15 @@ case $# in
+ esac
+
+ case "$SYSTEM.$RELEASE" in
++ OpenWRT*) SYSTYPE=LINUX$RELEASE_MAJOR
++ SYSLIBS="$SYSLIBS -ldl"
++ : ${SHLIB_SUFFIX=.so}
++ : ${SHLIB_CFLAGS=-fPIC}
++ : ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'}
++ : ${SHLIB_RPATH='-Wl,--enable-new-dtags -Wl,-rpath,${SHLIB_DIR}'}
++ : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
++ : ${PLUGIN_LD="${CC-gcc} -shared"}
++ ;;
+ SCO_SV.3.2) SYSTYPE=SCO5
+ # Use the native compiler by default
+ : ${CC="/usr/bin/cc -b elf"}