New Package -- msmtp
authorAndy Boyett <agb@openwrt.org>
Tue, 3 Feb 2009 05:45:14 +0000 (05:45 +0000)
committerAndy Boyett <agb@openwrt.org>
Tue, 3 Feb 2009 05:45:14 +0000 (05:45 +0000)
Here's a patch for msmtp, an advanced but still lightweight sendmail
replacement that forwards email upstream to an SMTP server. This
software is actively developed, unlike ssmtp which is out of date and
only seems to be linked on the Debian repository. I was able to easily
forward email upstream using GMail/Google Apps with this package, but
ran in to bugs using ssmtp. Rather than try to fix that, I packaged
msmtp.

Signed-off-by: David Cooper <dave@kupesoft.com>
SVN-Revision: 14380

mail/msmtp/Makefile [new file with mode: 0644]

diff --git a/mail/msmtp/Makefile b/mail/msmtp/Makefile
new file mode 100644 (file)
index 0000000..7ffed38
--- /dev/null
@@ -0,0 +1,108 @@
+#
+# Copyright (C) 2009 David Cooper <dave@kupesoft.com>
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=msmtp
+PKG_VERSION:=1.4.17
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/msmtp
+
+PKG_MD5SUM:=b0b74f1144812b60688f590c62a0d3dd
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/msmtp/Default
+  SECTION:=mail
+  CATEGORY:=Mail
+  TITLE:=Simple sendmail SMTP forwarding
+  URL:=http://msmtp.sourceforge.net/
+endef
+
+define Package/msmtp/Default/description
+ msmtp is an SMTP client. In the default mode, it transmits a mail to
+ an SMTP server (for example at a free mail provider) which does the
+ delivery. To use this program with your mail user agent (MUA), create
+ a configuration file with your mail account(s) and tell your MUA to
+ call msmtp instead of /usr/sbin/sendmail.
+endef
+
+define Package/msmtp
+$(call Package/msmtp/Default)
+  DEPENDS+= +libopenssl
+  TITLE+= (with SSL support)
+endef
+
+define Package/msmtp/description
+$(call Package/msmtp/Default/description)
+ This package is built with SSL support.
+endef
+
+define Package/msmtp-nossl
+$(call Package/msmtp/Default)
+  TITLE+= (without SSL support)
+endef
+
+define Package/msmtp-nossl/description
+$(call Package/msmtp/Default/description)
+ This package is built without SSL support.
+endef
+
+define Build/Template
+
+$(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
+       -$(MAKE) -C $(PKG_BUILD_DIR) clean
+       $(call Build/Configure/Default,$(3))
+       $(MAKE) -C $(PKG_BUILD_DIR)
+       ( cd $(PKG_BUILD_DIR)/src; mv -f msmtp msmtp-$(2) )
+       touch $$@
+
+$(STAMP_BUILT): $(STAMP_BUILT)-$(2)
+
+define Package/$(1)/install
+       $(INSTALL_DIR) $$(1)/etc
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
+               $$(1)/etc/msmtprc
+       $(INSTALL_DIR) $$(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/msmtp-$(2) $$(1)/usr/bin/msmtp
+       $(INSTALL_DIR) $$(1)/usr/sbin
+       ln -sf /usr/bin/msmtp $$(1)/usr/sbin/sendmail
+endef
+
+endef
+
+CONFIGURE_ARGS += \
+       --without-libssl32 \
+       --without-libintl \
+       --without-libgsasl \
+       --without-libidn
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_msmtp),)
+  define Build/with-ssl
+       $(call Build/Template,msmtp,with-ssl, \
+               --with-ssl=openssl \
+               --with-libssl-prefix="$(STAGING_DIR)/usr/include" \
+       )
+  endef
+endif
+$(eval $(Build/with-ssl))
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_msmtp-nossl),)
+  define Build/without-ssl
+       $(call Build/Template,msmtp-nossl,without-ssl, \
+               --with-ssl=no \
+       )
+  endef
+endif
+$(eval $(Build/without-ssl))
+
+$(eval $(call BuildPackage,msmtp))
+$(eval $(call BuildPackage,msmtp-nossl))
+