<p dir="ltr">Hi, please make a PR to <a href="https://github.com/openwrt/packages">https://github.com/openwrt/packages</a></p>
<div class="gmail_quote">Le 1 juil. 2014 02:53, "Federico Di Marco" <<a href="mailto:fededim@gmail.com">fededim@gmail.com</a>> a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Federico Di Marco <<a href="mailto:fededim@gmail.com">fededim@gmail.com</a>><br>
<br>
Body of explanation:<br>
A new package has been added in packages feed under net/emailrelay<br>
directory, porting a simple SMTP proxy and store-and-forward message<br>
transfer agent (MTA) called EmailRelay (please see<br>
<a href="http://emailrelay.sourceforge.net/" target="_blank">http://emailrelay.sourceforge.net/</a>) to OpenWRT.<br>
The patch consists of the following files:<br>
- Makefile: standard makefile of OpenWRT packages which downloads from<br>
sourceforge the source code and compiles it into a package using the<br>
uClibc++.<br>
- Makefile.libstdc++: alternative makefile to perform compilation with<br>
the standard c++ library.<br>
- files/emailrelay.auth: configuration file for emailrelay<br>
- files/emailrelay.init: simple shell script for managing service<br>
installation and startup.<br>
<br>
<br>
Sign-off:<br>
Developer's Certificate of Origin 1.1<br>
<br>
By making a contribution to this project, I certify that:<br>
<br>
(a) The contribution was created in whole or in part by me and I<br>
    have the right to submit it under the open source license<br>
    indicated in the file; or<br>
<br>
(b) The contribution is based upon previous work that, to the best<br>
    of my knowledge, is covered under an appropriate open source<br>
    license and I have the right under that license to submit that<br>
    work with modifications, whether created in whole or in part<br>
    by me, under the same open source license (unless I am<br>
    permitted to submit under a different license), as indicated<br>
    in the file; or<br>
<br>
(c) The contribution was provided directly to me by some other<br>
    person who certified (a), (b) or (c) and I have not modified<br>
    it.<br>
<br>
(d) I understand and agree that this project and the contribution<br>
    are public and that a record of the contribution (including all<br>
    personal information I submit with it, including my sign-off) is<br>
    maintained indefinitely and may be redistributed consistent with<br>
    this project or the open source license(s) involved.<br>
<br>
Signed-off-by: Federico Di Marco <<a href="mailto:fededim@gmail.com">fededim@gmail.com</a>><br>
<br>
---<br>
<br>
Diff output (according to <a href="https://dev.openwrt.org/wiki/SubmittingPatches/Diff" target="_blank">https://dev.openwrt.org/wiki/SubmittingPatches/Diff</a>)<br>
<br>
diff -uprN packages/net/emailrelay/files/emailrelay.auth<br>
mypackages/net/emailrelay/files/emailrelay.auth<br>
--- packages/net/emailrelay/files/emailrelay.auth 1970-01-01<br>
01:00:00.000000000 +0100<br>
+++ mypackages/net/emailrelay/files/emailrelay.auth 2014-07-01<br>
01:56:20.297997383 +0200<br>
@@ -0,0 +1,16 @@<br>
+#<br>
+# emailrelay secrets file<br>
+#<br>
+#see <a href="http://emailrelay.sourceforge.net/reference.html" target="_blank">http://emailrelay.sourceforge.net/reference.html</a> for reference<br>
+<br>
+#Mostly used options:<br>
+#<br>
+#NONE server specifies ip address range allowed to connect to<br>
emailrelay SMTP server<br>
+#LOGIN client specifies the credentials to be used when forwarding<br>
emails to another SMTP server<br>
+#LOGIN server specifies the credentials to be needed to authenticate<br>
with the emailrelay SMTP server<br>
+<br>
+#Examples:<br>
+#<br>
+#NONE server 192.168.1.* keyword<br>
+#LOGIN client smtpuser@smtpserver smtppassword<br>
+#LOGIN server user1 secret<br>
\ No newline at end of file<br>
diff -uprN packages/net/emailrelay/files/emailrelay.init<br>
mypackages/net/emailrelay/files/emailrelay.init<br>
--- packages/net/emailrelay/files/emailrelay.init 1970-01-01<br>
01:00:00.000000000 +0100<br>
+++ mypackages/net/emailrelay/files/emailrelay.init 2014-07-01<br>
01:56:20.293997264 +0200<br>
@@ -0,0 +1,15 @@<br>
+#!/bin/sh /etc/rc.common<br>
+#see <a href="http://emailrelay.sourceforge.net/reference.html" target="_blank">http://emailrelay.sourceforge.net/reference.html</a> for command<br>
line reference<br>
+<br>
+START=90<br>
+<br>
+<br>
+start() {<br>
+        logger -t 'emailrelay' "Starting emailrelay service."<br>
+        service_start emailrelay --as-server --poll 60 --forward-to<br>
smtpserver:smtpport --spool-dir /tmp --client-tls --client-auth<br>
/etc/emailrelay.auth --server-auth /etc/emailrelay.auth --log<br>
+}<br>
+<br>
+stop() {<br>
+        logger -t 'emailrelay' "Stopping emailrelay service."<br>
+        killall -9 emailrelay<br>
+}<br>
diff -uprN packages/net/emailrelay/Makefile mypackages/net/emailrelay/Makefile<br>
--- packages/net/emailrelay/Makefile 1970-01-01 01:00:00.000000000 +0100<br>
+++ mypackages/net/emailrelay/Makefile 2014-07-01 01:56:20.297997383 +0200<br>
@@ -0,0 +1,75 @@<br>
+#<br>
+# Copyright (C) 2006-2011 OpenWrt.org<br>
+#<br>
+# This is free software, licensed under the GNU General Public License v2.<br>
+# See /LICENSE for more information.<br>
+#<br>
+<br>
+include $(TOPDIR)/<a href="http://rules.mk" target="_blank">rules.mk</a><br>
+<br>
+PKG_NAME:=emailrelay<br>
+PKG_VERSION:=1.9<br>
+PKG_RELEASE:=1<br>
+<br>
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz<br>
+PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)<br>
+PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62<br>
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install<br>
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)<br>
+PKG_CAT :=zcat<br>
+<br>
+include $(INCLUDE_DIR)/<a href="http://package.mk" target="_blank">package.mk</a><br>
+<br>
+define Package/emailrelay<br>
+  SECTION:=net<br>
+  CATEGORY:=Network<br>
+  DEPENDS:=+uclibcxx +libopenssl<br>
+  SUBMENU:=Web Servers/Proxies<br>
+  TITLE:=A simple SMTP proxy and store-and-forward message transfer<br>
agent (MTA).<br>
+  URL:=<a href="http://emailrelay.sourceforge.net/" target="_blank">http://emailrelay.sourceforge.net/</a><br>
+endef<br>
+<br>
+<br>
+define Package/emailrelay/description<br>
+ Simple SMTP proxy and store-and-forward message transfer agent (MTA).<br>
+<br>
+ When running as a proxy all e-mail messages can be passed through<br>
+  a user-defined program, such as a spam filter, which can drop,<br>
+  re-address or edit messages as they pass through. When running<br>
+  as a store-and-forward MTA incoming messages are stored in a<br>
+  local spool directory, and then forwarded to the next SMTP<br>
+  server on request.<br>
+endef<br>
+<br>
+<br>
+define Package/emailrelay/conffiles<br>
+/etc/emailrelay.auth<br>
+endef<br>
+<br>
+<br>
+<br>
+CONFIGURE_VARS += \<br>
+        CXXFLAGS="-nostdinc++"  \<br>
+ LDFLAGS="-nodefaultlibs" \<br>
+ LIBS="-lgcc -lc -luClibc++ -lgcc_s"<br>
+<br>
+<br>
+define Build/Configure<br>
+  $(call Build/Configure/Default,--with-openssl)<br>
+  endef<br>
+<br>
+define Package/emailrelay/install<br>
+ $(INSTALL_DIR) $(1)/usr/bin<br>
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay $(1)/usr/bin/<br>
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-filter-copy $(1)/usr/bin/<br>
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-passwd $(1)/usr/bin/<br>
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-poke $(1)/usr/bin/<br>
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-submit $(1)/usr/bin/<br>
+ $(INSTALL_DIR) $(1)/etc<br>
+ $(INSTALL_DATA) files/$(PKG_NAME).auth $(1)/etc/<br>
+ $(INSTALL_DIR) $(1)/etc/init.d<br>
+ $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)<br>
+endef<br>
+<br>
+$(eval $(call BuildPackage,emailrelay))<br>
diff -uprN packages/net/emailrelay/Makefile.libstdc++<br>
mypackages/net/emailrelay/Makefile.libstdc++<br>
--- packages/net/emailrelay/Makefile.libstdc++ 1970-01-01<br>
01:00:00.000000000 +0100<br>
+++ mypackages/net/emailrelay/Makefile.libstdc++ 2014-07-01<br>
01:56:20.293997264 +0200<br>
@@ -0,0 +1,52 @@<br>
+#<br>
+# Copyright (C) 2006-2011 OpenWrt.org<br>
+#<br>
+# This is free software, licensed under the GNU General Public License v2.<br>
+# See /LICENSE for more information.<br>
+#<br>
+<br>
+include $(TOPDIR)/<a href="http://rules.mk" target="_blank">rules.mk</a><br>
+<br>
+PKG_NAME:=emailrelay<br>
+PKG_VERSION:=1.9<br>
+PKG_RELEASE:=1<br>
+<br>
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz<br>
+PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)<br>
+PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62<br>
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install<br>
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)<br>
+#PKG_INSTALL:=1<br>
+PKG_CAT :=zcat<br>
+<br>
+#include $(INCLUDE_DIR)/uclibc++.mk<br>
+include $(INCLUDE_DIR)/<a href="http://package.mk" target="_blank">package.mk</a><br>
+<br>
+define Package/emailrelay<br>
+  SECTION:=net<br>
+  CATEGORY:=Network<br>
+  DEPENDS:=$(CXX_DEPENDS) +libopenssl<br>
+  SUBMENU:=Web Servers/Proxies<br>
+  TITLE:=A simple SMTP proxy and store-and-forward message transfer<br>
agent (MTA).<br>
+  URL:=<a href="http://emailrelay.sourceforge.net/" target="_blank">http://emailrelay.sourceforge.net/</a><br>
+endef<br>
+<br>
+#define Package/srelay/conffiles<br>
+#/etc/emailrelay.auth<br>
+#endef<br>
+<br>
+define Build/Configure<br>
+  $(call Build/Configure/Default,--with-openssl=$(STAGING_DIR))<br>
+  endef<br>
+<br>
+<br>
+define Package/emailrelay/install<br>
+ $(INSTALL_DIR) $(1)/usr/bin<br>
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/<br>
+ $(INSTALL_DIR) $(1)/etc<br>
+# $(INSTALL_DATA) files/$(PKG_NAME).conf $(1)/etc/<br>
+ $(INSTALL_DIR) $(1)/etc/init.d<br>
+# $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)<br>
+endef<br>
+<br>
+$(eval $(call BuildPackage,emailrelay))<br>
_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div>