From c98b5ace9ea3c121be79eb8bccff5f209f2550b5 Mon Sep 17 00:00:00 2001 From: Denis Shulyaka Date: Tue, 9 Feb 2016 11:25:13 +0300 Subject: [PATCH] postfix: version update to 3.0.3. Some minor issues fixed. SMTPUTF8 support option added (by Val Kulkov). Disabled by default because of icu library size. --- mail/postfix/Makefile | 42 +++++++++++++++---- mail/postfix/files/main.cf.default | 26 ++++++------ mail/postfix/files/postfix.init | 22 +++++++++- mail/postfix/patches/500-crosscompile.patch | 46 ++++++++++----------- 4 files changed, 89 insertions(+), 47 deletions(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index bcbb07a18..9d25265bd 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -8,10 +8,10 @@ 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 PKG_LICENSE:=IPL-1.0 @@ -25,7 +25,7 @@ define Package/postfix 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 @@ -59,10 +59,20 @@ define Package/postfix/config 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 @@ -96,6 +106,15 @@ else 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 @@ -121,6 +140,7 @@ define Package/postfix/conffiles $(config_directory)/main.cf $(config_directory)/master.cf $(config_directory)/aliases +$(config_directory)/virtual endef define Build/Configure @@ -139,17 +159,18 @@ endef # 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 @@ -165,7 +186,7 @@ define Build/Compile 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 @@ -205,11 +226,12 @@ define Package/postfix/postinst 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 @@ -224,6 +246,8 @@ define Package/postfix/postrm #!/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 diff --git a/mail/postfix/files/main.cf.default b/mail/postfix/files/main.cf.default index d9eec99eb..944f2799d 100644 --- a/mail/postfix/files/main.cf.default +++ b/mail/postfix/files/main.cf.default @@ -254,7 +254,7 @@ lmtp_tls_CAfile = 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 = @@ -268,11 +268,11 @@ lmtp_tls_key_file = $lmtp_tls_cert_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 = @@ -306,8 +306,8 @@ local_transport = local:$myhostname 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 @@ -415,7 +415,7 @@ postscreen_use_tls = $smtpd_use_tls 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 @@ -511,7 +511,7 @@ smtp_body_checks = 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 @@ -586,7 +586,7 @@ smtp_tls_CAfile = 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 = @@ -600,11 +600,11 @@ smtp_tls_key_file = $smtp_tls_cert_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 = @@ -692,7 +692,7 @@ smtpd_tls_ask_ccert = no 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 = @@ -706,8 +706,8 @@ smtpd_tls_key_file = $smtpd_tls_cert_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 = diff --git a/mail/postfix/files/postfix.init b/mail/postfix/files/postfix.init index 1f3bc5e8b..dbedc4071 100644 --- a/mail/postfix/files/postfix.init +++ b/mail/postfix/files/postfix.init @@ -3,6 +3,10 @@ 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 @@ -16,7 +20,7 @@ upgrade() { 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)" @@ -36,7 +40,7 @@ upgrade() { 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)" @@ -46,6 +50,8 @@ upgrade() { postfix post-install upgrade-source postfix upgrade-configuration newaliases + postmap "$config_directory"/virtual + postfix check fi } @@ -62,3 +68,15 @@ reload() { upgrade postfix reload } + +status() { + postfix status +} + +abort() { + postfix abort +} + +flush() { + postfix flush +} diff --git a/mail/postfix/patches/500-crosscompile.patch b/mail/postfix/patches/500-crosscompile.patch index 0366612bb..7f1a9707e 100644 --- a/mail/postfix/patches/500-crosscompile.patch +++ b/mail/postfix/patches/500-crosscompile.patch @@ -1,27 +1,27 @@ ---- 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"}