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.

278 lines
8.3 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_RELEASE:=2
  10. PKG_VERSION:=3.4.6
  11. PKG_SOURCE_URL:= \
  12. https://cdn.postfix.johnriley.me/mirrors/postfix-release/official/ \
  13. http://ftp.porcupine.org/mirrors/postfix-release/official/
  14. PKG_HASH:=d674a9b40602ee30420ee7ff93c3600e8913eeb2ea9bfb0ac1d140dac5dbe326
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  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_BUILD_DEPENDS:=POSTFIX_CDB:tinycdb
  21. PKG_CONFIG_DEPENDS:= \
  22. CONFIG_POSTFIX_TLS \
  23. CONFIG_POSTFIX_SASL \
  24. CONFIG_POSTFIX_LDAP \
  25. CONFIG_POSTFIX_CDB \
  26. CONFIG_POSTFIX_DB \
  27. CONFIG_POSTFIX_SQLITE \
  28. CONFIG_POSTFIX_MYSQL \
  29. CONFIG_POSTFIX_PGSQL \
  30. CONFIG_POSTFIX_PCRE \
  31. CONFIG_POSTFIX_EAI \
  32. include $(INCLUDE_DIR)/package.mk
  33. define Package/postfix
  34. SECTION:=mail
  35. CATEGORY:=Mail
  36. TITLE:=Postfix Mail Transmit Agent
  37. USERID:= \
  38. postfix=25:postfix=25 \
  39. postdrop=26:postdrop=26
  40. URL:=http://www.postfix.org/
  41. DEPENDS:=+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
  42. endef
  43. define Package/postfix/description
  44. 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.
  45. endef
  46. define Package/postfix/config
  47. menu "Select postfix build options"
  48. config POSTFIX_TLS
  49. bool "TLS support"
  50. default y
  51. help
  52. Implements TLS support in postfix (using OpenSSL).
  53. config POSTFIX_SASL
  54. bool "SASL support"
  55. default y
  56. help
  57. Implements SASL support in postfix (using Cyrus SASL).
  58. config POSTFIX_LDAP
  59. bool "LDAP support"
  60. default y
  61. help
  62. Implements LDAP support in postfix (using OpenLDAP).
  63. config POSTFIX_DB
  64. bool "BerkeleyDB support"
  65. default n
  66. help
  67. Implements support for btree and hash files using Berkeley DB.
  68. config POSTFIX_CDB
  69. bool "CDB support"
  70. default y
  71. help
  72. Implements support for cdb files using tinycdb
  73. config POSTFIX_SQLITE
  74. bool "SQLITE support"
  75. default y
  76. help
  77. Implements support for SQLite3 DB
  78. config POSTFIX_MYSQL
  79. bool "MYSQL support"
  80. default n
  81. help
  82. Implements support for MySQL
  83. config POSTFIX_PGSQL
  84. bool "PostgreSQL support"
  85. default n
  86. help
  87. Implement support for PostgreSQL
  88. config POSTFIX_PCRE
  89. bool "PCRE support"
  90. default y
  91. help
  92. Implement support for Perl Compatible Regular Expressions
  93. config POSTFIX_EAI
  94. bool "SMTPUTF8 support"
  95. default n
  96. help
  97. Enable Postfix support for Email Address Internationalization
  98. (EAI) as defined in RFC 6531 (SMTPUTF8 extension), RFC 6532
  99. (Internationalized email headers) and RFC 6533
  100. (Internationalized delivery status notifications).
  101. Since version 3.0, Postfix fully supports UTF-8 email
  102. addresses and UTF-8 message header values.
  103. endmenu
  104. endef
  105. CCARGS=-DNO_NIS
  106. AUXLIBS=-L$(STAGING_DIR)/usr/lib
  107. ifdef CONFIG_POSTFIX_TLS
  108. CCARGS+=-DUSE_TLS
  109. AUXLIBS+=-lssl -lcrypto
  110. endif
  111. ifdef CONFIG_POSTFIX_SASL
  112. CCARGS+=-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I$(STAGING_DIR)/usr/include/sasl
  113. AUXLIBS+=-lsasl2
  114. endif
  115. ifdef CONFIG_POSTFIX_LDAP
  116. CCARGS+=-DHAS_LDAP
  117. AUXLIBS+=-lldap -llber
  118. endif
  119. ifdef CONFIG_POSTFIX_CDB
  120. CCARGS+=-DHAS_CDB
  121. AUXLIBS+=-lcdb
  122. ifndef default_database_type
  123. default_database_type=cdb
  124. endif
  125. endif
  126. ifdef CONFIG_POSTFIX_DB
  127. AUXLIBS+=-ldb
  128. CCARGS+=-DHAS_DB
  129. ifndef default_database_type
  130. default_database_type=btree
  131. endif
  132. else
  133. CCARGS+=-DNO_DB
  134. endif
  135. ifdef CONFIG_POSTFIX_SQLITE
  136. CCARGS+=-DHAS_SQLITE -I$(STAGING_DIR)/usr/include/
  137. AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lsqlite3 -lpthread
  138. endif
  139. ifdef CONFIG_POSTFIX_MYSQL
  140. CCARGS+=-DHAS_MYSQL -I$(STAGING_DIR)/usr/include/mysql
  141. AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lmysqlclient -lz -lm
  142. endif
  143. ifdef CONFIG_POSTFIX_PGSQL
  144. CCARGS+=-DHAS_PGSQL -I$(STAGING_DIR)/usr/include/
  145. AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lpq
  146. endif
  147. ifdef CONFIG_POSTFIX_PCRE
  148. CCARGS+=-DHAS_PCRE -I$(STAGING_DIR)/usr/include/
  149. AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lpcre
  150. else
  151. CCARGS+=-DNO_PCRE
  152. endif
  153. ifdef CONFIG_POSTFIX_EAI
  154. AUXLIBS+=-licuuc
  155. CCARGS+=-DHAS_EAI
  156. smtputf8_conf = yes
  157. else
  158. CCARGS+=-DNO_EAI
  159. smtputf8_conf = no
  160. endif
  161. CCARGS+=-DDEF_DB_TYPE=\"$(default_database_type)\"
  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)'
  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))