summaryrefslogtreecommitdiff
path: root/mail/emailrelay/files
diff options
context:
space:
mode:
Diffstat (limited to 'mail/emailrelay/files')
-rw-r--r--mail/emailrelay/files/emailrelay.in52
-rw-r--r--mail/emailrelay/files/patch-etc_Makefile.am28
-rw-r--r--mail/emailrelay/files/patch-src_gui_Makefile.am17
-rw-r--r--mail/emailrelay/files/patch-src_gui_installer.cpp11
-rw-r--r--mail/emailrelay/files/patch-src_main_configuration.cpp21
5 files changed, 129 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"
diff --git a/mail/emailrelay/files/patch-etc_Makefile.am b/mail/emailrelay/files/patch-etc_Makefile.am
new file mode 100644
index 000000000000..327955668fa1
--- /dev/null
+++ b/mail/emailrelay/files/patch-etc_Makefile.am
@@ -0,0 +1,28 @@
+--- etc/Makefile.am.orig 2013-12-07 22:55:55 UTC
++++ etc/Makefile.am
+@@ -30,25 +30,3 @@ emailrelay: emailrelay.pam
+ clean-local:
+ -rm -f emailrelay 2>/dev/null
+
+-if INSTALL_HOOK
+-
+-# create the .conf file from .conf.template with directory edits - dont
+-# use this when running configure for building a .deb or .rpm package
+-install-data-hook:
+- if test -f "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf" ; then : ; else cat "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf.template" | sed "s:^#spool-dir .*:spool-dir $(e_spooldir):g" | sed 's:"/var/spool/emailrelay":"'"$(e_spooldir)"'":g' | sed "s:/etc:$(e_sysconfdir):g" | sed "s:/usr/local/bin:$(e_libexecdir):g" > "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf" ; sum < "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf" | sed 's/^/# Checksum: /' >> "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf" ; fi
+-
+-# remove the .conf file if it has not been editied
+-uninstall-hook:
+- -if grep -q "Checksum: `grep -v Checksum: $(DESTDIR)$(e_sysconfdir)/emailrelay.conf | sum`" "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf" ; then rm "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf" ; fi
+-
+-else
+-
+-# if there is no .conf file then copy it from .conf.template
+-install-data-hook:
+- test -f "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf" || cp "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf.template" "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf"
+-
+-# remove the .conf file - the .conf.template has been deleted when this runs
+-uninstall-hook:
+- -rm "$(DESTDIR)$(e_sysconfdir)/emailrelay.conf"
+-
+-endif
diff --git a/mail/emailrelay/files/patch-src_gui_Makefile.am b/mail/emailrelay/files/patch-src_gui_Makefile.am
new file mode 100644
index 000000000000..0045590bcd02
--- /dev/null
+++ b/mail/emailrelay/files/patch-src_gui_Makefile.am
@@ -0,0 +1,17 @@
+--- src/gui/Makefile.am.orig 2013-12-07 22:55:52 UTC
++++ src/gui/Makefile.am
+@@ -185,10 +185,10 @@ emailrelay_start_gui_LDADD =
+
+ install-exec-hook:
+ @echo "#!/bin/sh" > "$(DESTDIR)$(sbindir)/emailrelay-gui"
+- @echo DIR_INSTALL=\"$(DESTDIR)/usr\" >> "$(DESTDIR)$(sbindir)/emailrelay-gui"
+- @echo DIR_SPOOL=\"$(DESTDIR)$(e_spooldir)\" >> "$(DESTDIR)$(sbindir)/emailrelay-gui"
+- @echo DIR_CONFIG=\"$(DESTDIR)$(e_sysconfdir)\" >> "$(DESTDIR)$(sbindir)/emailrelay-gui"
+- @echo exec $(DESTDIR)$(sbindir)/emailrelay-gui.real \"$$\@\" >> "$(DESTDIR)$(sbindir)/emailrelay-gui"
++ @echo DIR_INSTALL=\"/usr\" >> "$(DESTDIR)$(sbindir)/emailrelay-gui"
++ @echo DIR_SPOOL=\"$(e_spooldir)\" >> "$(DESTDIR)$(sbindir)/emailrelay-gui"
++ @echo DIR_CONFIG=\"$(e_sysconfdir)\" >> "$(DESTDIR)$(sbindir)/emailrelay-gui"
++ @echo exec $(sbindir)/emailrelay-gui.real \"$$\@\" >> "$(DESTDIR)$(sbindir)/emailrelay-gui"
+ @chmod +x "$(DESTDIR)$(sbindir)/emailrelay-gui"
+ -if test -d "$(BUNDLE).app" ; then cp -R "$(BUNDLE).app" "$(DESTDIR)$(sbindir)" ; fi
+
diff --git a/mail/emailrelay/files/patch-src_gui_installer.cpp b/mail/emailrelay/files/patch-src_gui_installer.cpp
new file mode 100644
index 000000000000..0c3e1509a0c2
--- /dev/null
+++ b/mail/emailrelay/files/patch-src_gui_installer.cpp
@@ -0,0 +1,11 @@
+--- src/gui/installer.cpp.orig 2013-12-07 22:55:52 UTC
++++ src/gui/installer.cpp
+@@ -1031,7 +1031,7 @@ void InstallerImp::insertActions()
+ if( !isWindows() )
+ {
+ insert( new CreateConfigFile(value("dir-config"),"emailrelay.conf",
+- value("dir-config"),"emailrelay.conf.template") ) ;
++ value("dir-config"),"emailrelay.conf.sample") ) ;
+ insert( new EditConfigFile(value("dir-config"),"emailrelay.conf",commandlineMap().second) ) ;
+ }
+ }
diff --git a/mail/emailrelay/files/patch-src_main_configuration.cpp b/mail/emailrelay/files/patch-src_main_configuration.cpp
new file mode 100644
index 000000000000..2b16cad1145d
--- /dev/null
+++ b/mail/emailrelay/files/patch-src_main_configuration.cpp
@@ -0,0 +1,21 @@
+--- src/main/configuration.cpp.orig 2013-12-07 22:55:50 UTC
++++ src/main/configuration.cpp
+@@ -86,10 +86,14 @@ G::Strings Main::Configuration::listenin
+ // the required list of addresses
+ for( G::Strings::iterator p = result.begin() ; p != result.end() ; )
+ {
+- if( protocol.empty() || protocol == G::Str::head( *p , (*p).find('=') , protocol ) )
+- *p++ = G::Str::tail( *p , (*p).find('=') , *p ) ;
+- else
+- p = result.erase( p ) ;
++ std::string::size_type pos = (*p).find('=');
++ if( pos != std::string::npos ) {
++ if( protocol.empty() || protocol == G::Str::head( *p , pos , protocol ) )
++ *p++ = G::Str::tail( *p , pos , *p ) ;
++ else
++ p = result.erase( p ) ;
++ } else
++ ++p;
+ }
+
+ return result ;