summaryrefslogtreecommitdiff
path: root/mail/emailrelay/files/emailrelay.in
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2015-07-23 16:40:43 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2015-07-23 16:40:43 +0000
commit24df61d459fc5c748bb57220ba21ac8d0ac7ae50 (patch)
tree1eb92e8a23034c38b424d3a2d71e242081f3ce1f /mail/emailrelay/files/emailrelay.in
parent- Fix docs build after texlive upgrade (diff)
Add a port of E-MailRelay, a simple SMTP proxy and store-and-forward message
transfer agent (MTA). WWW: http://emailrelay.sourceforge.net/ PR: 199192 Submitted by: Robert Nelson
Notes
Notes: svn path=/head/; revision=392741
Diffstat (limited to 'mail/emailrelay/files/emailrelay.in')
-rw-r--r--mail/emailrelay/files/emailrelay.in52
1 files changed, 52 insertions, 0 deletions
diff --git a/mail/emailrelay/files/emailrelay.in b/mail/emailrelay/files/emailrelay.in
new file mode 100644
index 000000000000..5accc9d7c5ca
--- /dev/null
+++ b/mail/emailrelay/files/emailrelay.in
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# A shell-script wrapper for E-MailRelay for use in the FreeBSD rc.d system.
+#
+# Additional command-line options for the emailrelay daemon are sourced from
+# the file "/usr/local/etc/emailrelay.conf" if it exists. Uncommented lines
+# in this file have "--" prepended to them and then they are pasted onto the
+# command line.
+#
+# usage: emailrelay { start | stop | restart | force-reload | status }
+#
+
+# PROVIDE: emailrelay
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name=emailrelay
+rcvar=emailrelay_enable
+command=%%PREFIX%%/sbin/emailrelay
+
+emailrelay_config_file=%%PREFIX%%/etc/emailrelay.conf
+
+pidfile=/var/run/emailrelay.pid
+required_files=$config_file
+start_precmd=emailrelay_prestart
+
+load_rc_config $name
+
+: ${emailrelay_enable:=no}
+
+emailrelay_config_options()
+{
+ # echo --options from the config file
+ egrep -v '^#|^gui-|^ *$' < $emailrelay_config_file | sed 's/^/--/'
+}
+
+emailrelay_start_options()
+{
+ # echo start command tail
+ echo --as-server --pid-file $pidfile `emailrelay_config_options`
+}
+
+emailrelay_prestart()
+{
+ rc_flags=`emailrelay_start_options`
+}
+
+run_rc_command "$1"