You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
8.4 KiB

postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
postfix: fix uid/gid conflicts, general cleanup Fix uid/gid conflict with package icecast (uid=87, gid=87) and package pianod (uid=88, gid=88) by claiming uid/gid 25 for postfix instead of 87 and uid/gid 26 for postconf instead of 88. Remove main.cf.default that is not used by any Postfix module. The default configuration parameters are hardcoded into postconf and they are available via "postconf -d <parameter>". main.cf.default is therefore unnecessary. "mydomain" parameter should be deduced from the domain configuration setting in /e/c/dhcp rather than from "hostname" in /e/c/system which is often just a hostname without the domain name component. "mynetworks" parameter is unnecessary where "mynetworks_style" is defined. The change of the location of data_directory, queue_directory and mail_spool_directory from /var/lib/postfix, /var/spool/postfix and /var/mail to /data/postfix/lib, /data/postfix/spool and /data/postfix/mail has been postponed until the author of this commit and the maintainer of this package has had a meaningful opportunity to consult with LEDE/OpenWrt developers on the preferred mount point for the persistent data storage device. Change the criteria for executing the post-installation script. Invoke postinst() where the value of "myhostname" parameter in main.cf is not defined rather than where "$config_directory"/opkg_postinst is present with the value of "$config_directory" hardcoded to "$IPKG_INSTROOT"/etc/postfix in /etc/init.d/postfix. Enable PCRE support by default. Remove the code making entries in /etc/sysupgrade.conf and instead define configuration files to be saved during a sysupgrade in Makefile's Package/postfix/conffiles section. Move the creation of mail_spool_directory from host to target in order to enable change of directory ownership to 'postfix' when postinit() is executed on the target. Avoid postfix restart in postinst script that results in an error message during opkg install process. Enable Postfix autostart by creating a link in /etc/rc.d/ on installation. Make the code less verbose. Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
7 years ago
  1. #
  2. # Copyright (C) 2014-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=postfix
  9. PKG_VERSION:=3.5.8
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:= \
  13. https://cdn.postfix.johnriley.me/mirrors/postfix-release/official/ \
  14. http://ftp.porcupine.org/mirrors/postfix-release/official/
  15. PKG_HASH:=22582628cf3edc18c5155c9ff44543dd95a9435fb68135d76a99f572cb07456f
  16. PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
  17. PKG_LICENSE:=IPL-1.0
  18. PKG_LICENSE_FILES:=LICENSE
  19. PKG_CPE_ID:=cpe:/a:postfix:postfix
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_POSTFIX_TLS \
  22. CONFIG_POSTFIX_SASL \
  23. CONFIG_POSTFIX_LDAP \
  24. CONFIG_POSTFIX_CDB \
  25. CONFIG_POSTFIX_DB \
  26. CONFIG_POSTFIX_SQLITE \
  27. CONFIG_POSTFIX_MYSQL \
  28. CONFIG_POSTFIX_PGSQL \
  29. CONFIG_POSTFIX_PCRE \
  30. CONFIG_POSTFIX_EAI \
  31. include $(INCLUDE_DIR)/package.mk
  32. define Package/postfix
  33. SECTION:=mail
  34. CATEGORY:=Mail
  35. TITLE:=Postfix Mail Transmit Agent
  36. USERID:= \
  37. postfix=25:postfix=25 \
  38. postdrop=26:postdrop=26
  39. URL:=http://www.postfix.org/
  40. DEPENDS:=+POSTFIX_CDB:tinycdb +POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +POSTFIX_SQLITE:libsqlite3 +POSTFIX_MYSQL:libmysqlclient +POSTFIX_PGSQL:libpq +POSTFIX_EAI:icu +POSTFIX_PCRE:libpcre
  41. endef
  42. define Package/postfix/description
  43. Postfix is Wietse Venema's mailer that started life as an alternative to the widely-used Sendmail program. Postfix attempts to be fast, easy to administer, and secure, while at the same time being sendmail compatible enough to not upset existing users. Thus, the outside has a sendmail-ish flavor, but the inside is completely different.
  44. endef
  45. define Package/postfix/config
  46. menu "Select postfix build options"
  47. config POSTFIX_TLS
  48. bool "TLS support"
  49. default y
  50. help
  51. Implements TLS support in postfix (using OpenSSL).
  52. config POSTFIX_SASL
  53. bool "SASL support"
  54. default y
  55. help
  56. Implements SASL support in postfix (using Cyrus SASL).
  57. config POSTFIX_LDAP
  58. bool "LDAP support"
  59. default y
  60. help
  61. Implements LDAP support in postfix (using OpenLDAP).
  62. config POSTFIX_DB
  63. bool "BerkeleyDB support"
  64. default n
  65. help
  66. Implements support for btree and hash files using Berkeley DB.
  67. config POSTFIX_CDB
  68. bool "CDB support"
  69. default y
  70. help
  71. Implements support for cdb files using tinycdb
  72. config POSTFIX_SQLITE
  73. bool "SQLITE support"
  74. default y
  75. help
  76. Implements support for SQLite3 DB
  77. config POSTFIX_MYSQL
  78. bool "MYSQL support"
  79. default n
  80. help
  81. Implements support for MySQL
  82. config POSTFIX_PGSQL
  83. bool "PostgreSQL support"
  84. default n
  85. help
  86. Implement support for PostgreSQL
  87. config POSTFIX_PCRE
  88. bool "PCRE support"
  89. default y
  90. help
  91. Implement support for Perl Compatible Regular Expressions
  92. config POSTFIX_EAI
  93. bool "SMTPUTF8 support"
  94. default n
  95. help
  96. Enable Postfix support for Email Address Internationalization
  97. (EAI) as defined in RFC 6531 (SMTPUTF8 extension), RFC 6532
  98. (Internationalized email headers) and RFC 6533
  99. (Internationalized delivery status notifications).
  100. Since version 3.0, Postfix fully supports UTF-8 email
  101. addresses and UTF-8 message header values.
  102. endmenu
  103. endef
  104. CCARGS=-DNO_NIS -fcommon
  105. AUXLIBS=-L$(STAGING_DIR)/usr/lib
  106. ifdef CONFIG_POSTFIX_TLS
  107. CCARGS+=-DUSE_TLS
  108. AUXLIBS+=-lssl -lcrypto
  109. endif
  110. ifdef CONFIG_POSTFIX_SASL
  111. CCARGS+=-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I$(STAGING_DIR)/usr/include/sasl
  112. AUXLIBS+=-lsasl2
  113. endif
  114. ifdef CONFIG_POSTFIX_LDAP
  115. CCARGS+=-DHAS_LDAP
  116. AUXLIBS+=-lldap -llber
  117. endif
  118. ifdef CONFIG_POSTFIX_CDB
  119. CCARGS+=-DHAS_CDB
  120. AUXLIBS+=-lcdb
  121. ifndef default_database_type
  122. default_database_type=cdb
  123. endif
  124. endif
  125. ifdef CONFIG_POSTFIX_DB
  126. AUXLIBS+=-ldb
  127. CCARGS+=-DHAS_DB
  128. ifndef default_database_type
  129. default_database_type=btree
  130. endif
  131. else
  132. CCARGS+=-DNO_DB
  133. endif
  134. ifdef CONFIG_POSTFIX_SQLITE
  135. CCARGS+=-DHAS_SQLITE -I$(STAGING_DIR)/usr/include/
  136. AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lsqlite3 -lpthread
  137. endif
  138. ifdef CONFIG_POSTFIX_MYSQL
  139. CCARGS+=-DHAS_MYSQL -I$(STAGING_DIR)/usr/include/mysql
  140. AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lmysqlclient -lz -lm
  141. endif
  142. ifdef CONFIG_POSTFIX_PGSQL
  143. CCARGS+=-DHAS_PGSQL -I$(STAGING_DIR)/usr/include/
  144. AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lpq
  145. endif
  146. ifdef CONFIG_POSTFIX_PCRE
  147. CCARGS+=-DHAS_PCRE -I$(STAGING_DIR)/usr/include/
  148. AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lpcre
  149. else
  150. CCARGS+=-DNO_PCRE
  151. endif
  152. ifdef CONFIG_POSTFIX_EAI
  153. AUXLIBS+=-licuuc
  154. CCARGS+=-DHAS_EAI
  155. smtputf8_conf = yes
  156. else
  157. CCARGS+=-DNO_EAI
  158. smtputf8_conf = no
  159. endif
  160. CCARGS+=-DDEF_DB_TYPE=\"$(default_database_type)\"
  161. TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lresolv)
  162. # prevent postfix-install from executing postconf at build time
  163. # by explicitly providing the default values to postfix-install
  164. config_directory=/etc/postfix
  165. sample_directory=/etc/postfix
  166. command_directory=/usr/sbin
  167. daemon_directory=/usr/libexec/postfix
  168. html_directory=no
  169. manpage_directory=no
  170. readme_directory=no
  171. sendmail_path=/usr/sbin/sendmail
  172. newaliases_path=/usr/bin/newaliases
  173. mailq_path=/usr/bin/mailq
  174. shlib_directory=/usr/lib/postfix
  175. meta_directory=/etc/postfix
  176. data_directory=/usr/var/lib/postfix
  177. queue_directory=/usr/var/spool/postfix
  178. mail_spool_directory=/usr/var/mail
  179. ln_suffix=.postfix
  180. ln_suffix_pre_pf=.pre-postfix
  181. ln_suffix_legacy=.old
  182. define Package/postfix/conffiles
  183. $(config_directory)
  184. endef
  185. define Build/Configure
  186. if [ "$(default_database_type)" = "" ]; then \
  187. echo "Build error: CDB or BerkeleyDB support must be enabled."; \
  188. exit 1; \
  189. fi
  190. cd $(PKG_BUILD_DIR); $(MAKE) makefiles CCARGS='$(CCARGS)' $(TARGET_CONFIGURE_OPTS) AUXLIBS="$(AUXLIBS)"
  191. endef
  192. define Build/Compile
  193. # 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
  194. cd $(PKG_BUILD_DIR); $(MAKE) $(TARGET_CONFIGURE_OPTS) CC='$(TARGET_CC) $(CCARGS) $(TARGET_CFLAGS) $(TARGET_LDFLAGS)'
  195. $(foreach p, \
  196. default_database_type config_directory command_directory daemon_directory \
  197. shlib_directory manpage_directory data_directory queue_directory \
  198. mail_spool_directory, \
  199. echo "$(p) = $($(p))" >> $(PKG_BUILD_DIR)/conf/main.cf;)
  200. endef
  201. define Package/postfix/install
  202. cd $(PKG_BUILD_DIR); $(MAKE) install_root=$(1) command_directory=$(command_directory) daemon_directory=$(daemon_directory) data_directory=$(data_directory) html_directory=$(html_directory) mail_owner=postfix mailq_path=$(mailq_path)$(ln_suffix) manpage_directory=$(manpage_directory) newaliases_path=$(newaliases_path)$(ln_suffix) queue_directory=$(queue_directory) readme_directory=$(readme_directory) sendmail_path=$(sendmail_path)$(ln_suffix) setgid_group=postdrop sample_directory=$(sample_directory) config_directory=$(config_directory) shlib_directory=$(shlib_directory) meta_directory=$(meta_directory) mail_version=$(PKG_VERSION) non-interactive-package
  203. $(INSTALL_DIR) $(1)/etc/init.d/
  204. $(INSTALL_BIN) ./files/postfix.init $(1)/etc/init.d/postfix
  205. endef
  206. define Package/postfix/postinst
  207. #!/bin/sh
  208. for syml in $(sendmail_path) $(newaliases_path) $(mailq_path); do
  209. file=$${IPKG_INSTROOT}$${syml}
  210. if [ -f "$${file}$(ln_suffix_legacy)" ]; then
  211. # update files saved by legacy versions of Postfix postinst script
  212. mv "$${file}$(ln_suffix_legacy)" "$${file}$(ln_suffix_pre_pf)"
  213. fi
  214. if [ -f "$${file}" ]; then
  215. linktarget=$$(basename $$(readlink "$${file}"))
  216. postfixf=$$(basename "$${syml}")$(ln_suffix)
  217. if [ $${linktarget} != $${postfixf} ]; then
  218. mv "$${file}" "$${file}$(ln_suffix_pre_pf)"
  219. echo "Info: $${file} saved as $${file}$(ln_suffix_pre_pf)"
  220. fi
  221. fi
  222. if [ ! -f "$${file}" ]; then
  223. ln -s "$${syml}$(ln_suffix)" "$${file}"
  224. fi
  225. done
  226. # fix file/dir ownership in data_directory and queue_directory
  227. if [ -z "$${IPKG_INSTROOT}" ]; then
  228. postfix set-permissions
  229. fi
  230. endef
  231. define Package/postfix/postrm
  232. #!/bin/sh
  233. rm -f "$(sendmail_path)" "$(newaliases_path)" "$(mailq_path)"
  234. for syml in "$(sendmail_path)" "$(newaliases_path)" "$(mailq_path)"; do
  235. file=$${IPKG_INSTROOT}$${syml}
  236. if [ -f "$${file}$(ln_suffix_legacy)" ]; then
  237. # update files saved by legacy versions of Postfix postinst script
  238. mv "$${file}$(ln_suffix_legacy)" "$${file}$(ln_suffix_pre_pf)"
  239. fi
  240. if [ -f "$${syml}$(ln_suffix_pre_pf)" ]; then
  241. mv "$${syml}$(ln_suffix_pre_pf)" "$${syml}"
  242. echo "Info: $${syml}$(ln_suffix_pre_pf) restored as $${syml}"
  243. fi
  244. done
  245. endef
  246. $(eval $(call BuildPackage,postfix))