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.

144 lines
4.7 KiB

  1. #
  2. # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
  3. # Copyright (C) 2009-2015 OpenWrt.org
  4. # Copyright (C) 2016 Daniel Dickinson <cshored@thecshore.com>
  5. #
  6. # This is free software, licensed under the GNU General Public License v2.
  7. # See /LICENSE for more information.
  8. #
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=msmtp-scripts
  11. PKG_VERSION:=1.0.8
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=@SF/msmtp-scripts
  15. PKG_HASH:=2aec48d47b02facf2a33cf97a7434e969c1a054224406e6c55320d825c7902b2
  16. PKG_LICENSE:=GPL-3.0+
  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:=DEPRECATED: Simple sendmail SMTP queueing and forwarding
  23. URL:=http://msmtp-scripts.sourceforge.net/
  24. endef
  25. define Package/msmtp-scripts/Default/description
  26. DEPRECATED: SourceForge project is abandonded; and upstream (on GitHub)
  27. has deprecated this project. See:
  28. https://github.com/cshore-history/msmtp-scripts#deprecation-notice
  29. msmtp-scripts are scripts wrappers around the msmtp SMTP client that
  30. add queueing, logging to syslog or file, a subset of sendmail/postfix
  31. mailq/postsuper/postqueue commands implemented in a compatible fashion.
  32. endef
  33. define Package/msmtpq-ng
  34. $(call Package/msmtp-scripts/Default)
  35. DEPENDS+= @(PACKAGE_msmtp||PACKAGE_msmtp-nossl)
  36. TITLE+= (msmtpq-ng wrappers)
  37. endef
  38. define Package/msmtpq-ng/conffiles
  39. /etc/msmtpq-ng.rc
  40. endef
  41. define Package/msmtpq-ng/description
  42. $(call Package/msmtp-scripts/Default/description)
  43. This package contains the msmtpq-ng and msmtpq-ng-queue
  44. wrappers around msmtp, which provide the bulk of the
  45. functionality.
  46. endef
  47. define Package/msmtpq-ng-mta
  48. $(call Package/msmtp-scripts/Default)
  49. TITLE+= (as MTA)
  50. DEPENDS+=+msmtpq-ng
  51. USERID:=msmtp=482:msmtp=482
  52. endef
  53. define Package/msmtp-queue-mta/conffiles
  54. /etc/msmtpq-ng-mta.rc
  55. endef
  56. define Package/msmtpq-ng-mta/description
  57. $(call Package/msmtp-scripts/Default/description)
  58. This package provides sendmail, mailq, postfix,
  59. and postsuper symlinks to wrappers that configure
  60. msmtpq-ng for use as the system mail transport
  61. agent via the sendmail command.
  62. endef
  63. define Package/msmtpq-ng-mta-smtpd
  64. $(call Package/msmtp-scripts/Default)
  65. DEPENDS+= +msmtpq-ng-mta +xinetd
  66. TITLE+= (basic SMTP server)
  67. endef
  68. define Package/msmtp-ng-mta-smtpd/description
  69. $(call Package/msmtp-scripts/Default/description)
  70. This package uses the -bs option to msmtpq-ng
  71. (which, like the sendmail -bs command, provides
  72. SMTP over stdin/stdout) combined with xinetd to
  73. provide a basic SMTP server. In it's default
  74. configuration it only accepts connections from
  75. localhost AND network mail must be released from
  76. the hold queue before it can be delivered.
  77. endef
  78. define Package/msmtpq-ng-mta/postinst
  79. mkdir -p $${IPKG_INSTROOT}/etc/crontabs
  80. if ! grep -q msmtpq-ng-mta $${IPKG_INSTROOT}/etc/crontabs/root; then echo $$'\n'"*/60 * * * * /usr/bin/msmtpq-ng-mta -q" >>$${IPKG_INSTROOT}/etc/crontabs/root; fi
  81. endef
  82. define Package/msmtp-queue-mta/prerm
  83. if grep -q msmtpq-ng-mta $${IPKG_INSTROOT}/etc/crontabs/root; then grep -v '\*/60 \* \* \* \* /usr/bin/msmtpq-ng-mta -q' $${IPKG_INSTROOT}/etc/crontabs/root >$${IPKG_INSTROOT}/etc/crontabs/root.new; mv -f $${IPKG_INSTROOT}/etc/crontabs/root.new $${IPKG_INSTROOT}/etc/crontabs; fi
  84. endef
  85. define Build/Configure
  86. true
  87. endef
  88. define Build/Compile
  89. true
  90. endef
  91. define Package/msmtpq-ng/install
  92. $(INSTALL_DIR) $(1)/etc
  93. $(INSTALL_CONF) ./files/msmtpq-ng.rc $(1)/etc/msmtpq-ng.rc
  94. $(INSTALL_DIR) $(1)/usr/bin
  95. $(CP) $(PKG_BUILD_DIR)/msmtpq-ng/msmtpq-ng $(1)/usr/bin/
  96. $(SED) 's/logger -i/logger/' $(1)/usr/bin/msmtpq-ng
  97. $(CP) $(PKG_BUILD_DIR)/msmtpq-ng/msmtpq-ng-queue $(1)/usr/bin/
  98. endef
  99. define Package/msmtpq-ng-mta/install
  100. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/sbin $(1)/usr/lib $(1)/etc/init.d
  101. $(INSTALL_CONF) $(PKG_BUILD_DIR)/msmtpq-ng-mta/msmtpq-ng-mta.rc $(1)/etc/
  102. echo 'MSMTP_LOCK_DIR=/var/lock/msmtp' >>$(1)/etc/msmtpq-ng-mta.rc
  103. $(INSTALL_BIN) $(PKG_BUILD_DIR)/msmtpq-ng-mta/msmtpq-ng-mta $(1)/usr/bin/
  104. $(INSTALL_BIN) $(PKG_BUILD_DIR)/msmtpq-ng-mta/msmtpq-ng-queue-mta $(1)/usr/bin/
  105. $(INSTALL_DIR) $(1)/etc/crontabs
  106. $(INSTALL_BIN) ./files/msmtpq-ng-mta.init $(1)/etc/init.d/msmtpq-ng-mta
  107. ln -sf ../bin/msmtpq-ng-mta $(1)/usr/sbin/sendmail
  108. ln -sf ../bin/msmtpq-ng-mta $(1)/usr/lib/sendmail
  109. ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/mailq
  110. ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/postqueue
  111. ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/postsuper
  112. endef
  113. define Package/msmtpq-ng-mta-smtpd/install
  114. $(INSTALL_DIR) $(1)/etc/xinetd.d
  115. $(INSTALL_BIN) $(PKG_BUILD_DIR)/msmtpq-ng-mta/sendmail-bs.xinetd $(1)/etc/xinetd.d/msmtpq-ng-mta-smtpd
  116. endef
  117. $(eval $(call BuildPackage,msmtpq-ng))
  118. $(eval $(call BuildPackage,msmtpq-ng-mta))
  119. $(eval $(call BuildPackage,msmtpq-ng-mta-smtpd))