emailrelay: added configuration options 3185/head
authorRupan <fededim@gmail.com>
Sun, 18 Sep 2016 13:32:24 +0000 (15:32 +0200)
committerRupan <fededim@gmail.com>
Tue, 4 Oct 2016 10:23:17 +0000 (12:23 +0200)
- moved from net to mail category
- removed no-ssl package and added ssl support as configuration option (default enabled)
- added configuration option to support extended logging (default disabled)
- disabled build of test tools
- added LEDE compatibility (support for openssl without SSL3)

Signed-off-by: Federico Di Marco <fededim@gmail.com>
mail/emailrelay/Makefile [new file with mode: 0644]
mail/emailrelay/files/emailrelay.auth [new file with mode: 0644]
mail/emailrelay/files/emailrelay.init [new file with mode: 0644]
mail/emailrelay/patches/010-ssl3-fix.patch [new file with mode: 0644]
net/emailrelay/Makefile [deleted file]
net/emailrelay/files/emailrelay.auth [deleted file]
net/emailrelay/files/emailrelay.init [deleted file]

diff --git a/mail/emailrelay/Makefile b/mail/emailrelay/Makefile
new file mode 100644 (file)
index 0000000..e672c9a
--- /dev/null
@@ -0,0 +1,114 @@
+#
+# Copyright (C) 2006-2014 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:=emailrelay
+PKG_VERSION:=1.9
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz
+PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)
+PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_CONFIG_DEPENDS:=CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG CONFIG_EMAILRELAY_SSL 
+
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/emailrelay
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=$(CXX_DEPENDS) +EMAILRELAY_SSL:libopenssl
+  TITLE:=A simple SMTP proxy and MTA
+  URL:=http://emailrelay.sourceforge.net/
+  MAINTAINER:=Federico Di Marco <fededim@gmail.com>
+  MENU:=1
+endef
+
+
+define Package/emailrelay/config
+config EMAILRELAY_SUPPORT_VERBOSE_DBG
+       bool "Enable support for extended logging"
+       depends on PACKAGE_emailrelay
+       default n
+       help
+         Enables support for extended logging (must also be explicitely enabled by using command line switch --debug when starting emailrelay)
+
+config EMAILRELAY_SSL 
+       bool "Enable support for OpenSSL"
+       depends on PACKAGE_emailrelay
+       default y
+       select PACKAGE_libopenssl
+       help
+         Builds the package with OpenSSL support (SSMTP is supported).
+endef
+
+
+
+define Package/emailrelay/description
+ Emailrelay is a simple SMTP proxy and store-and-forward message transfer agent (MTA). 
+ When running as a proxy all e-mail messages can be passed through 
+  a user-defined program, such as a spam filter, which can drop, 
+  re-address or edit messages as they pass through. When running 
+  as a store-and-forward MTA incoming messages are stored in a 
+  local spool directory, and then forwarded to the next SMTP 
+  server on request.
+endef
+
+
+define Package/emailrelay/conffiles
+/etc/emailrelay.auth
+endef
+
+
+CONFIGURE_ARGS += \
+       --with-pam=no \
+       --enable-testing=no
+
+CONFIGURE_VARS += \
+       CXXFLAGS="$$$$CXXFLAGS -fno-rtti"       
+
+
+ifeq ($(CONFIG_EMAILRELAY_SSL),y)
+       CONFIGURE_ARGS += \
+               --with-openssl
+else
+       CONFIGURE_ARGS += \
+               --with-openssl=no
+endif
+
+
+ifeq ($(CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG),y)
+       CONFIGURE_ARGS += \
+               --enable-debug=yes
+endif
+
+ifeq ($(CONFIG_OPENSSL_WITH_SSL3),y)
+       CONFIGURE_VARS += \
+               CXXFLAGS="$$$$CXXFLAGS -DSSL3_SUPPORT"  
+endif
+
+define Package/emailrelay/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-filter-copy $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-passwd $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-poke $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-submit $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) files/$(PKG_NAME).auth $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
+endef
+
+
+$(eval $(call BuildPackage,emailrelay))
diff --git a/mail/emailrelay/files/emailrelay.auth b/mail/emailrelay/files/emailrelay.auth
new file mode 100644 (file)
index 0000000..3d11bf0
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# emailrelay secrets file
+#
+#see http://emailrelay.sourceforge.net/reference.html for reference
+
+#Mostly used options:
+#
+#NONE server specifies ip address range allowed to connect to emailrelay SMTP server
+#LOGIN client specifies the credentials to be used when forwarding emails to another SMTP server
+#LOGIN server specifies the credentials to be needed to authenticate with the emailrelay SMTP server
+
+#Examples:
+#
+#NONE server 192.168.1.* keyword
+#LOGIN client smtpuser@smtpserver smtppassword
+#LOGIN server user1 secret
\ No newline at end of file
diff --git a/mail/emailrelay/files/emailrelay.init b/mail/emailrelay/files/emailrelay.init
new file mode 100644 (file)
index 0000000..9fc3399
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+#see http://emailrelay.sourceforge.net/reference.html for command line reference
+
+START=90
+
+
+start() {
+        logger -t 'emailrelay' "Starting emailrelay service."
+        service_start /usr/bin/emailrelay --as-server --poll 60 --forward-to smtpserver:smtpport --spool-dir /tmp --client-tls --client-auth /etc/emailrelay.auth --server-auth /etc/emailrelay.auth --log
+}
+
+stop() {
+        logger -t 'emailrelay' "Stopping emailrelay service."
+        service_stop /usr/bin/emailrelay
+}
diff --git a/mail/emailrelay/patches/010-ssl3-fix.patch b/mail/emailrelay/patches/010-ssl3-fix.patch
new file mode 100644 (file)
index 0000000..d0e82f5
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/gssl/gssl_openssl.cpp
++++ b/src/gssl/gssl_openssl.cpp
+@@ -292,8 +292,10 @@ GSsl::Context::Context( const std::strin
+ {
+       if( (flags&3U) == 2U )
+               m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
++#ifdef SSL3_SUPPORT
+       else if( (flags&3U) == 3U )
+               m_ssl_ctx = SSL_CTX_new(SSLv3_method()) ;
++#endif
+       else
+               m_ssl_ctx = SSL_CTX_new(TLSv1_method()) ;
diff --git a/net/emailrelay/Makefile b/net/emailrelay/Makefile
deleted file mode 100644 (file)
index 4f352d0..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#
-# Copyright (C) 2006-2014 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:=emailrelay
-PKG_VERSION:=1.9
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz
-PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)
-PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
-
-include $(INCLUDE_DIR)/uclibc++.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/emailrelay/Default
-  SECTION:=net
-  SUBMENU:=Web Servers/Proxies
-  CATEGORY:=Network
-  DEPENDS:=$(CXX_DEPENDS)
-  TITLE:=A simple SMTP proxy and MTA
-  URL:=http://emailrelay.sourceforge.net/
-  MAINTAINER:=Federico Di Marco <fededim@gmail.com>
-endef
-
-
-define Package/emailrelay
-$(call Package/emailrelay/Default)
-  TITLE+= (with OpenSSL support)
-  DEPENDS+=+libopenssl
-  VARIANT:=ssl
-endef
-
-define Package/emailrelay-nossl
-$(call Package/emailrelay/Default)
-  TITLE+= (no SSL support)
-  VARIANT:=nossl
-endef
-
-
-
-define Package/emailrelay/Default/description
- Emailrelay is a simple SMTP proxy and store-and-forward message transfer agent (MTA). 
- When running as a proxy all e-mail messages can be passed through 
-  a user-defined program, such as a spam filter, which can drop, 
-  re-address or edit messages as they pass through. When running 
-  as a store-and-forward MTA incoming messages are stored in a 
-  local spool directory, and then forwarded to the next SMTP 
-  server on request.
-endef
-
-
-define Package/emailrelay/description
-$(call Package/emailrelay/Default/description)
-
- This package is built with OpenSSL support (SSMTP is supported).
-endef
-
-define Package/emailrelay-nossl/description
-$(call Package/emailrelay/Default/description)
-
- This package is built without SSL support (no SSMTP)
-endef
-
-
-define Package/emailrelay/conffiles
-/etc/emailrelay.auth
-endef
-
-define Package/emailrelay-nossl/conffiles
-/etc/emailrelay.auth
-endef
-
-CONFIGURE_ARGS += \
-       --with-pam=no
-
-CONFIGURE_VARS += \
-       CXXFLAGS="$$$$CXXFLAGS -fno-rtti"       
-
-ifeq ($(BUILD_VARIANT),ssl)
-       CONFIGURE_ARGS += \
-               --with-openssl
-endif
-
-ifeq ($(BUILD_VARIANT),nossl)
-       CONFIGURE_ARGS += \
-               --with-openssl=no
-endif
-
-define Package/emailrelay/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-filter-copy $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-passwd $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-poke $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-submit $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_DATA) files/$(PKG_NAME).auth $(1)/etc/
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
-endef
-
-Package/emailrelay-nossl/install = $(Package/emailrelay/install)
-
-
-$(eval $(call BuildPackage,emailrelay))
-$(eval $(call BuildPackage,emailrelay-nossl))
diff --git a/net/emailrelay/files/emailrelay.auth b/net/emailrelay/files/emailrelay.auth
deleted file mode 100644 (file)
index 3d11bf0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# emailrelay secrets file
-#
-#see http://emailrelay.sourceforge.net/reference.html for reference
-
-#Mostly used options:
-#
-#NONE server specifies ip address range allowed to connect to emailrelay SMTP server
-#LOGIN client specifies the credentials to be used when forwarding emails to another SMTP server
-#LOGIN server specifies the credentials to be needed to authenticate with the emailrelay SMTP server
-
-#Examples:
-#
-#NONE server 192.168.1.* keyword
-#LOGIN client smtpuser@smtpserver smtppassword
-#LOGIN server user1 secret
\ No newline at end of file
diff --git a/net/emailrelay/files/emailrelay.init b/net/emailrelay/files/emailrelay.init
deleted file mode 100644 (file)
index 9fc3399..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh /etc/rc.common
-#see http://emailrelay.sourceforge.net/reference.html for command line reference
-
-START=90
-
-
-start() {
-        logger -t 'emailrelay' "Starting emailrelay service."
-        service_start /usr/bin/emailrelay --as-server --poll 60 --forward-to smtpserver:smtpport --spool-dir /tmp --client-tls --client-auth /etc/emailrelay.auth --server-auth /etc/emailrelay.auth --log
-}
-
-stop() {
-        logger -t 'emailrelay' "Stopping emailrelay service."
-        service_stop /usr/bin/emailrelay
-}