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.

139 lines
4.2 KiB

  1. #
  2. # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
  3. # Copyright (C) 2016-2019 Daniel Dickinson <cshored@thecshore.com>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=msmtp-scripts
  10. PKG_VERSION:=1.2.4
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://launchpad.net/$(PKG_NAME)/1.2/$(PKG_VERSION)/+download
  14. PKG_HASH:=fc85ab8ed1348be584adfc1feb89f51daed7404e9e8643652ff31d2af00f1cf5
  15. PKG_MAINTAINER:=Daniel F. Dickinson <cshored@thecshore.com>
  16. PKG_LICENSE:=GPL-3.0-or-later
  17. PKG_LICENSE_FILES:=COPYING
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/msmtp-scripts/Default
  20. SECTION:=mail
  21. CATEGORY:=Mail
  22. TITLE:=Forwarding only SMTP with queuing
  23. URL:=https://msmtp-scripts.thecshore.com
  24. endef
  25. define Package/msmtp-scripts/Default/description
  26. msmtp-scripts are scripts wrappers around the msmtp SMTP client that
  27. add queueing, logging to syslog or file, and a subset of sendmail/postfix
  28. mailq/postsuper/postqueue commands implemented in a compatible fashion.
  29. endef
  30. define Package/msmtpq-ng
  31. $(call Package/msmtp-scripts/Default)
  32. DEPENDS+= +msmtp
  33. TITLE+= (common)
  34. endef
  35. define Package/msmtpq-ng/conffiles
  36. /etc/msmtpq-ng.rc
  37. endef
  38. define Package/msmtpq-ng/description
  39. $(call Package/msmtp-scripts/Default/description)
  40. This package contains the msmtpq-ng and msmtpq-ng-queue
  41. wrappers around msmtp, which provide the bulk of the
  42. functionality.
  43. endef
  44. define Package/msmtpq-ng-mta
  45. $(call Package/msmtp-scripts/Default)
  46. TITLE+= (as MTA)
  47. DEPENDS+=+msmtpq-ng
  48. ALTERNATIVES:=\
  49. 400:/usr/sbin/sendmail:/usr/sbin/msmtpq-ng-mta \
  50. 400:/usr/lib/sendmail:/usr/sbin/msmtpq-ng-mta \
  51. 400:/usr/sbin/mailq:/usr/sbin/msmtpq-ng-queue-mta \
  52. 400:/usr/sbin/postqueue:/usr/sbin/msmtpq-ng-queue-mta \
  53. 400:/usr/sbin/postsuper:/usr/sbin/msmtpq-ng-queue-mta
  54. endef
  55. define Package/msmtpq-ng-mta/conffiles
  56. /etc/msmtpq-ng-mta.rc
  57. endef
  58. define Package/msmtpq-ng-mta/description
  59. $(call Package/msmtp-scripts/Default/description)
  60. This package provides sendmail, mailq, postfix,
  61. and postsuper symlinks to wrappers that configure
  62. msmtpq-ng for use as the system mail transport
  63. agent via the sendmail command.
  64. endef
  65. define Package/msmtpq-ng-mta-smtpd
  66. $(call Package/msmtp-scripts/Default)
  67. DEPENDS+= +msmtpq-ng-mta +xinetd
  68. TITLE+= (localhost SMTPd)
  69. USERID:=msmtp=482:msmtp=482
  70. endef
  71. define Package/msmtp-ng-mta-smtpd/description
  72. $(call Package/msmtp-scripts/Default/description)
  73. This package uses the -bs option to msmtpq-ng
  74. (which, like the sendmail -bs command, provides
  75. SMTP over stdin/stdout) combined with xinetd to
  76. provide a basic SMTP server. In it's default
  77. configuration it only accepts connections from
  78. localhost AND network mail must be released from
  79. the hold queue before it can be delivered.
  80. endef
  81. define Package/msmtpq-ng-mta-smtpd/conffiles
  82. /etc/xinetd.d/ms-mta-smtpd
  83. endef
  84. define Package/msmtpq-ng-mta/postinst
  85. mkdir -p $${IPKG_INSTROOT}/etc/crontabs
  86. if ! grep -q msmtpq-ng-mta $${IPKG_INSTROOT}/etc/crontabs/root 2>/dev/null; then echo $$'\n'"*/60 * * * * /usr/bin/msmtpq-ng-mta -q" >>$${IPKG_INSTROOT}/etc/crontabs/root; fi
  87. endef
  88. define Build/Configure
  89. true
  90. endef
  91. define Build/Compile
  92. true
  93. endef
  94. define Package/msmtpq-ng/install
  95. $(INSTALL_DIR) $(1)/etc
  96. $(INSTALL_DATA) ./files/msmtpq-ng.rc $(1)/etc/msmtpq-ng.rc
  97. $(INSTALL_DIR) $(1)/usr/bin
  98. $(CP) $(PKG_BUILD_DIR)/src/usr/bin/msmtpq-ng $(1)/usr/bin/
  99. $(CP) $(PKG_BUILD_DIR)/src/usr/bin/msmtpq-ng-queue $(1)/usr/bin/
  100. endef
  101. define Package/msmtpq-ng-mta/install
  102. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/sbin $(1)/usr/lib $(1)/etc/init.d
  103. $(INSTALL_DATA) ./files/msmtpq-ng-mta.rc $(1)/etc/
  104. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/usr/sbin/msmtpq-ng-mta $(1)/usr/sbin/
  105. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/usr/sbin//msmtpq-ng-queue-mta $(1)/usr/sbin/
  106. $(INSTALL_DIR) $(1)/etc/crontabs
  107. $(INSTALL_BIN) ./files/msmtpq-ng-mta.init $(1)/etc/init.d/msmtpq-ng-mta
  108. endef
  109. define Package/msmtpq-ng-mta-smtpd/install
  110. $(INSTALL_DIR) $(1)/etc/xinetd.d
  111. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/etc/xinetd.d/ms-mta-smtpd $(1)/etc/xinetd.d/ms-mta-smtpd
  112. endef
  113. $(eval $(call BuildPackage,msmtpq-ng))
  114. $(eval $(call BuildPackage,msmtpq-ng-mta))
  115. $(eval $(call BuildPackage,msmtpq-ng-mta-smtpd))