v0.9.9
This commit is contained in:
parent
a21313453c
commit
38eb15ca53
4
AUTHORS
4
AUTHORS
@ -1,9 +1,9 @@
|
||||
|
||||
AUTHORS
|
||||
=======
|
||||
Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
|
||||
|
||||
Credits
|
||||
-------
|
||||
The source in "glib/gmd5.cpp" is "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" by incorporating
|
||||
the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" which
|
||||
|
17
ChangeLog
17
ChangeLog
@ -1,11 +1,28 @@
|
||||
E-MailRelay Change Log
|
||||
======================
|
||||
|
||||
0.9.8 -> 0.9.9
|
||||
--------------
|
||||
* More flexible logging options ("--verbose" and "--debug" work better).
|
||||
* File Hierarchy Standard (FHS) option for "configure" ("--enable-fhs").
|
||||
* FHS-compatible RPMs.
|
||||
* Spool files writeable by preprocessor when server started as root.
|
||||
* Default directories in executables and scripts come from "configure".
|
||||
* The "init.d" script is renamed "emailrelay" (was "emailrelay.sh").
|
||||
* Man pages are gzippped when installed.
|
||||
* Fix for access violation under Windows NT when client disconnects.
|
||||
* Use of event log when compiled on Windows NT.
|
||||
* Fix for info-after-flush bug when using the administration interface. [rc2]
|
||||
* New "resubmit" script. [rc2]
|
||||
* Submit utility works under Windows. [rc2]
|
||||
* Improved Windows project files. [rc2]
|
||||
|
||||
0.9.7 -> 0.9.8
|
||||
--------------
|
||||
* Fix for running preprocessor ("--filter") as root.
|
||||
* Ignore bogus "AUTH=LOGIN" lines in EHLO response.
|
||||
* Submit utility improved to work with mutt.
|
||||
* Installation of submit man page.
|
||||
|
||||
0.9.6 -> 0.9.7
|
||||
--------------
|
||||
|
21
INSTALL
21
INSTALL
@ -1,16 +1,23 @@
|
||||
Introduction
|
||||
============
|
||||
What follows are generic installation instructions for doing a standard GNU
|
||||
"./configure; make; make install" installation from source under Linux, FreeBSD
|
||||
etc. The Windows installation instructions are in a separate document.
|
||||
|
||||
What follows are generic installation instructions for doing a
|
||||
standard GNU "./configure; make; make install" installation from source.
|
||||
The E-MailRelay userguide describes what you have to do after the "make
|
||||
install" (under GNU/Linux) in order to get the emailrelay daemon to start
|
||||
up at boot-time, automatically forward e-mail to your ISP when connected,
|
||||
and bounce failed mail.
|
||||
Note that a non-standard "configure" switch is available, "--enable-fhs",
|
||||
which overrides all other directory modifiers, forcing compliance with the File
|
||||
Hierarchy Standard. There are also a set of variables which can be defined on
|
||||
the "configure" command line for controlling all the installation directories
|
||||
in more detail, augmenting the standard command-line switches like "--sbindir"
|
||||
and "--libexecdir". For more information refer to the E-MailRelay reference
|
||||
document.
|
||||
|
||||
The E-MailRelay user guide describes what needs to be done after the "make
|
||||
install" in order to get the emailrelay daemon to start up at boot-time,
|
||||
automatically forward e-mail and bounce failed mail.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
|
24
Makefile.am
24
Makefile.am
@ -1,2 +1,24 @@
|
||||
EXTRA_DIST = emailrelay.spec
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
EXTRA_DIST = emailrelay.spec ChangeLog
|
||||
SUBDIRS = src bin lib doc
|
||||
e_doc_DATA = NEWS README changelog.gz
|
||||
CLEANFILES = changelog.gz
|
||||
changelog.gz: ChangeLog
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > changelog.tmp && mv changelog.tmp changelog.gz ; fi
|
||||
|
77
Makefile.in
77
Makefile.in
@ -10,6 +10,25 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
@ -61,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -68,16 +88,27 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
EXTRA_DIST = emailrelay.spec
|
||||
EXTRA_DIST = emailrelay.spec ChangeLog
|
||||
SUBDIRS = src bin lib doc
|
||||
e_doc_DATA = NEWS README changelog.gz
|
||||
CLEANFILES = changelog.gz
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DATA = $(e_doc_DATA)
|
||||
|
||||
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am Makefile.in NEWS aclocal.m4 config.h.in configure \
|
||||
configure.in install-sh missing mkinstalldirs
|
||||
Makefile.am Makefile.in NEWS acinclude.m4 aclocal.m4 config.h.in \
|
||||
configure configure.ac install-sh missing mkinstalldirs
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@ -86,19 +117,19 @@ TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
$(ACLOCAL_M4): configure.ac acinclude.m4
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@ -116,7 +147,7 @@ $(srcdir)/config.h.in: $(srcdir)/stamp-h.in
|
||||
rm -f $(srcdir)/stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
|
||||
|
||||
@ -129,6 +160,25 @@ distclean-hdr:
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
install-e_docDATA: $(e_doc_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_docdir)
|
||||
@list='$(e_doc_DATA)'; for p in $$list; do \
|
||||
if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_docdir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_docdir)/$$p; \
|
||||
else if test -f $$p; then \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(e_docdir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(e_docdir)/$$p; \
|
||||
fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-e_docDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(e_doc_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(e_docdir)/$$p; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
@ -290,25 +340,27 @@ all-recursive-am: config.h
|
||||
install-exec-am:
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data-am: install-e_docDATA
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am:
|
||||
uninstall-am: uninstall-e_docDATA
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile config.h
|
||||
all-am: Makefile $(DATA) config.h
|
||||
all-redirect: all-recursive-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_docdir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
@ -337,7 +389,8 @@ maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
install-data-recursive uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-e_docDATA install-e_docDATA install-data-recursive \
|
||||
uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
|
||||
all-recursive check-recursive installcheck-recursive info-recursive \
|
||||
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
@ -349,6 +402,8 @@ install uninstall-am uninstall all-redirect all-am all installdirs-am \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
changelog.gz: ChangeLog
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > changelog.tmp && mv changelog.tmp changelog.gz ; fi
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
36
README
36
README
@ -5,12 +5,12 @@ Abstract
|
||||
--------
|
||||
E-MailRelay is a simple SMTP store-and-forward message transfer agent (MTA).
|
||||
It runs as an SMTP server, storing e-mail in a local spool directory, and
|
||||
then forwarding the stored messages to a downstream SMTP server on request.
|
||||
then forwarding the stored messages to the next SMTP server on request.
|
||||
It can also run as a proxy server, forwarding (and optionally pre-processing)
|
||||
e-mail as soon as it is received. It does not do any message routing, other
|
||||
than to a local postmaster. Because of this functional simplicity it is
|
||||
extremely easy to configure, typically only requiring the address of the
|
||||
downstream SMTP server to be put on the command line.
|
||||
next-hop SMTP server to be put on the command line.
|
||||
|
||||
C++ source code is available for Linux, FreeBSD and Windows. Distribution is
|
||||
under the GNU General Public License.
|
||||
@ -20,7 +20,7 @@ Quick start
|
||||
E-MailRelay can be built and installed from source using the ususal
|
||||
"./configure ; make ; make install" incantation. The program runs as an SMTP
|
||||
server daemon using the "emailrelay --as-server" command, and stored mail is
|
||||
forwarded to a downstream server by running "emailrelay --as-client <isp-mail-server>:smtp".
|
||||
forwarded to the next-hop server by running "emailrelay --as-client <isp-mail-server>:smtp".
|
||||
|
||||
The "--as-server" command is typically run automatically at boot time, using
|
||||
the boot scripts under "/etc/init.d" or "/sbin/init.d", while the "--as-client"
|
||||
@ -28,7 +28,7 @@ command is normally put into pppd's "ip-up" script ("/etc/ppp/ip-up")
|
||||
in place of "sendmail -q".
|
||||
|
||||
The program can also run as a proxy server ("--as-proxy") so that e-mail
|
||||
messages are forwarded immediately to a downstream server -- usually the local
|
||||
messages are forwarded immediately to the next-hop server -- usually the local
|
||||
system's default MTA. This can be usefully combined with a mail pre-processor
|
||||
program by using the "--filter" switch.
|
||||
|
||||
@ -50,35 +50,43 @@ To test the program out without a full installation:
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
The following documentation is provided:
|
||||
The following documentation is provided in the source distribution:
|
||||
* README -- this document
|
||||
* COPYING -- the GNU General Public License
|
||||
* INSTALL -- build & install instructions (based on generic GNU text)
|
||||
* INSTALL -- build & install instructions (including the generic GNU text)
|
||||
* AUTHORS -- authors, credits and additional copyrights
|
||||
* copyright -- main copyright and GPL reference
|
||||
* doc/userguide.txt -- user guide
|
||||
* doc/reference.txt -- reference document
|
||||
* doc/developer.txt -- developer guide
|
||||
* ChangeLog -- change log for releases
|
||||
|
||||
Source code documentation can be generated by using doxygen (www.doxygen.org).
|
||||
Additional documents, including source-code documentation generated by
|
||||
doxygen (www.doxygen.org), is available in a separate package,
|
||||
"emailrelay-doc".
|
||||
|
||||
Configurations
|
||||
--------------
|
||||
The code was developed on SuSE Linux 7.1 using:
|
||||
* linux 2.4.10,
|
||||
* gcc 2.95.3,
|
||||
* glibc 2.2.4 (libc.so.6),
|
||||
* gnu make 3.79.1,
|
||||
* linux 2.4.10
|
||||
* gcc 2.95.3
|
||||
* glibc 2.2.4 (libc.so.6)
|
||||
* gnu make 3.79.1
|
||||
* autoconf 2.52
|
||||
|
||||
and ported to Windows 98 using
|
||||
and ported to Windows 98 using:
|
||||
* MSVC 6.0
|
||||
|
||||
The code has also been built successfully on:
|
||||
* Windows NT 4.0
|
||||
* Linux on Alpha hardware (Debian 2.2)
|
||||
* Linux on Sparc hardware
|
||||
* Linux on RS6000 PPC hardware
|
||||
* FreeBSD on Intel hardware
|
||||
* Solaris, using gcc, on Sparc hardware
|
||||
|
||||
(courtesy of SourceForge's compile farm).
|
||||
|
||||
Feedback
|
||||
--------
|
||||
Please feel free to email the author at
|
||||
"mailto:graeme_walker@users.sourceforge.net".
|
||||
|
||||
|
60
acinclude.m4
Normal file
60
acinclude.m4
Normal file
@ -0,0 +1,60 @@
|
||||
dnl
|
||||
dnl Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU General Public License
|
||||
dnl as published by the Free Software Foundation; either
|
||||
dnl version 2 of the License, or (at your option) any later
|
||||
dnl version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
dnl
|
||||
dnl ===
|
||||
|
||||
AC_DEFUN([ENABLE_FHS],
|
||||
[
|
||||
if test "$enable_fhs" = "yes"
|
||||
then
|
||||
FHS_COMPLIANCE
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([FHS_COMPLIANCE],
|
||||
[
|
||||
# tweaks for fhs compliance...
|
||||
#
|
||||
prefix='/usr'
|
||||
exec_prefix='/usr'
|
||||
#
|
||||
sbindir='/usr/sbin'
|
||||
libexecdir='/usr/lib'
|
||||
localstatedir='/var'
|
||||
mandir='/usr/man'
|
||||
datadir='/usr/share'
|
||||
#
|
||||
# not used by emailrelay
|
||||
#bindir=
|
||||
#sysconfdir=
|
||||
#sharedstatedir=
|
||||
#libdir=
|
||||
#includedir=
|
||||
#oldincludedir=
|
||||
#infodir=
|
||||
#
|
||||
# emailrelay-specific
|
||||
e_sbindir="$sbindir"
|
||||
e_libexecdir="$libexecdir/$PACKAGE"
|
||||
e_docdir="$datadir/doc/$PACKAGE"
|
||||
e_initdir="/etc/init.d"
|
||||
e_spooldir="$localstatedir/spool/$PACKAGE"
|
||||
e_man1dir="$datadir/man/man1"
|
||||
e_examplesdir="$datadir/doc/$PACKAGE/examples"
|
||||
])
|
||||
|
61
aclocal.m4
vendored
61
aclocal.m4
vendored
@ -10,6 +10,67 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
dnl
|
||||
dnl Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU General Public License
|
||||
dnl as published by the Free Software Foundation; either
|
||||
dnl version 2 of the License, or (at your option) any later
|
||||
dnl version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
dnl
|
||||
dnl ===
|
||||
|
||||
AC_DEFUN([ENABLE_FHS],
|
||||
[
|
||||
if test "$enable_fhs" = "yes"
|
||||
then
|
||||
FHS_COMPLIANCE
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([FHS_COMPLIANCE],
|
||||
[
|
||||
# tweaks for fhs compliance...
|
||||
#
|
||||
prefix='/usr'
|
||||
exec_prefix='/usr'
|
||||
#
|
||||
sbindir='/usr/sbin'
|
||||
libexecdir='/usr/lib'
|
||||
localstatedir='/var'
|
||||
mandir='/usr/man'
|
||||
datadir='/usr/share'
|
||||
#
|
||||
# not used by emailrelay
|
||||
#bindir=
|
||||
#sysconfdir=
|
||||
#sharedstatedir=
|
||||
#libdir=
|
||||
#includedir=
|
||||
#oldincludedir=
|
||||
#infodir=
|
||||
#
|
||||
# emailrelay-specific
|
||||
e_sbindir="$sbindir"
|
||||
e_libexecdir="$libexecdir/$PACKAGE"
|
||||
e_docdir="$datadir/doc/$PACKAGE"
|
||||
e_initdir="/etc/init.d"
|
||||
e_spooldir="$localstatedir/spool/$PACKAGE"
|
||||
e_man1dir="$datadir/man/man1"
|
||||
e_examplesdir="$datadir/doc/$PACKAGE/examples"
|
||||
])
|
||||
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
@ -1,10 +1,45 @@
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
EXTRA_DIST = emailrelay-doxygen-filter.sh_ emailrelay-test.sh_ emailrelay-soak.sh_ emailrelay.sh_ txt2html.sh_ txt2mu.sh_ mu2html.sh_ expand.sh_ emailrelay-notify.sh_ emailrelay-resubmit.sh_ emailrelay-deliver.sh_ emailrelay-process.sh_
|
||||
|
||||
noinst_SCRIPTS = emailrelay-doxygen-filter.sh emailrelay-test.sh emailrelay-soak.sh
|
||||
libexec_SCRIPTS = emailrelay.sh
|
||||
pkgdata_DATA = emailrelay-notify.sh emailrelay-deliver.sh emailrelay-process.sh
|
||||
EXTRA_DIST = emailrelay-doxygen-filter.sh_ emailrelay-test.sh_ emailrelay-soak.sh_ emailrelay.sh_ txt2html.sh_ txt2mu.sh_ mu2html.sh_ expand.sh_ emailrelay-notify.sh_ emailrelay-deliver.sh_ emailrelay-process.sh_
|
||||
CLEANFILES = $(noinst_SCRIPTS) $(libexec_SCRIPTS) $(pkgdata_DATA)
|
||||
e_init_SCRIPTS = emailrelay
|
||||
e_examples_DATA = emailrelay-process.sh emailrelay-notify.sh emailrelay-deliver.sh emailrelay-resubmit.sh
|
||||
|
||||
CLEANFILES = $(noinst_SCRIPTS) $(e_init_SCRIPTS) $(e_examples_DATA)
|
||||
|
||||
TESTS = emailrelay-test.sh
|
||||
|
||||
SUFFIXES = .sh_ .sh
|
||||
|
||||
.sh_.sh:
|
||||
cp $(srcdir)/../bin/$*.sh_ $*.sh
|
||||
cat $(srcdir)/../bin/$*.sh_ | sed "s%__SPOOL_DIR__%${e_spooldir}%g;s%__SBIN_DIR__%${e_sbindir}%g" > $*.tmp && mv $*.tmp $*.sh
|
||||
chmod ugo+x $*.sh
|
||||
|
||||
emailrelay: emailrelay.sh
|
||||
cp emailrelay.sh emailrelay
|
||||
chmod ugo+x emailrelay
|
||||
|
||||
install-data-local:
|
||||
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-notify.sh
|
||||
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-resubmit.sh
|
||||
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-deliver.sh
|
||||
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-process.sh
|
||||
|
||||
|
122
bin/Makefile.in
122
bin/Makefile.in
@ -10,6 +10,25 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
@ -61,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -68,20 +88,31 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
EXTRA_DIST = emailrelay-doxygen-filter.sh_ emailrelay-test.sh_ emailrelay-soak.sh_ emailrelay.sh_ txt2html.sh_ txt2mu.sh_ mu2html.sh_ expand.sh_ emailrelay-notify.sh_ emailrelay-resubmit.sh_ emailrelay-deliver.sh_ emailrelay-process.sh_
|
||||
|
||||
noinst_SCRIPTS = emailrelay-doxygen-filter.sh emailrelay-test.sh emailrelay-soak.sh
|
||||
libexec_SCRIPTS = emailrelay.sh
|
||||
pkgdata_DATA = emailrelay-notify.sh emailrelay-deliver.sh emailrelay-process.sh
|
||||
EXTRA_DIST = emailrelay-doxygen-filter.sh_ emailrelay-test.sh_ emailrelay-soak.sh_ emailrelay.sh_ txt2html.sh_ txt2mu.sh_ mu2html.sh_ expand.sh_ emailrelay-notify.sh_ emailrelay-deliver.sh_ emailrelay-process.sh_
|
||||
CLEANFILES = $(noinst_SCRIPTS) $(libexec_SCRIPTS) $(pkgdata_DATA)
|
||||
e_init_SCRIPTS = emailrelay
|
||||
e_examples_DATA = emailrelay-process.sh emailrelay-notify.sh emailrelay-deliver.sh emailrelay-resubmit.sh
|
||||
|
||||
CLEANFILES = $(noinst_SCRIPTS) $(e_init_SCRIPTS) $(e_examples_DATA)
|
||||
|
||||
TESTS = emailrelay-test.sh
|
||||
|
||||
SUFFIXES = .sh_ .sh
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SCRIPTS = $(libexec_SCRIPTS) $(noinst_SCRIPTS)
|
||||
SCRIPTS = $(e_init_SCRIPTS) $(noinst_SCRIPTS)
|
||||
|
||||
DATA = $(pkgdata_DATA)
|
||||
DATA = $(e_examples_DATA)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
@ -93,7 +124,7 @@ GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .sh .sh_
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps bin/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@ -101,42 +132,42 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
install-libexecSCRIPTS: $(libexec_SCRIPTS)
|
||||
install-e_initSCRIPTS: $(e_init_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libexecdir)
|
||||
@list='$(libexec_SCRIPTS)'; for p in $$list; do \
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_initdir)
|
||||
@list='$(e_init_SCRIPTS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $$p $(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
|
||||
echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(e_initdir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $$p $(DESTDIR)$(e_initdir)/`echo $$p|sed '$(transform)'`; \
|
||||
else if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
|
||||
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(e_initdir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(e_initdir)/`echo $$p|sed '$(transform)'`; \
|
||||
else :; fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-libexecSCRIPTS:
|
||||
uninstall-e_initSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(libexec_SCRIPTS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
|
||||
list='$(e_init_SCRIPTS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(e_initdir)/`echo $$p|sed '$(transform)'`; \
|
||||
done
|
||||
|
||||
install-pkgdataDATA: $(pkgdata_DATA)
|
||||
install-e_examplesDATA: $(e_examples_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
|
||||
@list='$(pkgdata_DATA)'; for p in $$list; do \
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_examplesdir)
|
||||
@list='$(e_examples_DATA)'; for p in $$list; do \
|
||||
if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_examplesdir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_examplesdir)/$$p; \
|
||||
else if test -f $$p; then \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(e_examplesdir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(e_examplesdir)/$$p; \
|
||||
fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-pkgdataDATA:
|
||||
uninstall-e_examplesDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(pkgdata_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/$$p; \
|
||||
list='$(e_examples_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(e_examplesdir)/$$p; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
@ -191,23 +222,24 @@ check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am: install-libexecSCRIPTS
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-pkgdataDATA
|
||||
install-data-am: install-e_initSCRIPTS install-e_examplesDATA \
|
||||
install-data-local
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-libexecSCRIPTS uninstall-pkgdataDATA
|
||||
uninstall-am: uninstall-e_initSCRIPTS uninstall-e_examplesDATA
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(SCRIPTS) $(DATA)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkgdatadir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_initdir) $(DESTDIR)$(e_examplesdir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
@ -238,18 +270,30 @@ maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: uninstall-libexecSCRIPTS install-libexecSCRIPTS \
|
||||
uninstall-pkgdataDATA install-pkgdataDATA tags distdir check-TESTS \
|
||||
info-am info dvi-am dvi check check-am installcheck-am installcheck \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-am uninstall all-redirect all-am all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
.PHONY: uninstall-e_initSCRIPTS install-e_initSCRIPTS \
|
||||
uninstall-e_examplesDATA install-e_examplesDATA tags distdir \
|
||||
check-TESTS info-am info dvi-am dvi check check-am installcheck-am \
|
||||
installcheck install-exec-am install-exec install-data-local \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
.sh_.sh:
|
||||
cp $(srcdir)/../bin/$*.sh_ $*.sh
|
||||
cat $(srcdir)/../bin/$*.sh_ | sed "s%__SPOOL_DIR__%${e_spooldir}%g;s%__SBIN_DIR__%${e_sbindir}%g" > $*.tmp && mv $*.tmp $*.sh
|
||||
chmod ugo+x $*.sh
|
||||
|
||||
emailrelay: emailrelay.sh
|
||||
cp emailrelay.sh emailrelay
|
||||
chmod ugo+x emailrelay
|
||||
|
||||
install-data-local:
|
||||
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-notify.sh
|
||||
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-resubmit.sh
|
||||
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-deliver.sh
|
||||
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-process.sh
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
@ -21,20 +21,15 @@
|
||||
#
|
||||
# emailrelay-deliver.sh
|
||||
#
|
||||
# An example script which looks for local mail in the E-MailRelay
|
||||
# spool directory, and delivers it using 'procmail'.
|
||||
# Looks for local mail in the E-MailRelay spool directory, and delivers
|
||||
# it using 'procmail'. Note that the only local mail should be for the local
|
||||
# postmaster, since E-MailRelay will not accept mail for any other
|
||||
# local recipient.
|
||||
#
|
||||
# usage: emailrelay-deliver.sh [<spool-dir>]
|
||||
#
|
||||
# Note that (1) E-MailRelay will only accept mail to a local recipient
|
||||
# if that recipient is "postmaster", and the (2) by default E-MailRelay
|
||||
# will only accept connections from local e-mail clients. This means that
|
||||
# this script is only relevant if you are in the habit of sending
|
||||
# yourself mail as "postmaster". It is provided for completeness,
|
||||
# in response to certain requirements in the SMTP specification.
|
||||
#
|
||||
|
||||
store="/usr/local/var/spool/emailrelay"
|
||||
store="__SPOOL_DIR__/emailrelay"
|
||||
postmaster="root"
|
||||
procmail="procmail"
|
||||
|
||||
@ -61,7 +56,7 @@ do
|
||||
then
|
||||
content="`echo ${file} | sed 's/envelope/content/'`"
|
||||
|
||||
deliver_to="`fgrep X-MailRelay-LocalTo ${file} | sed 's/X-MailRelay-LocalTo: //' | tr -d '\015' | sed \"s/postmaster/${postmaster}/g\"`"
|
||||
deliver_to="`fgrep X-MailRelay-To-Local ${file} | sed 's/X-MailRelay-To-Local: //' | tr -d '\015' | sed \"s/postmaster/${postmaster}/g\"`"
|
||||
if test "${deliver_to}" = ""
|
||||
then
|
||||
deliver_to="${postmaster}"
|
||||
|
@ -21,8 +21,8 @@
|
||||
#
|
||||
# emailrelay-notify.sh
|
||||
#
|
||||
# An example script which looks for failed mail in the E-MailRelay spool
|
||||
# directory, and sends failure notification messages using 'procmail'.
|
||||
# Looks for failed mail in the E-MailRelay spool directory, and sends failure
|
||||
# notification messages using 'procmail'.
|
||||
#
|
||||
# usage: emailrelay-notify.sh [<spool-dir>]
|
||||
#
|
||||
@ -31,11 +31,11 @@
|
||||
# approach might be more appropriate -- for example, a line like this in
|
||||
# a ".profile" script:
|
||||
#
|
||||
# if test -f /usr/local/var/spool/emailrelay/*.envelope.bad ; then echo Failed mail >&2 ; fi
|
||||
# if test -f /var/spool/emailrelay/*.envelope.bad ; then echo Failed mail >&2 ; fi
|
||||
#
|
||||
# or perhaps a cron entry like this (since output from a cron job gets sent as mail):
|
||||
#
|
||||
# 0 0 * * * /bin/cat /usr/local/var/spool/emailrelay/*.envelope.bad 2>/dev/null
|
||||
# 0 0 * * * /bin/cat /var/spool/emailrelay/*.envelope.bad 2>/dev/null
|
||||
#
|
||||
|
||||
tmp="/tmp/`basename $0`.$$.tmp"
|
||||
@ -44,7 +44,7 @@ procmail="procmail"
|
||||
|
||||
# parse the command line
|
||||
#
|
||||
store="/usr/local/var/spool/emailrelay"
|
||||
store="__SPOOL_DIR__/emailrelay"
|
||||
if test $# -ge 1
|
||||
then
|
||||
store="${1}"
|
||||
@ -72,7 +72,7 @@ do
|
||||
deliver_to="${from}"
|
||||
if test "${deliver_to}" = ""
|
||||
then
|
||||
deliver_to="postmaster"
|
||||
deliver_to="root"
|
||||
fi
|
||||
|
||||
# create a notification message header
|
||||
|
@ -22,7 +22,9 @@
|
||||
# emailrelay-process.sh
|
||||
#
|
||||
# An example pre-processing script for the E-MailRelay
|
||||
# system which does rot-13 masking.
|
||||
# SMTP server which does rot-13 masking. (The pre-processor
|
||||
# is specified using the "--filter" switch on the emailrelay
|
||||
# command line.)
|
||||
#
|
||||
|
||||
awk="awk"
|
||||
|
63
bin/emailrelay-resubmit.sh_
Normal file
63
bin/emailrelay-resubmit.sh_
Normal file
@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
#
|
||||
# emailrelay-resubmit.sh
|
||||
#
|
||||
# Looks for all failed e-mails in the E-MailRelay spool directory
|
||||
# and resubmits them. However, if an e-mail has been retried five
|
||||
# times already then it is not resubmitted again.
|
||||
#
|
||||
# usage: emailrelay-resubmit.sh [<spool-dir>]
|
||||
#
|
||||
|
||||
store="__SPOOL_DIR__/emailrelay"
|
||||
retry_limit="5"
|
||||
|
||||
# parse the command line
|
||||
#
|
||||
if test $# -ge 1
|
||||
then
|
||||
store="${1}"
|
||||
fi
|
||||
|
||||
# check the spool directory is valid
|
||||
#
|
||||
if test \! -d "${store}"
|
||||
then
|
||||
echo `basename $0`: invalid spool directory >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# for each failed e-mail...
|
||||
#
|
||||
for file in ${store}/emailrelay.*.envelope.bad ""
|
||||
do
|
||||
if test -f "${file}"
|
||||
then
|
||||
failures="`fgrep MailRelay-Reason: < ${file} | wc -l`"
|
||||
if test "${failures}" -lt "${retry_limit}"
|
||||
then
|
||||
good_file="`echo ${file} | sed 's/\.bad$//'`"
|
||||
mv -f ${file} ${good_file}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@ -19,18 +19,18 @@
|
||||
#
|
||||
# ===
|
||||
#
|
||||
# emailrelay.sh
|
||||
# emailrelay
|
||||
#
|
||||
# A shell-script wrapper for E-MailRelay designed for
|
||||
# use in the SysV-init system (/etc/init.d).
|
||||
#
|
||||
# usage: emailrelay.sh { start [<emailrelay-switches>] | stop }
|
||||
# usage: emailrelay { start [<emailrelay-switches>] | stop }
|
||||
#
|
||||
|
||||
# configuration
|
||||
#
|
||||
var_run="/var/run"
|
||||
emailrelay="/usr/local/sbin/emailrelay"
|
||||
emailrelay="__SBIN_DIR__/emailrelay"
|
||||
switches=""
|
||||
|
||||
# configuration fallback
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* config.h.in. Generated automatically from configure.ac by autoheader. */
|
||||
|
||||
/* Define if you have the <dirent.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
48
configure.in → configure.ac
Normal file → Executable file
48
configure.in → configure.ac
Normal file → Executable file
@ -18,28 +18,10 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
dnl
|
||||
dnl ===
|
||||
dnl
|
||||
dnl Copyright (C) 2001 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU General Public License
|
||||
dnl as published by the Free Software Foundation; either
|
||||
dnl version 2 of the License, or (at your option) any later
|
||||
dnl version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
dnl
|
||||
dnl ===
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(src/main/gsmtp.h)
|
||||
AM_INIT_AUTOMAKE(emailrelay,0.9.8)
|
||||
AM_INIT_AUTOMAKE(emailrelay,0.9.9)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl ===
|
||||
@ -52,6 +34,7 @@ AC_PROG_INSTALL
|
||||
AC_PROG_AWK
|
||||
AC_CHECK_PROGS(MAKE,make gmake)
|
||||
AC_CHECK_PROGS(AR,ar gar)
|
||||
AC_CHECK_PROGS(GZIP,gzip)
|
||||
AC_CHECK_PROG(HAVE_DOXYGEN,doxygen,yes)
|
||||
AC_CHECK_PROG(HAVE_MAN2HTML,man2html,yes)
|
||||
|
||||
@ -75,8 +58,31 @@ AC_LANG_CPLUSPLUS
|
||||
dnl check for *_r() declarations -- using ac_check_funcs
|
||||
dnl is no good here since they may be in the library but
|
||||
dnl not the header (depending on preprocessor switches)
|
||||
AC_EGREP_HEADER(localtime_r,time.h,AC_DEFINE(HAVE_LOCALTIME_R,1,have reentrant localtime))
|
||||
AC_EGREP_HEADER(gmtime_r,time.h,AC_DEFINE(HAVE_GMTIME_R,1,have reentrant gmtime))
|
||||
AC_EGREP_HEADER(localtime_r,time.h,[AC_DEFINE(HAVE_LOCALTIME_R,1,[have reentrant localtime])])
|
||||
AC_EGREP_HEADER(gmtime_r,time.h,[AC_DEFINE(HAVE_GMTIME_R,1,[have reentrant gmtime])])
|
||||
|
||||
dnl ===
|
||||
dnl directory tweaking...
|
||||
dnl
|
||||
dnl not AC_PREFIX_DEFAULT([/usr])
|
||||
AC_ARG_ENABLE(fhs,AC_HELP_STRING([--enable-fhs],[force FHS-compliant directories, ignoring --prefix etc]))
|
||||
AC_SUBST(e_sbindir)
|
||||
if test "$e_sbindir" = "" ; then e_sbindir="$sbindir" ; fi
|
||||
AC_SUBST(e_libexecdir)
|
||||
if test "$e_libexecdir" = "" ; then e_libexecdir="$libexecdir" ; fi
|
||||
AC_SUBST(e_docdir)
|
||||
if test "$e_docdir" = "" ; then e_docdir="$datadir/$PACKAGE/doc" ; fi
|
||||
AC_SUBST(e_initdir)
|
||||
if test "$e_initdir" = "" ; then e_initdir="$libexecdir" ; fi
|
||||
AC_SUBST(e_spooldir)
|
||||
if test "$e_spooldir" = "" ; then e_spooldir="$localstatedir/spool/emailrelay" ; fi
|
||||
AC_SUBST(e_man1dir)
|
||||
if test "$e_man1dir" = "" ; then e_man1dir="$mandir/man1" ; fi
|
||||
AC_SUBST(e_examplesdir)
|
||||
if test "$e_examplesdir" = "" ; then e_examplesdir="$libexecdir" ; fi
|
||||
ENABLE_FHS
|
||||
|
||||
dnl ===
|
||||
dnl attempt to fix recursive makes where make is gmake -- may break something else
|
||||
SET_MAKE=""
|
||||
|
76
doc/Makefile.am
Executable file → Normal file
76
doc/Makefile.am
Executable file → Normal file
@ -1,12 +1,38 @@
|
||||
EXTRA_DIST = developer.txt reference.txt userguide.txt windows.txt index.html emailrelay.1 emailrelay-passwd.1 emailrelay-poke.1 emailrelay-submit.1 doxygen_header.html graphics/bullet.gif emailrelay.css
|
||||
|
||||
noinst_SCRIPTS = .dox
|
||||
pkgdata_DATA = readme.html developer.html reference.html userguide.html man.html index.html windows.html changelog.html
|
||||
CLEANFILES = $(noinst_SCRIPTS) html *.ht readme.html developer.html reference.html userguide.html man.html
|
||||
|
||||
SUFFIXES = .txt .html .ht
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
stylesheet=emailrelay.css
|
||||
txt_files=developer.txt reference.txt userguide.txt windows.txt
|
||||
man_files_in=emailrelay.1 emailrelay-passwd.1 emailrelay-poke.1 emailrelay-submit.1
|
||||
man_files_out=emailrelay.1.gz emailrelay-passwd.1.gz emailrelay-poke.1.gz emailrelay-submit.1.gz
|
||||
html_files_in=doxygen_header.html
|
||||
html_files_thru=index.html $(stylesheet)
|
||||
html_files_out=readme.html developer.html reference.html userguide.html windows.html emailrelay-man.html changelog.html
|
||||
|
||||
EXTRA_DIST = $(man_files_in) $(txt_files) $(html_files_in) $(html_files_thru)
|
||||
noinst_SCRIPTS = .dox
|
||||
e_man1_DATA = $(man_files_out)
|
||||
e_doc_DATA = $(txt_files) $(html_files_out) $(html_files_thru)
|
||||
CLEANFILES = $(noinst_SCRIPTS) $(man_files_out) $(html_files_out) doxygen/*
|
||||
|
||||
SUFFIXES = .txt .html
|
||||
|
||||
filter=$(top_builddir)/bin/emailrelay-doxygen-filter.sh
|
||||
filter_src=$(top_srcdir)/bin/emailrelay-doxygen-filter.sh_
|
||||
converter=$(top_builddir)/bin/txt2html.sh
|
||||
@ -21,9 +47,6 @@ converter_helper3_src=$(top_srcdir)/bin/expand.sh_
|
||||
.txt.html:
|
||||
$(converter) -a "$(AWK)" $< $(stylesheet) > $*.html
|
||||
|
||||
.txt.ht:
|
||||
$(converter) -a "$(AWK)" -x $< $(stylesheet) > $*.ht
|
||||
|
||||
$(filter): $(filter_src)
|
||||
cp $(filter_src) $(filter)
|
||||
chmod ugo+x $(filter)
|
||||
@ -47,8 +70,8 @@ $(converter_helper3): $(converter_helper3_src)
|
||||
.dox: $(filter)
|
||||
if test "$(HAVE_DOXYGEN)" = "yes" ; then cat $(top_srcdir)/src/main/doxygen.cfg | sed "s:__TOP_SRC__:$(top_srcdir):g" | sed "s:__TOP_BUILD__:$(top_builddir):g" | doxygen - && touch .dox ; else echo no doxygen ; fi
|
||||
|
||||
man.html: emailrelay.1
|
||||
if test "$(HAVE_MAN2HTML)" = "yes" ; then man2html emailrelay.1 > man.html ; else echo no man2html ; fi
|
||||
emailrelay-man.html: emailrelay.1
|
||||
if test "$(HAVE_MAN2HTML)" = "yes" ; then man2html $< > emailrelay-man.html ; fi
|
||||
|
||||
developer.html reference.html userguide.html: $(converter)
|
||||
|
||||
@ -58,21 +81,22 @@ readme.html: $(top_srcdir)/README $(converter)
|
||||
changelog.html: $(top_srcdir)/ChangeLog $(converter)
|
||||
$(converter) -a "$(AWK)" $(top_srcdir)/ChangeLog $(stylesheet) > changelog.html
|
||||
|
||||
emailrelay.1.gz : emailrelay.1
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > emailrelay.1.gz ; fi
|
||||
|
||||
emailrelay-passwd.1.gz : emailrelay-passwd.1
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > emailrelay-passwd.1.gz ; fi
|
||||
|
||||
emailrelay-submit.1.gz : emailrelay-submit.1
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > emailrelay-submit.1.gz ; fi
|
||||
|
||||
emailrelay-poke.1.gz: emailrelay-poke.1
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > emailrelay-poke.1.gz ; fi
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(destdir)$(mandir)/man1
|
||||
$(INSTALL) $(top_srcdir)/doc/emailrelay.1 $(destdir)$(mandir)/man1/emailrelay.1
|
||||
$(INSTALL) $(top_srcdir)/doc/emailrelay-passwd.1 $(destdir)$(mandir)/man1/emailrelay-passwd.1
|
||||
$(INSTALL) $(top_srcdir)/doc/emailrelay-poke.1 $(destdir)$(mandir)/man1/emailrelay-poke.1
|
||||
$(INSTALL) $(top_srcdir)/doc/emailrelay-submit.1 $(destdir)$(mandir)/man1/emailrelay-submit.1
|
||||
$(mkinstalldirs) $(destdir)$(pkgdatadir)/graphics
|
||||
$(INSTALL) $(top_srcdir)/doc/graphics/bullet.gif $(destdir)$(pkgdatadir)/graphics/bullet.gif
|
||||
$(mkinstalldirs) $(destdir)$(pkgdatadir)/html
|
||||
if test "$(HAVE_DOXYGEN)" = "yes" ; then for file in html/* ; do $(INSTALL) $$file $(destdir)$(pkgdatadir)/$$file ; done ; fi
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_docdir)/doxygen
|
||||
if test "$(HAVE_DOXYGEN)" = "yes" ; then for file in doxygen/* ; do $(INSTALL) $$file $(DESTDIR)$(e_docdir)/$$file ; done ; fi
|
||||
|
||||
uninstall-local:
|
||||
-rm -f $(destdir)$(pkgdatadir)/graphics/bullet.gif
|
||||
-rm -f $(destdir)$(pkgdatadir)/html/* 2>/dev/null
|
||||
-rm -f $(destdir)$(mandir)/man1/emailrelay.1
|
||||
-rm -f $(destdir)$(mandir)/man1/emailrelay-passwd.1
|
||||
-rm -f $(destdir)$(mandir)/man1/emailrelay-poke.1
|
||||
-rm -f $(DESTDIR)$(e_docdir)/html/* 2>/dev/null
|
||||
|
||||
|
152
doc/Makefile.in
152
doc/Makefile.in
@ -10,6 +10,25 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
@ -61,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -68,16 +88,30 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
EXTRA_DIST = developer.txt reference.txt userguide.txt windows.txt index.html emailrelay.1 emailrelay-passwd.1 emailrelay-poke.1 emailrelay-submit.1 doxygen_header.html graphics/bullet.gif emailrelay.css
|
||||
|
||||
noinst_SCRIPTS = .dox
|
||||
pkgdata_DATA = readme.html developer.html reference.html userguide.html man.html index.html windows.html changelog.html
|
||||
CLEANFILES = $(noinst_SCRIPTS) html *.ht readme.html developer.html reference.html userguide.html man.html
|
||||
|
||||
SUFFIXES = .txt .html .ht
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
stylesheet = emailrelay.css
|
||||
txt_files = developer.txt reference.txt userguide.txt windows.txt
|
||||
man_files_in = emailrelay.1 emailrelay-passwd.1 emailrelay-poke.1 emailrelay-submit.1
|
||||
man_files_out = emailrelay.1.gz emailrelay-passwd.1.gz emailrelay-poke.1.gz emailrelay-submit.1.gz
|
||||
html_files_in = doxygen_header.html
|
||||
html_files_thru = index.html $(stylesheet)
|
||||
html_files_out = readme.html developer.html reference.html userguide.html windows.html emailrelay-man.html changelog.html
|
||||
|
||||
EXTRA_DIST = $(man_files_in) $(txt_files) $(html_files_in) $(html_files_thru)
|
||||
noinst_SCRIPTS = .dox
|
||||
e_man1_DATA = $(man_files_out)
|
||||
e_doc_DATA = $(txt_files) $(html_files_out) $(html_files_thru)
|
||||
CLEANFILES = $(noinst_SCRIPTS) $(man_files_out) $(html_files_out) doxygen/*
|
||||
|
||||
SUFFIXES = .txt .html
|
||||
|
||||
filter = $(top_builddir)/bin/emailrelay-doxygen-filter.sh
|
||||
filter_src = $(top_srcdir)/bin/emailrelay-doxygen-filter.sh_
|
||||
converter = $(top_builddir)/bin/txt2html.sh
|
||||
@ -97,7 +131,7 @@ CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DATA = $(pkgdata_DATA)
|
||||
DATA = $(e_doc_DATA) $(e_man1_DATA)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
@ -108,8 +142,8 @@ TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .ht .html .txt
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
.SUFFIXES: .html .txt
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@ -117,23 +151,42 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
install-pkgdataDATA: $(pkgdata_DATA)
|
||||
install-e_docDATA: $(e_doc_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
|
||||
@list='$(pkgdata_DATA)'; for p in $$list; do \
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_docdir)
|
||||
@list='$(e_doc_DATA)'; for p in $$list; do \
|
||||
if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_docdir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_docdir)/$$p; \
|
||||
else if test -f $$p; then \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(e_docdir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(e_docdir)/$$p; \
|
||||
fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-pkgdataDATA:
|
||||
uninstall-e_docDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(pkgdata_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/$$p; \
|
||||
list='$(e_doc_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(e_docdir)/$$p; \
|
||||
done
|
||||
|
||||
install-e_man1DATA: $(e_man1_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_man1dir)
|
||||
@list='$(e_man1_DATA)'; for p in $$list; do \
|
||||
if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_man1dir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_man1dir)/$$p; \
|
||||
else if test -f $$p; then \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(e_man1dir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(e_man1dir)/$$p; \
|
||||
fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-e_man1DATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(e_man1_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(e_man1dir)/$$p; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
@ -144,7 +197,6 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
subdir = doc
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(mkinstalldirs) $(distdir)/graphics
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
@ -166,20 +218,20 @@ installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-pkgdataDATA install-data-local
|
||||
install-data-am: install-e_docDATA install-e_man1DATA install-data-local
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-pkgdataDATA uninstall-local
|
||||
uninstall-am: uninstall-e_docDATA uninstall-e_man1DATA uninstall-local
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(SCRIPTS) $(DATA)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_docdir) $(DESTDIR)$(e_man1dir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
@ -210,21 +262,18 @@ maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: uninstall-pkgdataDATA install-pkgdataDATA tags distdir info-am \
|
||||
info dvi-am dvi check check-am installcheck-am installcheck \
|
||||
install-exec-am install-exec install-data-local install-data-am \
|
||||
install-data install-am install uninstall-local uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
.PHONY: uninstall-e_docDATA install-e_docDATA uninstall-e_man1DATA \
|
||||
install-e_man1DATA tags distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-local install-data-am install-data install-am install \
|
||||
uninstall-local uninstall-am uninstall all-redirect all-am all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
.txt.html:
|
||||
$(converter) -a "$(AWK)" $< $(stylesheet) > $*.html
|
||||
|
||||
.txt.ht:
|
||||
$(converter) -a "$(AWK)" -x $< $(stylesheet) > $*.ht
|
||||
|
||||
$(filter): $(filter_src)
|
||||
cp $(filter_src) $(filter)
|
||||
chmod ugo+x $(filter)
|
||||
@ -248,8 +297,8 @@ $(converter_helper3): $(converter_helper3_src)
|
||||
.dox: $(filter)
|
||||
if test "$(HAVE_DOXYGEN)" = "yes" ; then cat $(top_srcdir)/src/main/doxygen.cfg | sed "s:__TOP_SRC__:$(top_srcdir):g" | sed "s:__TOP_BUILD__:$(top_builddir):g" | doxygen - && touch .dox ; else echo no doxygen ; fi
|
||||
|
||||
man.html: emailrelay.1
|
||||
if test "$(HAVE_MAN2HTML)" = "yes" ; then man2html emailrelay.1 > man.html ; else echo no man2html ; fi
|
||||
emailrelay-man.html: emailrelay.1
|
||||
if test "$(HAVE_MAN2HTML)" = "yes" ; then man2html $< > emailrelay-man.html ; fi
|
||||
|
||||
developer.html reference.html userguide.html: $(converter)
|
||||
|
||||
@ -259,23 +308,24 @@ readme.html: $(top_srcdir)/README $(converter)
|
||||
changelog.html: $(top_srcdir)/ChangeLog $(converter)
|
||||
$(converter) -a "$(AWK)" $(top_srcdir)/ChangeLog $(stylesheet) > changelog.html
|
||||
|
||||
emailrelay.1.gz : emailrelay.1
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > emailrelay.1.gz ; fi
|
||||
|
||||
emailrelay-passwd.1.gz : emailrelay-passwd.1
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > emailrelay-passwd.1.gz ; fi
|
||||
|
||||
emailrelay-submit.1.gz : emailrelay-submit.1
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > emailrelay-submit.1.gz ; fi
|
||||
|
||||
emailrelay-poke.1.gz: emailrelay-poke.1
|
||||
if test -n "$(GZIP)" ; then $(GZIP) -c $< > emailrelay-poke.1.gz ; fi
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(destdir)$(mandir)/man1
|
||||
$(INSTALL) $(top_srcdir)/doc/emailrelay.1 $(destdir)$(mandir)/man1/emailrelay.1
|
||||
$(INSTALL) $(top_srcdir)/doc/emailrelay-passwd.1 $(destdir)$(mandir)/man1/emailrelay-passwd.1
|
||||
$(INSTALL) $(top_srcdir)/doc/emailrelay-poke.1 $(destdir)$(mandir)/man1/emailrelay-poke.1
|
||||
$(INSTALL) $(top_srcdir)/doc/emailrelay-submit.1 $(destdir)$(mandir)/man1/emailrelay-submit.1
|
||||
$(mkinstalldirs) $(destdir)$(pkgdatadir)/graphics
|
||||
$(INSTALL) $(top_srcdir)/doc/graphics/bullet.gif $(destdir)$(pkgdatadir)/graphics/bullet.gif
|
||||
$(mkinstalldirs) $(destdir)$(pkgdatadir)/html
|
||||
if test "$(HAVE_DOXYGEN)" = "yes" ; then for file in html/* ; do $(INSTALL) $$file $(destdir)$(pkgdatadir)/$$file ; done ; fi
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_docdir)/doxygen
|
||||
if test "$(HAVE_DOXYGEN)" = "yes" ; then for file in doxygen/* ; do $(INSTALL) $$file $(DESTDIR)$(e_docdir)/$$file ; done ; fi
|
||||
|
||||
uninstall-local:
|
||||
-rm -f $(destdir)$(pkgdatadir)/graphics/bullet.gif
|
||||
-rm -f $(destdir)$(pkgdatadir)/html/* 2>/dev/null
|
||||
-rm -f $(destdir)$(mandir)/man1/emailrelay.1
|
||||
-rm -f $(destdir)$(mandir)/man1/emailrelay-passwd.1
|
||||
-rm -f $(destdir)$(mandir)/man1/emailrelay-poke.1
|
||||
-rm -f $(DESTDIR)$(e_docdir)/html/* 2>/dev/null
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
@ -30,7 +30,9 @@ line in an
|
||||
.B emailrelay
|
||||
secrets file.
|
||||
.SH SEE ALSO
|
||||
.BR emailrelay (1)
|
||||
.BR emailrelay (1),
|
||||
.BR emailrelay-submit (1),
|
||||
.BR emailrelay-poke (1)
|
||||
.br
|
||||
.B RFC2104
|
||||
.br
|
||||
|
@ -24,12 +24,14 @@ emailrelay-poke \- forces an E-MailRelay server to deliver spooled mail
|
||||
[ admin-port [ admin-command ] ]
|
||||
.SH DESCRIPTION
|
||||
.I emailrelay-poke
|
||||
is a small utility which connects to the
|
||||
is a lightweight utility which connects to the
|
||||
.I emailrelay
|
||||
administration interface and executes the
|
||||
.B flush
|
||||
command.
|
||||
.SH SEE ALSO
|
||||
.BR emailrelay (1)
|
||||
.BR emailrelay (1),
|
||||
.BR emailrelay-submit (1),
|
||||
.BR emailrelay-passwd (1)
|
||||
.SH AUTHOR
|
||||
Graeme Walker, mailto:graeme_walker@users.sourceforge.net
|
||||
|
@ -21,7 +21,9 @@
|
||||
emailrelay-submit \- a submission utility for E-MailRelay
|
||||
.SH SYNOPSIS
|
||||
.B emailrelay-submit
|
||||
[--help] [--from
|
||||
[--help] [--spool-dir
|
||||
.IR spool-directory ]
|
||||
[--from
|
||||
.IR from-address ]
|
||||
.I to-address
|
||||
.RI [ to-address \ ...]
|
||||
@ -33,6 +35,8 @@ command-line, and writes it into the
|
||||
.B E-MailRelay
|
||||
spool directory.
|
||||
.SH SEE ALSO
|
||||
.BR emailrelay (1)
|
||||
.BR emailrelay (1),
|
||||
.BR emailrelay-poke (1),
|
||||
.BR emailrelay-passwd (1)
|
||||
.SH AUTHOR
|
||||
Graeme Walker, mailto:graeme_walker@users.sourceforge.net
|
||||
|
152
doc/emailrelay.1
152
doc/emailrelay.1
@ -36,7 +36,7 @@ emailrelay \- e-mail transfer agent
|
||||
.SH DESCRIPTION
|
||||
.I emailrelay
|
||||
is an simple e-mail message transfer agent. It does store-and-forward
|
||||
mail relay to a fixed downstream server, without any routing.
|
||||
mail relay to a fixed next-hop server, without any routing.
|
||||
.LP
|
||||
It runs in two main modes: a storage deamon
|
||||
.RI ( --as-server )
|
||||
@ -45,12 +45,12 @@ agent
|
||||
.RI ( --as-client ).
|
||||
The storage daemon is an SMTP server which stores e-mail
|
||||
messages in a local spool directory. The forwarding agent acts as an
|
||||
SMTP client, which passes the spooled e-mail messages on to a downstrema
|
||||
SMTP server.
|
||||
SMTP client, which passes the spooled e-mail messages on to the next
|
||||
SMTP server in the chain.
|
||||
.LP
|
||||
It can also run in a third mode, as a proxy server
|
||||
.RI ( --as-proxy ).
|
||||
In this mode all messages are forwarded immediately to the downstream
|
||||
In this mode all messages are forwarded immediately to the next-hop
|
||||
server.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
@ -135,35 +135,137 @@ Generates more verbose logging (if compiled-in and logging enabled and stderr op
|
||||
.B \-V,--version
|
||||
Displays version information and exits.
|
||||
.SH FILES
|
||||
.IP \(bu 2
|
||||
/usr/local/sbin/emailrelay
|
||||
.IP \(bu 2
|
||||
GNU style...
|
||||
.br
|
||||
/usr/local/libexec/emailrelay-passwd
|
||||
.br
|
||||
/usr/local/libexec/emailrelay-poke
|
||||
.IP \(bu 2
|
||||
/usr/local/libexec/emailrelay.sh
|
||||
.IP \(bu 2
|
||||
/usr/local/share/emailrelay/*.html
|
||||
.IP \(bu 2
|
||||
/usr/local/share/emailrelay/html/*.html
|
||||
.IP \(bu 2
|
||||
/usr/local/share/emailrelay/emailrelay-notify.sh
|
||||
.IP \(bu 2
|
||||
/usr/local/share/emailrelay/emailrelay-deliver.sh
|
||||
.IP \(bu 2
|
||||
/usr/local/share/emailrelay/emailrelay-filter.sh
|
||||
.IP \(bu 2
|
||||
/usr/local/man/man1/emailrelay.1
|
||||
.IP \(bu 2
|
||||
/usr/local/man/man1/emailrelay-poke.1
|
||||
.IP \(bu 2
|
||||
.br
|
||||
/usr/local/libexec/emailrelay
|
||||
.br
|
||||
/usr/local/libexec/emailrelay-notify.sh
|
||||
.br
|
||||
/usr/local/libexec/emailrelay-deliver.sh
|
||||
.br
|
||||
/usr/local/libexec/emailrelay-process.sh
|
||||
.br
|
||||
/usr/local/sbin/emailrelay-submit
|
||||
.br
|
||||
/usr/local/sbin/emailrelay
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/developer.txt
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/reference.txt
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/userguide.txt
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/windows.txt
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/readme.html
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/developer.html
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/reference.html
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/userguide.html
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/windows.html
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/emailrelay-man.html
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/index.html
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/changelog.html
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/emailrelay.css
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/NEWS
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/README
|
||||
.br
|
||||
/usr/local/share/emailrelay/doc/changelog.gz
|
||||
.br
|
||||
/usr/local/man/man1/emailrelay.1.gz
|
||||
.br
|
||||
/usr/local/man/man1/emailrelay-passwd.1.gz
|
||||
.br
|
||||
/usr/local/man/man1/emailrelay-poke.1.gz
|
||||
.br
|
||||
/usr/local/man/man1/emailrelay-submit.1.gz
|
||||
.br
|
||||
/usr/local/var/spool/emailrelay/emailrelay.*.envelope
|
||||
.IP \(bu 2
|
||||
.br
|
||||
/usr/local/var/spool/emailrelay/emailrelay.*.content
|
||||
.LP
|
||||
FHS style...
|
||||
.br
|
||||
/usr/lib/emailrelay-passwd
|
||||
.br
|
||||
/usr/lib/emailrelay-poke
|
||||
.br
|
||||
/usr/sbin/emailrelay-submit
|
||||
.br
|
||||
/usr/sbin/emailrelay
|
||||
.br
|
||||
/usr/share/doc/emailrelay/examples/emailrelay-notify.sh
|
||||
.br
|
||||
/usr/share/doc/emailrelay/examples/emailrelay-deliver.sh
|
||||
.br
|
||||
/usr/share/doc/emailrelay/examples/emailrelay-process.sh
|
||||
.br
|
||||
/usr/share/doc/emailrelay/developer.txt
|
||||
.br
|
||||
/usr/share/doc/emailrelay/reference.txt
|
||||
.br
|
||||
/usr/share/doc/emailrelay/userguide.txt
|
||||
.br
|
||||
/usr/share/doc/emailrelay/windows.txt
|
||||
.br
|
||||
/usr/share/doc/emailrelay/readme.html
|
||||
.br
|
||||
/usr/share/doc/emailrelay/developer.html
|
||||
.br
|
||||
/usr/share/doc/emailrelay/reference.html
|
||||
.br
|
||||
/usr/share/doc/emailrelay/userguide.html
|
||||
.br
|
||||
/usr/share/doc/emailrelay/windows.html
|
||||
.br
|
||||
/usr/share/doc/emailrelay/emailrelay-man.html
|
||||
.br
|
||||
/usr/share/doc/emailrelay/index.html
|
||||
.br
|
||||
/usr/share/doc/emailrelay/changelog.html
|
||||
.br
|
||||
/usr/share/doc/emailrelay/emailrelay.css
|
||||
.br
|
||||
/usr/share/doc/emailrelay/NEWS
|
||||
.br
|
||||
/usr/share/doc/emailrelay/README
|
||||
.br
|
||||
/usr/share/doc/emailrelay/changelog.gz
|
||||
.br
|
||||
/usr/share/man/man1/emailrelay.1.gz
|
||||
.br
|
||||
/usr/share/man/man1/emailrelay-passwd.1.gz
|
||||
.br
|
||||
/usr/share/man/man1/emailrelay-poke.1.gz
|
||||
.br
|
||||
/usr/share/man/man1/emailrelay-submit.1.gz
|
||||
.br
|
||||
/etc/init.d/emailrelay
|
||||
.br
|
||||
/var/spool/emailrelay/emailrelay.*.envelope
|
||||
.br
|
||||
/var/spool/emailrelay/emailrelay.*.content
|
||||
.SH SEE ALSO
|
||||
E-MailRelay user guide
|
||||
.br
|
||||
E-MailRelay reference
|
||||
.br
|
||||
.BR emailrelay-submit (1),
|
||||
.BR emailrelay-poke (1),
|
||||
.BR emailrelay-passwd (1),
|
||||
.BR syslog (3),
|
||||
.BR pppd (8),
|
||||
.BR init.d (7)
|
||||
|
@ -19,13 +19,16 @@ div.two-column-menu
|
||||
border-width: 1px ;
|
||||
border-color: #999 ;
|
||||
|
||||
width: 150px ;
|
||||
width: 230px ; /* IE5 */
|
||||
voice-family: "\"}\"" ; /* IE5 trick */
|
||||
voice-family: inherit ;
|
||||
width: 190px ; /* STD */
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
font-family: verdana, arial, helvetica, sans-serif ;
|
||||
background-color: white ;
|
||||
font-family: verdana, arial, helvetica, sans-serif ;
|
||||
background-color: white ;
|
||||
}
|
||||
|
||||
div.div-main
|
||||
@ -37,12 +40,15 @@ div.div-main
|
||||
div.div-toc
|
||||
{
|
||||
background: #eee ;
|
||||
padding: 0.5em ;
|
||||
}
|
||||
|
||||
div.two-column-menu div.div-toc
|
||||
p.p-toc
|
||||
{
|
||||
padding: 0px ;
|
||||
padding: 5px ;
|
||||
margin-top: 0px ;
|
||||
margin-bottom: 0px ;
|
||||
margin-left: 0.5em ;
|
||||
text-align: left ;
|
||||
}
|
||||
|
||||
div.div-pre
|
||||
@ -57,7 +63,7 @@ div.div-pre
|
||||
h1
|
||||
{
|
||||
text-align: center ;
|
||||
color: #09c ;
|
||||
color: #09c ;
|
||||
}
|
||||
|
||||
img
|
||||
@ -67,12 +73,12 @@ img
|
||||
|
||||
h2
|
||||
{
|
||||
color: #09c ;
|
||||
color: #09c ;
|
||||
}
|
||||
|
||||
p
|
||||
{
|
||||
font: verdana, arial, helvetica, sans-serif ;
|
||||
font: verdana, arial, helvetica, sans-serif ;
|
||||
text-align: justify ;
|
||||
}
|
||||
|
||||
@ -80,7 +86,6 @@ a.a-toc
|
||||
{
|
||||
color: #09c ;
|
||||
text-decoration: none ;
|
||||
padding-left: 0% ;
|
||||
}
|
||||
|
||||
a.a-toc:hover
|
||||
@ -90,13 +95,13 @@ a.a-toc:hover
|
||||
|
||||
a.a-header
|
||||
{
|
||||
text-decoration:none ;
|
||||
text-decoration:none ;
|
||||
}
|
||||
|
||||
a.a-href
|
||||
{
|
||||
text-decoration: none ;
|
||||
font-weight: bold ;
|
||||
font-weight: bold ;
|
||||
}
|
||||
|
||||
a.a-href:link
|
||||
@ -116,11 +121,11 @@ a.a-href:hover
|
||||
|
||||
div.two-column-header
|
||||
{
|
||||
background-color: #eee ;
|
||||
background-color: #eee ;
|
||||
|
||||
border-style: solid ;
|
||||
border-color: #999 ;
|
||||
border-width: 1px 0px ; /* top/bottom left/right */
|
||||
border-style: solid ;
|
||||
border-color: #999 ;
|
||||
border-width: 1px 0px ; /* top/bottom left/right */
|
||||
}
|
||||
|
||||
em.quote
|
||||
@ -152,24 +157,6 @@ dd
|
||||
padding-bottom: 4px ; /* for konqueror */
|
||||
}
|
||||
|
||||
h3.h3-toc
|
||||
{
|
||||
margin-bottom: 0px ;
|
||||
}
|
||||
|
||||
ul.ul-toc
|
||||
{
|
||||
list-style-type: none ;
|
||||
margin-top: 0px ;
|
||||
margin-bottom: 0px ;
|
||||
padding-left: 15% ;
|
||||
}
|
||||
|
||||
li.li-toc
|
||||
{
|
||||
padding-top: 3%
|
||||
}
|
||||
|
||||
span.span-mailto
|
||||
{
|
||||
font-size: smaller ;
|
||||
@ -178,6 +165,6 @@ span.span-mailto
|
||||
#img-sourceforge
|
||||
{
|
||||
border-width: 0px ;
|
||||
border-style: none ; /* check */
|
||||
border-style: none ; /* check */
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 487 B |
@ -14,10 +14,11 @@
|
||||
<li><a href="reference.html">Reference manual</a></li>
|
||||
<li><a href="windows.html">Windows installation guide</a></li>
|
||||
<li><a href="developer.html">Notes for developers</a></li>
|
||||
<li><a href="html/index.html">Source code documentation</a> (generated by <a href="http://www.doxygen.org">doxygen</a>, if available)</li>
|
||||
<li><a href="man.html">Man page</a> (generated by man2html, if available)</li>
|
||||
<li><a href="doxygen/index.html">Source code documentation</a> (generated by <a href="http://www.doxygen.org">doxygen</a>, if available)</li>
|
||||
<li><a href="emailrelay-man.html">Man page</a> (generated by man2html, if available)</li>
|
||||
<li><a href="http://emailrelay.sourceforge.net">Web site</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<!-- Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>. All rights reserved. -->
|
||||
|
@ -132,9 +132,9 @@ The envelope suffixes are:
|
||||
* <none> -- while the message is spooled
|
||||
* ".busy" -- while the message is being forwarded
|
||||
* ".bad" -- if the message cannot be forwarded
|
||||
* ".local" -- for copies of the envelope file for delivery to local recipeints
|
||||
* ".local" -- for copies of the envelope file for delivery to local recipients
|
||||
|
||||
Copies of the content file for delivery to local recipeints will also have
|
||||
Copies of the content file for delivery to local recipients will also have
|
||||
a "local" suffix.
|
||||
|
||||
If a message cannot be forwarded the envelope file is given a "bad" suffix,
|
||||
@ -152,7 +152,7 @@ SMTP issues
|
||||
(where "fqdn" is the host's fully qualified domain name) are treated as the local
|
||||
postmaster, resulting in local delivery rather than mail forwarding.
|
||||
|
||||
Receipient addresses (other than "postmaster" addresses) with no "at" sign (@) or
|
||||
Recipient addresses (other than "postmaster" addresses) with no "at" sign (@) or
|
||||
ending in "@localhost" will be rejected at the time the message is submitted by the
|
||||
e-mail front-end. This is in line with E-MailRelay's intended purpose as a simple
|
||||
mail relay, rather than a fully-fledged routing MTA.
|
||||
@ -178,7 +178,7 @@ SMTP issues
|
||||
# Eight bit messages:
|
||||
|
||||
The 8BITMIME SMTP extension is supported, however no attempt is made to
|
||||
re-encode 8-bit messages into 7-bit messages if the downstream server
|
||||
re-encode 8-bit messages into 7-bit messages if the next-hop server
|
||||
does not.
|
||||
|
||||
Administration interface
|
||||
@ -188,8 +188,8 @@ administration tasks. This is a simple command-line interface which is
|
||||
compatible with "telnet".
|
||||
|
||||
Currently the only supported commands are "flush" and "info". The "flush" command
|
||||
is used to forward spooled mail to the configured dowstream SMTP server. The
|
||||
downstream server address must have been defined on the "emailrelay" command
|
||||
is used to forward spooled mail to the configured next-hop SMTP server. The
|
||||
next-hop server address must have been defined on the "emailrelay" command
|
||||
line at start-up using the "--forward-to" switch; it cannot be specified through
|
||||
the administration interface.
|
||||
|
||||
@ -251,15 +251,19 @@ A major security concern is the use of an external mail pre-processor (using the
|
||||
|
||||
# effective userid
|
||||
|
||||
Root or suid privileges are revoked at start-up, switching to the real userid
|
||||
or "daemon" if the real userid is root. Special privileges are only reclaimed
|
||||
when needed to bind sockets and do file i/o.
|
||||
Suid privileges are revoked at start-up, switching the effective userid/groupid
|
||||
to be the real userid/groupid values. If started as "root" then the effective
|
||||
userid/groupid are taken from the "daemon" user. Special privileges are only
|
||||
reclaimed when needed to bind sockets and do file i/o. Normally this means
|
||||
temporarily switching the userid and groupid back to what they were at start-up.
|
||||
However, when writing spool files only the effective userid is changed, not the
|
||||
groupid.
|
||||
|
||||
# execution environment
|
||||
|
||||
The pre-processor runs with an almost empty set of environment variables,
|
||||
and with no open file descriptors other than "stdin"/"stdout"/"stderr" open
|
||||
onto "/dev/null".
|
||||
The pre-processor runs with an almost empty set of environment variables ("PATH"
|
||||
and "IFS"), and with no open file descriptors other than "stdin"/"stdout"/"stderr"
|
||||
open onto "/dev/null".
|
||||
|
||||
# configuration
|
||||
|
||||
@ -276,11 +280,12 @@ such as those which use digital signatures."
|
||||
The "Authentication" section below also relates to security.
|
||||
|
||||
Some other points are:
|
||||
* The program runs with a "umask" of 177 so files are created with "-rw-------" permissions.
|
||||
* The program runs for most of the time with a "umask" of 177, switching to 117 when creating spool files.
|
||||
* Strings are dynamically allocated, so buffer overflow/truncation issues are avoided.
|
||||
* By default connections to the SMTP and administrative ports will be rejected if they come from remote machines.
|
||||
* No configuration parameters can be changed through the administrative interface.
|
||||
* No exec(), system() or popen() calls are used other than execve() to spawn the mail pre-processor.
|
||||
* The submit utility is installed as set-group-id with group ownership of "daemon".
|
||||
|
||||
Authentication
|
||||
--------------
|
||||
@ -303,12 +308,12 @@ identifier; and the "secret" field is the xtext-encoded "LOGIN" password or
|
||||
"CRAM-MD5" keys can be generated using the "emailrelay-passwd" utility.
|
||||
|
||||
A client-side secrets file should contain at least one "LOGIN client" or
|
||||
"CRAM-MD5 client" entry. A server-side secrets file should contains zero or
|
||||
"CRAM-MD5 client" entry. A server-side secrets file should contain zero or
|
||||
more "LOGIN server" or "CRAM-MD5 server" entries. The same secrets file may
|
||||
be specified for both "--auth-client" and "--auth-server" switches.
|
||||
|
||||
For example, the following secrets file defines "jsmith" as the username to be
|
||||
used when E-MailRelay authenticates with a downstream server, and defines two
|
||||
used when E-MailRelay authenticates with a next-hop server, and defines two
|
||||
usernames ("user1" and "user2") which can be used by clients when they
|
||||
authenticate with the E-MailRelay server:
|
||||
|
||||
@ -337,7 +342,7 @@ On the server side authentication is advertised in the response to the SMTP
|
||||
"EHLO" command if the "--auth-server" command line switch is used, but
|
||||
authentication by the client is optional. If the client does authenticate then
|
||||
the authenticated user-id is stored with the message and then passed on to a
|
||||
downstream server using an "AUTH=userid" parameter on the SMTP "MAIL FROM"
|
||||
next-hop server using an "AUTH=userid" parameter on the SMTP "MAIL FROM"
|
||||
command. If the client chooses not to authenticate then the submitted messages
|
||||
will be forwarded using "AUTH=<>" on the "MAIL FROM" command. Note that any
|
||||
"AUTH=userid" information on incoming submitted messages is ignored and
|
||||
@ -357,25 +362,101 @@ from a particular IP address is allowed. This type of POP-before-SMTP
|
||||
authentication can be done outside the E-MailRelay system by POP/IMAP utilities
|
||||
such as "fetchmail".
|
||||
|
||||
Files
|
||||
-----
|
||||
Installation directories
|
||||
------------------------
|
||||
By default "make install" installs files in the following locations:
|
||||
* /usr/local/libexec/emailrelay-poke
|
||||
* /usr/local/libexec/emailrelay-passwd
|
||||
* /usr/local/libexec/emailrelay.sh
|
||||
* /usr/local/libexec/emailrelay-notify.sh
|
||||
* /usr/local/libexec/emailrelay-deliver.sh
|
||||
* /usr/local/libexec/emailrelay-resubmit.sh
|
||||
* /usr/local/libexec/emailrelay
|
||||
* /usr/local/libexec/emailrelay-process.sh
|
||||
* /usr/local/sbin/emailrelay
|
||||
* /usr/local/var/spool/emailrelay/empty_file
|
||||
* /usr/local/share/emailrelay/emailrelay-notify.sh
|
||||
* /usr/local/share/emailrelay/emailrelay-deliver.sh
|
||||
* /usr/local/share/emailrelay/emailrelay-process.sh
|
||||
* /usr/local/share/emailrelay/*.html
|
||||
* /usr/local/share/emailrelay/graphics/bullet.gif
|
||||
* /usr/local/man/man1/emailrelay.1
|
||||
* /usr/local/man/man1/emailrelay-poke.1
|
||||
* /usr/local/sbin/emailrelay-passwd
|
||||
* /usr/local/sbin/emailrelay-submit
|
||||
* /usr/local/var/spool/emailrelay/*
|
||||
* /usr/local/share/emailrelay/doc/developer.txt
|
||||
* /usr/local/share/emailrelay/doc/reference.txt
|
||||
* /usr/local/share/emailrelay/doc/userguide.txt
|
||||
* /usr/local/share/emailrelay/doc/windows.txt
|
||||
* /usr/local/share/emailrelay/doc/readme.html
|
||||
* /usr/local/share/emailrelay/doc/developer.html
|
||||
* /usr/local/share/emailrelay/doc/reference.html
|
||||
* /usr/local/share/emailrelay/doc/userguide.html
|
||||
* /usr/local/share/emailrelay/doc/windows.html
|
||||
* /usr/local/share/emailrelay/doc/emailrelay-man.html
|
||||
* /usr/local/share/emailrelay/doc/index.html
|
||||
* /usr/local/share/emailrelay/doc/changelog.html
|
||||
* /usr/local/share/emailrelay/doc/emailrelay.css
|
||||
* /usr/local/share/emailrelay/doc/NEWS
|
||||
* /usr/local/share/emailrelay/doc/README
|
||||
* /usr/local/share/emailrelay/doc/changelog.gz
|
||||
* /usr/local/share/emailrelay/doc/doxygen/*
|
||||
* /usr/local/man/man1/emailrelay.1.gz
|
||||
* /usr/local/man/man1/emailrelay-passwd.1.gz
|
||||
* /usr/local/man/man1/emailrelay-poke.1.gz
|
||||
* /usr/local/man/man1/emailrelay-submit.1.gz
|
||||
|
||||
This directory structure is constrained by the GNU/"autoconf" conventions rather
|
||||
than the Filesystem Hierarchy Standard.
|
||||
than the Filesystem Hierarchy Standard (FHS).
|
||||
|
||||
To force FHS compliance you can use the "--enable-fhs" switch when running
|
||||
"configure". This results in the following file locations:
|
||||
* /usr/lib/emailrelay/emailrelay-poke
|
||||
* /usr/sbin/emailrelay
|
||||
* /usr/sbin/emailrelay-passwd
|
||||
* /usr/sbin/emailrelay-submit
|
||||
* /usr/share/doc/emailrelay/examples/emailrelay-notify.sh
|
||||
* /usr/share/doc/emailrelay/examples/emailrelay-deliver.sh
|
||||
* /usr/share/doc/emailrelay/examples/emailrelay-resubmit.sh
|
||||
* /usr/share/doc/emailrelay/examples/emailrelay-process.sh
|
||||
* /usr/share/doc/emailrelay/developer.txt
|
||||
* /usr/share/doc/emailrelay/reference.txt
|
||||
* /usr/share/doc/emailrelay/userguide.txt
|
||||
* /usr/share/doc/emailrelay/windows.txt
|
||||
* /usr/share/doc/emailrelay/readme.html
|
||||
* /usr/share/doc/emailrelay/developer.html
|
||||
* /usr/share/doc/emailrelay/reference.html
|
||||
* /usr/share/doc/emailrelay/userguide.html
|
||||
* /usr/share/doc/emailrelay/windows.html
|
||||
* /usr/share/doc/emailrelay/emailrelay-man.html
|
||||
* /usr/share/doc/emailrelay/index.html
|
||||
* /usr/share/doc/emailrelay/changelog.html
|
||||
* /usr/share/doc/emailrelay/emailrelay.css
|
||||
* /usr/share/doc/emailrelay/NEWS
|
||||
* /usr/share/doc/emailrelay/README
|
||||
* /usr/share/doc/emailrelay/changelog.gz
|
||||
* /usr/share/doc/emailrelay/doxygen/*
|
||||
* /usr/share/man/man1/emailrelay.1.gz
|
||||
* /usr/share/man/man1/emailrelay-passwd.1.gz
|
||||
* /usr/share/man/man1/emailrelay-poke.1.gz
|
||||
* /usr/share/man/man1/emailrelay-submit.1.gz
|
||||
* /var/spool/emailrelay/*
|
||||
* /etc/init.d/emailrelay
|
||||
|
||||
For finer control of the directory structure the following variables
|
||||
can be specified on the "configure" command line (but note that the
|
||||
"--enable-fhs" will override them):
|
||||
* e_sbindir
|
||||
* e_libexecdir
|
||||
* e_docdir
|
||||
* e_initdir
|
||||
* e_spooldir
|
||||
* e_man1dir
|
||||
* e_examplesdir
|
||||
|
||||
For example, running "./configure --prefix=/usr e_spooldir=/tmp/spool" will
|
||||
create the GNU-style directory structure under "/usr" rather than "/usr/local",
|
||||
and create the E-MailRelay spool directory as "/tmp/spool" rather than
|
||||
"/usr/local/var/spool/emailrelay".
|
||||
|
||||
The default spool directory path which is built into the executables and scripts
|
||||
comes from "configure", via the makefiles. So if you re-run "configure" with a
|
||||
different spool directory you should also do a "make clean" in at least
|
||||
"src/main" and "bin".
|
||||
|
||||
The "emailrelay" script in "init.d" creates a pid file in "/var/run" if the
|
||||
directory exists, or in "/tmp" otherwise.
|
||||
|
||||
|
||||
Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>. All rights reserved.
|
||||
|
@ -6,7 +6,7 @@ What is it?
|
||||
E-MailRelay is a simple store-and-forward e-mail transfer agent. It's a program
|
||||
which runs in the background and accepts e-mail from front-ends (KMail, Outlook,
|
||||
Netscape etc.), stores the messages on the hard disk, and when next connected
|
||||
to the Internet forwards them to a downstream SMTP server for onward delivery.
|
||||
to the Internet forwards them to a next SMTP server for onward delivery.
|
||||
|
||||
The E-MailRelay program ("emailrelay") can run in two main modes: a storage
|
||||
daemon, or a forwarding agent. As a storage daemon it waits for connections
|
||||
@ -19,7 +19,7 @@ storage daemon it acts as an SMTP server, and when running as a forwarding
|
||||
agent it acts as an SMTP client.
|
||||
|
||||
The program can also run as a proxy server. In this mode e-mails submitted at
|
||||
the server interface are passed on to the dowstream server immediately, without
|
||||
the server interface are passed on to the next server immediately, without
|
||||
spooling. This can be useful when combined with mail pre-processing to do things
|
||||
like encryption, message archiving, addition of digital signatures, etc.
|
||||
|
||||
@ -113,9 +113,10 @@ found and what your default run level is:
|
||||
$ runlevel | awk '{print $2}'
|
||||
|
||||
Assuming these are "/etc/init.d" and "5" you should (as root) copy the
|
||||
E-MailRelay start/stop script into "/etc/init.d":
|
||||
E-MailRelay start/stop script into "/etc/init.d" (if it is not already
|
||||
installed there):
|
||||
|
||||
$ cp /usr/local/libexec/emailrelay.sh /etc/init.d
|
||||
$ cp /usr/local/libexec/emailrelay /etc/init.d
|
||||
|
||||
Then determine an appropriate numeric value for the link names by looking at
|
||||
the "sendmail" links:
|
||||
@ -127,8 +128,8 @@ Assuming sendmail links are "S10sendmail" and "K10sendmail", create
|
||||
the "emailrelay" links in the same format:
|
||||
|
||||
$ cd /etc/init.d/rc5.d
|
||||
$ ln -s ../emailrelay.sh S10emailrelay
|
||||
$ ln -s ../emailrelay.sh K10emailrelay
|
||||
$ ln -s ../emailrelay S10emailrelay
|
||||
$ ln -s ../emailrelay K10emailrelay
|
||||
|
||||
And finally remove sendmail from the run-level (otherwise both
|
||||
daemons compete for the standard SMTP listening port):
|
||||
@ -173,8 +174,9 @@ Notification of failed e-mails
|
||||
If e-mail messages become corrupted or inaccessible within the spool directory
|
||||
then they will get failed within the E-MailRelay system. In order to get failed
|
||||
e-mails to 'bounce' back into your in-tray you will need to run the
|
||||
"emailrelay-notify.sh" script periodically. Note that this script requires
|
||||
that you have "procmail" installed on your system to act as a "delivery agent".
|
||||
"emailrelay-notify.sh" script (as "root") periodically. Note that this script
|
||||
requires that you have "procmail" installed on your system to act as a
|
||||
"delivery agent".
|
||||
|
||||
There are not many ways in which an e-mail can fail within the E-MailRelay
|
||||
system. If everything is set up correctly then perhaps the most likely case is
|
||||
@ -184,9 +186,14 @@ a simple check in your ".profile" script for "*.bad" files in the spool
|
||||
directory may be sufficient:
|
||||
|
||||
$ cat <<EOF >> ~/.profile
|
||||
if test -f /usr/local/var/spool/emailrelay/*.envelope.bad ; then echo Failed mail >&2 ; fi
|
||||
if test -f /var/spool/emailrelay/*.envelope.bad ; then echo Failed mail >&2 ; fi
|
||||
EOF
|
||||
|
||||
If you want failed e-mails to be retried a few times before bouncing back into
|
||||
your in-tray, you can run the "emailrelay-resubmit.sh" script. This simply
|
||||
removes the ".bad" suffix from files in the spool directory, as long as they
|
||||
have not been retried too many times already.
|
||||
|
||||
Logging
|
||||
-------
|
||||
The E-MailRelay program uses the "syslog" system to issue warnings and error messages,
|
||||
|
@ -1,21 +1,21 @@
|
||||
Summary: Simple e-mail message transfer agent using SMTP
|
||||
Name: emailrelay
|
||||
Version: 0.9.8
|
||||
Version: 0.9.9
|
||||
Release: 1
|
||||
Copyright: GPL
|
||||
Group: System Environment/Daemons
|
||||
Source: http://emailrelay.sourceforge.net/.../emailrelay-src-0.9.8.tar.gz
|
||||
Source: http://emailrelay.sourceforge.net/.../emailrelay-src-0.9.9.tar.gz
|
||||
BuildRoot: /tmp/emailrelay-install
|
||||
|
||||
%description
|
||||
E-MailRelay is a simple SMTP store-and-forward message transfer agent (MTA).
|
||||
It runs as an SMTP server, storing e-mail in a local spool directory, and
|
||||
then forwarding the stored messages to a downstream SMTP server on request.
|
||||
then forwarding the stored messages to the next SMTP server on request.
|
||||
It can also run as a proxy server, forwarding (and optionally pre-processing)
|
||||
e-mail as soon as it is received. It does not do any message routing, other
|
||||
than to a local postmaster. Because of this functional simplicity it is
|
||||
extremely easy to configure, typically only requiring the address of the
|
||||
downstream SMTP server to be put on the command line.
|
||||
next-hop SMTP server to be put on the command line.
|
||||
|
||||
C++ source code is available for Linux, FreeBSD and Windows. Distribution is
|
||||
under the GNU General Public License.
|
||||
@ -24,38 +24,46 @@ under the GNU General Public License.
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure
|
||||
make HAVE_DOXYGEN=no
|
||||
./configure --enable-fhs
|
||||
make HAVE_DOXYGEN=no HAVE_MAN2HTML=no
|
||||
|
||||
%install
|
||||
make install destdir=$RPM_BUILD_ROOT DESTDIR=$RPM_BUILD_ROOT HAVE_DOXYGEN=no
|
||||
make install destdir=$RPM_BUILD_ROOT DESTDIR=$RPM_BUILD_ROOT HAVE_DOXYGEN=no HAVE_MAN2HTML=no
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
|
||||
/usr/local/libexec/emailrelay-passwd
|
||||
/usr/local/libexec/emailrelay-poke
|
||||
/usr/local/libexec/emailrelay-submit
|
||||
/usr/local/libexec/emailrelay.sh
|
||||
/usr/local/sbin/emailrelay
|
||||
/usr/local/var/spool/emailrelay/empty_file
|
||||
/usr/local/share/emailrelay/emailrelay-notify.sh
|
||||
/usr/local/share/emailrelay/emailrelay-deliver.sh
|
||||
/usr/local/share/emailrelay/emailrelay-process.sh
|
||||
/usr/local/share/emailrelay/readme.html
|
||||
/usr/local/share/emailrelay/developer.html
|
||||
/usr/local/share/emailrelay/reference.html
|
||||
/usr/local/share/emailrelay/userguide.html
|
||||
/usr/local/share/emailrelay/man.html
|
||||
/usr/local/share/emailrelay/index.html
|
||||
/usr/local/share/emailrelay/windows.html
|
||||
/usr/local/share/emailrelay/changelog.html
|
||||
/usr/local/share/emailrelay/graphics/bullet.gif
|
||||
/usr/local/man/man1/emailrelay.1
|
||||
/usr/local/man/man1/emailrelay-passwd.1
|
||||
/usr/local/man/man1/emailrelay-poke.1
|
||||
/usr/lib/emailrelay/emailrelay-poke
|
||||
/usr/sbin/emailrelay
|
||||
/usr/sbin/emailrelay-passwd
|
||||
/usr/sbin/emailrelay-submit
|
||||
/usr/share/doc/emailrelay/examples/emailrelay-process.sh
|
||||
/usr/share/doc/emailrelay/examples/emailrelay-notify.sh
|
||||
/usr/share/doc/emailrelay/examples/emailrelay-deliver.sh
|
||||
/usr/share/doc/emailrelay/examples/emailrelay-resubmit.sh
|
||||
/usr/share/doc/emailrelay/developer.txt
|
||||
/usr/share/doc/emailrelay/reference.txt
|
||||
/usr/share/doc/emailrelay/userguide.txt
|
||||
/usr/share/doc/emailrelay/windows.txt
|
||||
/usr/share/doc/emailrelay/readme.html
|
||||
/usr/share/doc/emailrelay/developer.html
|
||||
/usr/share/doc/emailrelay/reference.html
|
||||
/usr/share/doc/emailrelay/userguide.html
|
||||
/usr/share/doc/emailrelay/windows.html
|
||||
/usr/share/doc/emailrelay/index.html
|
||||
/usr/share/doc/emailrelay/changelog.html
|
||||
/usr/share/doc/emailrelay/emailrelay.css
|
||||
/usr/share/doc/emailrelay/NEWS
|
||||
/usr/share/doc/emailrelay/README
|
||||
/usr/share/doc/emailrelay/changelog.gz
|
||||
/usr/share/doc/emailrelay/doxygen
|
||||
/usr/share/man/man1/emailrelay.1.gz
|
||||
/usr/share/man/man1/emailrelay-passwd.1.gz
|
||||
/usr/share/man/man1/emailrelay-poke.1.gz
|
||||
/usr/share/man/man1/emailrelay-submit.1.gz
|
||||
/etc/init.d/emailrelay
|
||||
|
||||
%changelog
|
||||
|
||||
|
@ -1 +1,19 @@
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
SUBDIRS = gcc2.95 msvc6.0
|
||||
|
@ -10,6 +10,25 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
@ -61,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -68,6 +88,13 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
SUBDIRS = gcc2.95 msvc6.0
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
@ -82,7 +109,7 @@ TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lib/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
|
@ -16,7 +16,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
EXTRA_DIST = iostream limits sstream xlocale
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
@ -81,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -88,6 +88,13 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
EXTRA_DIST = iostream limits sstream xlocale
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
@ -102,7 +109,7 @@ TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lib/gcc2.95/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
|
@ -16,6 +16,5 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
EXTRA_DIST = cstdio cstdlib cstring ctime
|
||||
|
@ -28,7 +28,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
@ -81,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -88,6 +88,13 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
EXTRA_DIST = cstdio cstdlib cstring ctime
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
@ -102,7 +109,7 @@ TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lib/msvc6.0/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
|
@ -1 +1,19 @@
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
SUBDIRS = glib gnet main win32
|
||||
|
@ -10,6 +10,25 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#
|
||||
# Copyright (C) 2001-2002 Graeme Walker <graeme_walker@users.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
@ -61,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -68,6 +88,13 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
SUBDIRS = glib gnet main win32
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
@ -82,7 +109,7 @@ TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
|
@ -16,7 +16,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
EXTRA_DIST=garg_win32.cpp \
|
||||
gdaemon_win32.cpp \
|
||||
gdatetime_win32.cpp \
|
||||
|
@ -28,7 +28,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
@ -81,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -88,6 +88,13 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
EXTRA_DIST = garg_win32.cpp gdaemon_win32.cpp gdatetime_win32.cpp gdirectory_win32.cpp gfs_win32.cpp glogoutput_win32.cpp gprocess_win32.cpp gfile_win32.cpp md5c.c md5.h
|
||||
|
||||
@ -132,7 +139,7 @@ OBJECTS = $(libglib_a_OBJECTS)
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .cpp .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/glib/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
|
@ -29,7 +29,4 @@
|
||||
#include "glog.h"
|
||||
#include "gassert.h"
|
||||
|
||||
// backwards compatibility...
|
||||
//typedef LogOutput GDebug ;
|
||||
|
||||
#endif
|
||||
|
@ -49,7 +49,7 @@ class G::Log
|
||||
{
|
||||
public:
|
||||
typedef std::ostream Stream ;
|
||||
enum Severity { s_Log , s_Debug , s_Warning , s_Error , s_Assertion } ;
|
||||
enum Severity { s_LogVerbose , s_LogSummary , s_Debug , s_Warning , s_Error , s_Assertion } ;
|
||||
|
||||
struct End // A private implementation class for Log. An End object from end() must be streamed out to flush a spooled message.
|
||||
{ Severity m_s ; End(Severity s) : m_s(s) {} } ;
|
||||
@ -105,7 +105,7 @@ namespace G
|
||||
}
|
||||
} ;
|
||||
|
||||
// Macros: G_LOG, G_DEBUG, G_WARNING, G_ERROR
|
||||
// Macros: G_LOG, G_LOG_S, G_DEBUG, G_WARNING, G_ERROR
|
||||
// The debug macro is for debugging during development. The log macro
|
||||
// is used for progress logging, typically in long-lived server processes.
|
||||
// The warning and error macros are used for error warning/error messages.
|
||||
@ -113,16 +113,18 @@ namespace G
|
||||
// then warning/error messages should also get raised by some another
|
||||
// independent means.
|
||||
//
|
||||
#define G_LOG_OUTPUT( expr , severity ) { try { G::Log::stream() << G::Log::Line(__FILE__,__LINE__) << expr << G::Log::end(severity) ; } catch(...) {} }
|
||||
#define G_LOG_OUTPUT( expr , severity ) { G::Log::stream() << G::Log::Line(__FILE__,__LINE__) << expr << G::Log::end(severity) ; }
|
||||
#if defined(_DEBUG) && ! defined(G_NO_DEBUG)
|
||||
#define G_DEBUG( expr ) G_LOG_OUTPUT( expr , G::Log::s_Debug )
|
||||
#else
|
||||
#define G_DEBUG( expr )
|
||||
#endif
|
||||
#if ! defined(G_NO_LOG)
|
||||
#define G_LOG( expr ) G_LOG_OUTPUT( expr , G::Log::s_Log )
|
||||
#define G_LOG( expr ) G_LOG_OUTPUT( expr , G::Log::s_LogVerbose )
|
||||
#define G_LOG_S( expr ) G_LOG_OUTPUT( expr , G::Log::s_LogSummary )
|
||||
#else
|
||||
#define G_LOG( expr )
|
||||
#define G_LOG_S( expr )
|
||||
#endif
|
||||
#define G_WARNING( expr ) G_LOG_OUTPUT( expr , G::Log::s_Warning )
|
||||
#define G_ERROR( expr ) G_LOG_OUTPUT( expr , G::Log::s_Error )
|
||||
|
@ -27,23 +27,56 @@
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
|
||||
G::LogOutput *G::LogOutput::m_this = NULL ;
|
||||
G::LogOutput * G::LogOutput::m_this = NULL ;
|
||||
|
||||
G::LogOutput::LogOutput( bool enabled , bool verbose ) :
|
||||
m_enabled(enabled) ,
|
||||
m_verbose(verbose) ,
|
||||
m_syslog(false) ,
|
||||
m_time(0) ,
|
||||
m_timestamp(false)
|
||||
G::LogOutput::LogOutput( const std::string & prefix , bool enabled , bool summary_log ,
|
||||
bool verbose_log , bool debug , bool level , bool timestamp , bool strip ) :
|
||||
m_prefix(prefix) ,
|
||||
m_enabled(enabled) ,
|
||||
m_summary_log(summary_log) ,
|
||||
m_verbose_log(verbose_log) ,
|
||||
m_debug(debug) ,
|
||||
m_level(level) ,
|
||||
m_strip(strip) ,
|
||||
m_syslog(false) ,
|
||||
m_time(0) ,
|
||||
m_timestamp(timestamp) ,
|
||||
m_handle(0) ,
|
||||
m_handle_set(false)
|
||||
{
|
||||
if( m_this == NULL )
|
||||
m_this = this ;
|
||||
init() ;
|
||||
}
|
||||
|
||||
G::LogOutput::LogOutput( bool enabled_and_summary , bool verbose_and_debug ) :
|
||||
m_enabled(enabled_and_summary) ,
|
||||
m_summary_log(enabled_and_summary) ,
|
||||
m_verbose_log(verbose_and_debug) ,
|
||||
m_debug(verbose_and_debug) ,
|
||||
m_level(false) ,
|
||||
m_strip(false) ,
|
||||
m_syslog(false) ,
|
||||
m_time(0) ,
|
||||
m_timestamp(false) ,
|
||||
m_handle(0) ,
|
||||
m_handle_set(false)
|
||||
{
|
||||
if( m_this == NULL )
|
||||
m_this = this ;
|
||||
init() ;
|
||||
}
|
||||
|
||||
G::LogOutput::~LogOutput()
|
||||
{
|
||||
if( m_this == this )
|
||||
m_this = NULL ;
|
||||
cleanup() ;
|
||||
}
|
||||
|
||||
G::LogOutput * G::LogOutput::instance()
|
||||
{
|
||||
return m_this ;
|
||||
}
|
||||
|
||||
bool G::LogOutput::enable( bool enabled )
|
||||
@ -53,41 +86,80 @@ bool G::LogOutput::enable( bool enabled )
|
||||
return was_enabled ;
|
||||
}
|
||||
|
||||
//static
|
||||
void G::LogOutput::itoa( char *out , unsigned int n )
|
||||
{
|
||||
n = n % 1000000U ;
|
||||
|
||||
if( n == 0U )
|
||||
{
|
||||
out[0U] = '0' ;
|
||||
out[1U] = '\0' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buffer[15U] ;
|
||||
char *p = buffer + sizeof(buffer) - 1 ;
|
||||
*p-- = '\0' ;
|
||||
|
||||
for( ; n > 0U ; --p )
|
||||
{
|
||||
*p = '0' + (n % 10U) ;
|
||||
n /= 10U ;
|
||||
}
|
||||
|
||||
std::strcpy( out , p+1 ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void G::LogOutput::timestamp()
|
||||
{
|
||||
m_timestamp = true ;
|
||||
}
|
||||
|
||||
void G::LogOutput::syslog()
|
||||
{
|
||||
syslog( User ) ;
|
||||
}
|
||||
|
||||
void G::LogOutput::syslog( SyslogFacility facility )
|
||||
{
|
||||
m_syslog = true ;
|
||||
m_facility = facility ;
|
||||
}
|
||||
|
||||
//static
|
||||
void G::LogOutput::output( Log::Severity severity , const char * file , unsigned int line , const char * text )
|
||||
{
|
||||
if( m_this != NULL )
|
||||
m_this->doOutput( severity , file , line , text ) ;
|
||||
}
|
||||
|
||||
void G::LogOutput::doOutput( Log::Severity severity , const char * file , unsigned int line , const char * text )
|
||||
{
|
||||
bool do_output = m_enabled ;
|
||||
if( severity == Log::s_Debug )
|
||||
do_output = m_enabled && m_debug ;
|
||||
else if( severity == Log::s_LogSummary )
|
||||
do_output = m_enabled && m_summary_log ;
|
||||
else if( severity == Log::s_LogVerbose )
|
||||
do_output = m_enabled && m_verbose_log ;
|
||||
|
||||
if( do_output )
|
||||
{
|
||||
text = text ? text : "" ;
|
||||
|
||||
char buffer[500U] ;
|
||||
buffer[0U] = '\0' ;
|
||||
|
||||
if( severity == Log::s_Debug )
|
||||
{
|
||||
addFileAndLine( buffer , sizeof(buffer) , file , line ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_prefix.length() )
|
||||
add( buffer , sizeof(buffer) , m_prefix + ": " ) ;
|
||||
|
||||
if( m_timestamp )
|
||||
add( buffer , sizeof(buffer) , timestampString() ) ;
|
||||
|
||||
if( m_level )
|
||||
add( buffer , sizeof(buffer) , levelString(severity) ) ;
|
||||
|
||||
if( m_strip )
|
||||
text = std::strchr(text,' ') ? (std::strchr(text,' ')+1U) : text ;
|
||||
}
|
||||
|
||||
add( buffer , sizeof(buffer) , text ) ;
|
||||
|
||||
rawOutput( severity , buffer ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void G::LogOutput::onAssert()
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
|
||||
const char * G::LogOutput::timestampString()
|
||||
{
|
||||
std::time_t now = std::time(NULL) ;
|
||||
if( m_time == 0 || m_time != now )
|
||||
if( m_time == 0 || m_time != now ) // optimise calls to localtime() & strftime()
|
||||
{
|
||||
m_time = now ;
|
||||
struct std::tm * tm_p = std::localtime( &m_time ) ;
|
||||
@ -97,123 +169,95 @@ const char * G::LogOutput::timestampString()
|
||||
}
|
||||
return m_time_buffer ;
|
||||
}
|
||||
|
||||
//static
|
||||
void G::LogOutput::output( G::Log::Severity severity , const char *text )
|
||||
{
|
||||
if( m_this != NULL )
|
||||
m_this->doOutput( severity , text ) ;
|
||||
}
|
||||
|
||||
void G::LogOutput::doOutput( G::Log::Severity severity , const char *text )
|
||||
{
|
||||
if( m_enabled )
|
||||
{
|
||||
if( severity != G::Log::s_Debug || m_verbose )
|
||||
{
|
||||
rawOutput( severity , text ? text : "" ) ;
|
||||
if( text && text[0U] && text[std::strlen(text)-1U] != '\n' )
|
||||
rawOutput( severity , "\n" ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void G::LogOutput::output( G::Log::Severity severity , const char *file, unsigned line, const char *text )
|
||||
{
|
||||
if( m_this != NULL )
|
||||
m_this->doOutput( severity , file , line , text ) ;
|
||||
}
|
||||
|
||||
void G::LogOutput::doOutput( G::Log::Severity severity , const char *file, unsigned line, const char *text )
|
||||
{
|
||||
if( m_enabled )
|
||||
{
|
||||
file = file ? file : "" ;
|
||||
text = text ? text : "" ;
|
||||
|
||||
char buffer[500U] ;
|
||||
buffer[0U] = '\0' ;
|
||||
if( severity == G::Log::s_Debug )
|
||||
addFileAndLine( buffer , sizeof(buffer) , file , line ) ;
|
||||
else if( m_timestamp )
|
||||
addTimestamp( buffer , sizeof(buffer) , timestampString() ) ;
|
||||
std::strncat( buffer + std::strlen(buffer) , text , sizeof(buffer) - 1U - std::strlen(buffer) ) ;
|
||||
output( severity , buffer ) ;
|
||||
}
|
||||
}
|
||||
|
||||
G::LogOutput *G::LogOutput::instance()
|
||||
{
|
||||
return m_this ;
|
||||
}
|
||||
|
||||
void G::LogOutput::onAssert()
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
|
||||
//static
|
||||
void G::LogOutput::addFileAndLine( char *buffer , size_t size , const char *file , int line )
|
||||
{
|
||||
const char *forward = std::strrchr( file , '/' ) ;
|
||||
const char *back = std::strrchr( file , '\\' ) ;
|
||||
const char *last = forward > back ? forward : back ;
|
||||
const char *basename = last ? (last+1) : file ;
|
||||
if( file != NULL )
|
||||
{
|
||||
const char *forward = std::strrchr( file , '/' ) ;
|
||||
const char *back = std::strrchr( file , '\\' ) ;
|
||||
const char *last = forward > back ? forward : back ;
|
||||
const char *basename = last ? (last+1) : file ;
|
||||
|
||||
std::strncat( buffer+std::strlen(buffer) , basename , size-std::strlen(buffer)-1U ) ;
|
||||
std::strncat( buffer+std::strlen(buffer) , "(" , size-std::strlen(buffer)-1U ) ;
|
||||
char b[15U] ;
|
||||
itoa( b , line ) ; // (implemented above)
|
||||
std::strncat( buffer+std::strlen(buffer) , b , size-std::strlen(buffer)-1U ) ;
|
||||
std::strncat( buffer+std::strlen(buffer) , "): " , size-std::strlen(buffer)-1U ) ;
|
||||
add( buffer , size , basename ) ;
|
||||
add( buffer , size , "(" ) ;
|
||||
char b[15U] ;
|
||||
add( buffer , sizeof(buffer) , itoa(b,sizeof(b),line) ) ;
|
||||
add( buffer , sizeof(buffer) , "): " ) ;
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void G::LogOutput::addTimestamp( char *buffer , size_t size , const char * ts )
|
||||
void G::LogOutput::add( char * buffer , size_t size , const std::string & p )
|
||||
{
|
||||
std::strncat( buffer+std::strlen(buffer) , ts , size-std::strlen(buffer)-1U ) ;
|
||||
add( buffer , size , p.c_str() ) ;
|
||||
}
|
||||
|
||||
//static
|
||||
void G::LogOutput::add( char * buffer , size_t size , const char * p )
|
||||
{
|
||||
std::strncat( buffer+std::strlen(buffer) , p , size-std::strlen(buffer)-1U ) ;
|
||||
}
|
||||
|
||||
void G::LogOutput::assertion( const char *file , unsigned line , bool test , const char *test_string )
|
||||
{
|
||||
if( !test )
|
||||
{
|
||||
char buffer[100U] ;
|
||||
std::strcpy( buffer , "Assertion error: " ) ;
|
||||
size_t size = sizeof(buffer) - 10U ; // -10 for luck
|
||||
if( file )
|
||||
{
|
||||
addFileAndLine( buffer , size , file , line ) ;
|
||||
}
|
||||
if( test_string )
|
||||
{
|
||||
std::strncat( buffer+std::strlen(buffer) , test_string , size-std::strlen(buffer)-1U);
|
||||
}
|
||||
|
||||
if( instance() )
|
||||
{
|
||||
// forward to derived classes -- these
|
||||
// overrides may safely re-enter this method --
|
||||
// all code in this class is re-entrant
|
||||
//
|
||||
instance()->onAssert() ;
|
||||
}
|
||||
|
||||
output( G::Log::s_Assertion , buffer ) ;
|
||||
instance()->doAssertion( file , line , test_string ) ;
|
||||
halt() ;
|
||||
}
|
||||
}
|
||||
|
||||
void G::LogOutput::doAssertion( const char * file , unsigned line , const char * test_string )
|
||||
{
|
||||
char buffer[100U] ;
|
||||
std::strcpy( buffer , "Assertion error: " ) ;
|
||||
size_t size = sizeof(buffer) - 10U ; // -10 for luck
|
||||
if( file )
|
||||
{
|
||||
addFileAndLine( buffer , size , file , line ) ;
|
||||
}
|
||||
if( test_string )
|
||||
{
|
||||
add( buffer , size , test_string ) ;
|
||||
}
|
||||
|
||||
// forward to derived classes -- these
|
||||
// overrides may safely re-enter this method --
|
||||
// all code in this class is re-entrant
|
||||
//
|
||||
onAssert() ;
|
||||
|
||||
rawOutput( Log::s_Assertion , buffer ) ;
|
||||
}
|
||||
|
||||
//static
|
||||
void G::LogOutput::halt()
|
||||
{
|
||||
abort() ;
|
||||
}
|
||||
|
||||
void G::LogOutput::syslog( SyslogFacility facility )
|
||||
//static
|
||||
const char * G::LogOutput::levelString( Log::Severity s )
|
||||
{
|
||||
m_syslog = true ;
|
||||
m_facility = facility ;
|
||||
if( s == Log::s_Debug ) return "debug: " ;
|
||||
else if( s == Log::s_LogSummary ) return "info: " ;
|
||||
else if( s == Log::s_LogVerbose ) return "info: " ;
|
||||
else if( s == Log::s_Warning ) return "warning: " ;
|
||||
else if( s == Log::s_Error ) return "error: " ;
|
||||
else if( s == Log::s_Assertion ) return "fatal: " ;
|
||||
return "" ;
|
||||
}
|
||||
|
||||
//static
|
||||
const char * G::LogOutput::itoa( char * buffer , size_t buffer_size , unsigned int n )
|
||||
{
|
||||
buffer[0U] = '0' ; buffer[1U] = '\0' ;
|
||||
n %= 1000000U ;
|
||||
bool zero = n == 0U ;
|
||||
char * p = buffer + buffer_size - 1U ;
|
||||
for( *p-- = '\0' ; n > 0U ; --p , n /= 10U )
|
||||
*p = '0' + (n % 10U) ;
|
||||
return zero ? buffer : (p+1U) ;
|
||||
}
|
||||
|
@ -43,16 +43,25 @@ class G::LogOutput
|
||||
public:
|
||||
enum SyslogFacility { User , Daemon , Mail , Cron } ; // etc.
|
||||
|
||||
explicit LogOutput( bool logging_enabled , bool verbose = true ) ;
|
||||
// Constructor. If there is no LogOutput object,
|
||||
// or if 'logging_enabled' is false, then there is no
|
||||
// output of any sort. If both parameters are true
|
||||
// then debug messages will be generated in addition
|
||||
// to the log/warning/error messages (as long
|
||||
// as it was compiled in).
|
||||
//
|
||||
// More than one LogOutput object may be created, but
|
||||
// only the first one controls output.
|
||||
LogOutput( const std::string & prefix , bool output , bool with_logging ,
|
||||
bool with_verbose_logging , bool with_debug , bool with_level ,
|
||||
bool with_timestamp , bool strip_context ) ;
|
||||
// Constructor. If there is no LogOutput object,
|
||||
// or if 'output' is false, then there is no
|
||||
// output of any sort. Otherwise at least
|
||||
// warning and error messages are generated.
|
||||
//
|
||||
// If 'with-logging' is true then log[summary] messages
|
||||
// are output. If 'with-verbose-logging' is true then
|
||||
// log[verbose] messages are output. If 'with_debug' is
|
||||
// true then debug messages will also be generated
|
||||
// (but only if compiled in).
|
||||
//
|
||||
// More than one LogOutput object may be created, but
|
||||
// only the first one controls output.
|
||||
|
||||
explicit LogOutput( bool output_with_logging , bool verbose_and_debug = true ) ;
|
||||
// Constructor.
|
||||
|
||||
virtual ~LogOutput() ;
|
||||
// Destructor.
|
||||
@ -61,12 +70,12 @@ public:
|
||||
// Overridable. Used to do the final message
|
||||
// output (with OutputDebugString() or stderr).
|
||||
|
||||
static LogOutput *instance() ;
|
||||
static LogOutput * instance() ;
|
||||
// Returns a pointer to the controlling
|
||||
// LogOutput object. Returns NULL if none.
|
||||
|
||||
bool enable( bool debug_enabled = true ) ;
|
||||
// Enables or disables debug output.
|
||||
bool enable( bool enabled = true ) ;
|
||||
// Enables or disables output.
|
||||
// Returns the previous setting.
|
||||
|
||||
void syslog() ;
|
||||
@ -79,12 +88,8 @@ public:
|
||||
// Enables logging to the syslog system under Unix,
|
||||
// using the specified facility.
|
||||
|
||||
static void output( G::Log::Severity s , const char *raw_output ) ;
|
||||
// Generates debug output if there is an extant
|
||||
// LogOutput object which is enabled. Uses rawOutput().
|
||||
|
||||
static void output( G::Log::Severity s , const char *file , unsigned line , const char *text ) ;
|
||||
// Generates debug output if there is an extant
|
||||
// Generates output if there is an existing
|
||||
// LogOutput object which is enabled. Uses rawOutput().
|
||||
|
||||
static void assertion( const char *file , unsigned line , bool test , const char *test_string ) ;
|
||||
@ -94,30 +99,42 @@ public:
|
||||
|
||||
virtual void onAssert() ;
|
||||
// Called during an assertion failure. This allows
|
||||
// Windows applications to stop timers etc. which
|
||||
// cause reentrancy problems and infinitely recursive
|
||||
// dialog box creation.
|
||||
// Windows applications to stop timers etc. (Timers
|
||||
// can cause reentrancy problems and infinitely
|
||||
// recursive dialog box creation.)
|
||||
|
||||
private:
|
||||
LogOutput( const LogOutput & ) ;
|
||||
void operator=( const LogOutput & ) ;
|
||||
static void itoa( char *out , unsigned int ) ;
|
||||
static const char * itoa( char * , size_t , unsigned int ) ;
|
||||
static void addFileAndLine( char * , size_t , const char * , int ) ;
|
||||
static void addTimestamp( char * , size_t , const char * ) ;
|
||||
static void add( char * , size_t , const char * ) ;
|
||||
static void add( char * , size_t , const std::string & ) ;
|
||||
const char * timestampString() ;
|
||||
static void halt() ;
|
||||
void doOutput( G::Log::Severity , const char * ) ;
|
||||
void doOutput( G::Log::Severity s , const char * , unsigned , const char * ) ;
|
||||
void doAssertion( const char * , unsigned , const char * ) ;
|
||||
const char * levelString( Log::Severity s ) ;
|
||||
void init() ;
|
||||
void cleanup() ;
|
||||
|
||||
private:
|
||||
static LogOutput * m_this ;
|
||||
std::string m_prefix ;
|
||||
bool m_enabled ;
|
||||
bool m_verbose ;
|
||||
bool m_summary_log ;
|
||||
bool m_verbose_log ;
|
||||
bool m_debug ;
|
||||
bool m_level ;
|
||||
bool m_strip ;
|
||||
bool m_syslog ;
|
||||
SyslogFacility m_facility ;
|
||||
time_t m_time ;
|
||||
char m_time_buffer[40U] ;
|
||||
bool m_timestamp ;
|
||||
HANDLE m_handle ; // windows
|
||||
bool m_handle_set ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
@ -40,7 +40,8 @@ namespace
|
||||
|
||||
if( severity == G::Log::s_Warning ) m |= LOG_WARNING ;
|
||||
else if( severity == G::Log::s_Error ) m |= LOG_ERR ;
|
||||
else if( severity == G::Log::s_Log ) m |= LOG_INFO ;
|
||||
else if( severity == G::Log::s_LogSummary ) m |= LOG_INFO ;
|
||||
else if( severity == G::Log::s_LogVerbose ) m |= LOG_INFO ;
|
||||
else m |= LOG_CRIT ;
|
||||
|
||||
return m ;
|
||||
@ -49,16 +50,18 @@ namespace
|
||||
|
||||
void G::LogOutput::rawOutput( G::Log::Severity severity , const char *message )
|
||||
{
|
||||
if( severity != G::Log::s_Debug && m_syslog && !(message[0]=='\n'&&message[1]=='\0') )
|
||||
if( severity != G::Log::s_Debug && m_syslog )
|
||||
{
|
||||
::syslog( mode(m_facility,severity) , "%s" , message ) ;
|
||||
}
|
||||
std::cerr << message ;
|
||||
std::cerr.flush() ;
|
||||
std::cerr << message << std::endl ;
|
||||
}
|
||||
|
||||
void G::LogOutput::syslog()
|
||||
void G::LogOutput::init()
|
||||
{
|
||||
}
|
||||
|
||||
void G::LogOutput::cleanup()
|
||||
{
|
||||
syslog( User ) ;
|
||||
}
|
||||
|
||||
|
@ -23,32 +23,129 @@
|
||||
|
||||
#include "gdef.h"
|
||||
#include "glogoutput.h"
|
||||
#include "gpath.h"
|
||||
#include <cstdlib> // getenv
|
||||
|
||||
static HANDLE source() ;
|
||||
#if ! defined(RegisterEventSource)
|
||||
static void RegisterEventSource( const char * , const char * ) {}
|
||||
static void DeregisterEventSource( HANDLE ) {}
|
||||
static void ReportEvent( HANDLE , DWORD , int , DWORD , const char * ,
|
||||
size_t , int , const char ** , const char * ) {}
|
||||
#endif
|
||||
|
||||
void G::LogOutput::cleanup()
|
||||
{
|
||||
if( m_handle != 0 )
|
||||
::DeregisterEventSource( m_handle ) ;
|
||||
}
|
||||
|
||||
void G::LogOutput::rawOutput( G::Log::Severity severity , const char *message )
|
||||
{
|
||||
std::cerr << message ;
|
||||
std::cerr.flush() ;
|
||||
// standard error
|
||||
//
|
||||
std::cerr << message << std::endl ;
|
||||
|
||||
// debugger
|
||||
//
|
||||
static bool debugger = std::getenv("GLOGOUTPUT_DEBUGGER") != NULL ;
|
||||
if( debugger )
|
||||
{
|
||||
::OutputDebugString( message ) ;
|
||||
}
|
||||
|
||||
// file
|
||||
//
|
||||
static const char * key = "GLOGOUTPUT_FILE" ;
|
||||
static const char * filename = std::getenv( key ) ;
|
||||
if( filename != NULL && *filename != '\0' )
|
||||
{
|
||||
static std::ofstream file( filename ) ;
|
||||
file << message ;
|
||||
file.flush() ;
|
||||
file << message << std::endl ;
|
||||
}
|
||||
|
||||
// event log
|
||||
//
|
||||
if( m_syslog && severity != Log::s_Debug && m_handle != 0 )
|
||||
{
|
||||
// (assume suitable string resources of 1001..1003)
|
||||
|
||||
DWORD id = 0x400003E9L ;
|
||||
DWORD type = EVENTLOG_INFORMATION_TYPE ;
|
||||
if( severity == Log::s_Warning )
|
||||
{
|
||||
id = 0x800003EAL ;
|
||||
type = EVENTLOG_WARNING_TYPE ;
|
||||
}
|
||||
else if( severity == Log::s_Error || severity == Log::s_Assertion )
|
||||
{
|
||||
id = 0xC00003EBL ;
|
||||
type = EVENTLOG_ERROR_TYPE ;
|
||||
}
|
||||
|
||||
const char * p[] = { message , NULL } ;
|
||||
(void) ::ReportEvent( m_handle, type, 0, id, NULL, 1, 0, p, NULL ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void G::LogOutput::syslog()
|
||||
void G::LogOutput::init()
|
||||
{
|
||||
// no-op
|
||||
// see also ::RegisterEventSource() and ::ReportEvent() for NT
|
||||
#if defined(RegisterEventSource)
|
||||
m_handle = ::source() ;
|
||||
#endif
|
||||
}
|
||||
|
||||
static HANDLE source()
|
||||
{
|
||||
G::Path exe_path ;
|
||||
{
|
||||
HINSTANCE hinstance = 0 ;
|
||||
char buffer[260U*4U] ; // *4 for luck
|
||||
size_t size = sizeof(buffer) ;
|
||||
*buffer = '\0' ;
|
||||
::GetModuleFileName( hinstance , buffer , size-1U ) ;
|
||||
buffer[size-1U] = '\0' ;
|
||||
exe_path = G::Path(buffer) ;
|
||||
}
|
||||
std::string exe_name ;
|
||||
{
|
||||
G::Path p( exe_path ) ;
|
||||
p.removeExtension() ;
|
||||
exe_name = p.basename() ;
|
||||
}
|
||||
std::string reg_path_prefix( "SYSTEM\\CurrentControlSet\\Services\\"
|
||||
"EventLog\\Application\\" ) ;
|
||||
std::string reg_path = reg_path_prefix + exe_name ;
|
||||
|
||||
HKEY key = 0 ;
|
||||
::RegCreateKey( HKEY_LOCAL_MACHINE , reg_path.c_str() , &key ) ;
|
||||
bool ok = key != 0 ;
|
||||
|
||||
if( ok )
|
||||
{
|
||||
std::string value = exe_path.str() ;
|
||||
char * value_p = const_cast<char*>(value.c_str()) ;
|
||||
ok = ! ::RegSetValueEx( key , "EventMessageFile" , 0 , REG_EXPAND_SZ ,
|
||||
reinterpret_cast<LPBYTE>(value_p) , value.length()+1U ) ;
|
||||
}
|
||||
|
||||
if( ok )
|
||||
{
|
||||
DWORD value =
|
||||
EVENTLOG_INFORMATION_TYPE |
|
||||
EVENTLOG_WARNING_TYPE |
|
||||
EVENTLOG_ERROR_TYPE ;
|
||||
|
||||
ok = ! ::RegSetValueEx( key , "TypesSupported" , 0 , REG_DWORD ,
|
||||
reinterpret_cast<LPBYTE>(&value) , sizeof(value) ) ;
|
||||
|
||||
}
|
||||
|
||||
if( key != 0 )
|
||||
::RegCloseKey( key ) ;
|
||||
|
||||
return ok ?
|
||||
::RegisterEventSource( NULL , exe_name.c_str() ) :
|
||||
0 ;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
static void closeStderr() ;
|
||||
// Closes stderr.
|
||||
|
||||
static void setUmask() ;
|
||||
static void setUmask( bool tightest = true ) ;
|
||||
// Sets a tight umask.
|
||||
|
||||
static void cd( const Path & dir ) ;
|
||||
@ -108,12 +108,12 @@ public:
|
||||
static int errno_() ;
|
||||
// Returns the process's current 'errno' value.
|
||||
|
||||
static void beSpecial( Identity special ) ;
|
||||
static void beSpecial( Identity special , bool change_group = true ) ;
|
||||
// Aquires special privileges (either root
|
||||
// or suid). The parameter must have come from
|
||||
// a previous call to beOrdinary().
|
||||
|
||||
static Identity beOrdinary( Identity nobody ) ;
|
||||
static Identity beOrdinary( Identity nobody , bool change_group = true ) ;
|
||||
// Revokes special privileges (root or suid).
|
||||
// If really root (as opposed to suid root)
|
||||
// then the effective id is changed to that
|
||||
|
@ -59,9 +59,9 @@ bool G::Process::cd( const Path & dir , NoThrow )
|
||||
}
|
||||
|
||||
//static
|
||||
void G::Process::setUmask()
|
||||
void G::Process::setUmask( bool tightest )
|
||||
{
|
||||
mode_t new_mode = 0177 ; // create as -rw-------
|
||||
mode_t new_mode = tightest ? 0177 : 0117 ; // tightest => -rw-------
|
||||
(void) ::umask( new_mode ) ;
|
||||
}
|
||||
|
||||
@ -209,9 +209,9 @@ void G::Process::execCore( const G::Path & exe , const std::string & arg )
|
||||
|
||||
char * env[3U] ;
|
||||
std::string path( "PATH=/usr/bin:/bin" ) ; // no "."
|
||||
std::string ifr( "IFR= \t\n" ) ;
|
||||
std::string ifs( "IFS= \t\n" ) ;
|
||||
env[0U] = const_cast<char*>( path.c_str() ) ;
|
||||
env[1U] = const_cast<char*>( ifr.c_str() ) ;
|
||||
env[1U] = const_cast<char*>( ifs.c_str() ) ;
|
||||
env[2U] = NULL ;
|
||||
|
||||
::execve( exe.str().c_str() , argv , env ) ;
|
||||
@ -220,7 +220,7 @@ void G::Process::execCore( const G::Path & exe , const std::string & arg )
|
||||
G_WARNING( "G::Process::exec: execve() returned: errno=" << error << ": " << exe ) ;
|
||||
}
|
||||
|
||||
void G::Process::beSpecial( Identity identity )
|
||||
void G::Process::beSpecial( Identity identity , bool change_group )
|
||||
{
|
||||
// try to change our effective id -- this
|
||||
// will only work if our real uid is root, or if
|
||||
@ -231,18 +231,18 @@ void G::Process::beSpecial( Identity identity )
|
||||
//
|
||||
Identity old_identity ;
|
||||
(void) ::seteuid( identity.uid ) ;
|
||||
(void) ::setegid( identity.gid ) ;
|
||||
if( change_group) (void) ::setegid( identity.gid ) ;
|
||||
(void) old_identity.str() ; // pacify the compiler
|
||||
G_DEBUG( "G::Process::beSpecial: " << old_identity << " -> " << Identity() ) ;
|
||||
}
|
||||
|
||||
G::Process::Identity G::Process::beOrdinary( Identity nobody )
|
||||
G::Process::Identity G::Process::beOrdinary( Identity nobody , bool change_group )
|
||||
{
|
||||
Identity special_identity ;
|
||||
if( ::getuid() == 0 )
|
||||
{
|
||||
if( ::seteuid(0) ) throw UidError("0") ; // first
|
||||
if( ::setegid(nobody.gid) ) throw GidError(nobody.str()) ; // second
|
||||
if( change_group && ::setegid(nobody.gid) ) throw GidError(nobody.str()) ; // second
|
||||
if( ::seteuid(nobody.uid) ) throw UidError(nobody.str()) ; // third
|
||||
}
|
||||
else
|
||||
@ -250,7 +250,7 @@ G::Process::Identity G::Process::beOrdinary( Identity nobody )
|
||||
// switch our effective id back to our real id --
|
||||
// ie. turn off the effects of a suid executable
|
||||
if( ::seteuid( ::getuid() ) ) throw UidError() ;
|
||||
if( ::setegid( ::getgid() ) ) throw GidError() ;
|
||||
if( change_group && ::setegid( ::getgid() ) ) throw GidError() ;
|
||||
}
|
||||
G_DEBUG( "G::Process::beOrdinary: " << special_identity << " -> " << Identity() ) ;
|
||||
return special_identity ;
|
||||
|
@ -92,7 +92,7 @@ void G::Process::closeFiles( bool keep_stderr )
|
||||
}
|
||||
}
|
||||
|
||||
void G::Process::setUmask()
|
||||
void G::Process::setUmask( bool )
|
||||
{
|
||||
// _umask() is available but not very useful
|
||||
; // no-op
|
||||
@ -115,7 +115,7 @@ bool G::Process::cd( const Path & dir , NoThrow )
|
||||
return 0 == ::_chdir( dir.str().c_str() ) ;
|
||||
}
|
||||
|
||||
int G::Process::spawn( const Path & exe , const std::string & arg ,
|
||||
int G::Process::spawn( Identity , const Path & exe , const std::string & arg ,
|
||||
int error_return )
|
||||
{
|
||||
// open file descriptors are inherited across ::_spawn() --
|
||||
@ -129,24 +129,17 @@ int G::Process::spawn( const Path & exe , const std::string & arg ,
|
||||
|
||||
const int mode = _P_WAIT ;
|
||||
::_flushall() ;
|
||||
G_LOG( "G::Process::spawn: " << exe << " " << arg ) ;
|
||||
int rc = ::_spawnv( mode , exe.str().c_str() , argv ) ;
|
||||
G_LOG( "G::Process::spawn: done (" << rc << ")" ) ;
|
||||
return rc < 0 ? error_return : rc ;
|
||||
}
|
||||
|
||||
bool G::Process::privileged()
|
||||
{
|
||||
return false ;
|
||||
}
|
||||
|
||||
G::Process::Identity G::Process::beOrdinary( Identity identity )
|
||||
G::Process::Identity G::Process::beOrdinary( Identity identity , bool )
|
||||
{
|
||||
// not implemented
|
||||
return identity ;
|
||||
}
|
||||
|
||||
void G::Process::beSpecial( Identity )
|
||||
void G::Process::beSpecial( Identity , bool )
|
||||
{
|
||||
// not implemented
|
||||
}
|
||||
|
@ -30,11 +30,12 @@ G::Root * G::Root::m_this = NULL ;
|
||||
G::Process::Identity G::Root::m_special ;
|
||||
G::Process::Identity G::Root::m_nobody ;
|
||||
|
||||
G::Root::Root()
|
||||
G::Root::Root( bool change_group ) :
|
||||
m_change_group(change_group)
|
||||
{
|
||||
if( m_this == NULL )
|
||||
{
|
||||
Process::beSpecial( m_special ) ;
|
||||
Process::beSpecial( m_special , m_change_group ) ;
|
||||
m_this = this ;
|
||||
}
|
||||
}
|
||||
@ -46,7 +47,7 @@ G::Root::~Root()
|
||||
if( m_this == this )
|
||||
{
|
||||
m_this = NULL ;
|
||||
m_special = Process::beOrdinary( m_nobody ) ;
|
||||
Process::beOrdinary( m_nobody , m_change_group ) ;
|
||||
}
|
||||
}
|
||||
catch( std::exception & e )
|
||||
|
@ -40,8 +40,8 @@ namespace G
|
||||
class G::Root : private noncopyable
|
||||
{
|
||||
public:
|
||||
Root() ;
|
||||
// Default constructor. Aquires special
|
||||
explicit Root( bool change_group = true ) ;
|
||||
// Constructor. Aquires special
|
||||
// privileges if possible.
|
||||
|
||||
~Root() ;
|
||||
@ -58,13 +58,11 @@ public:
|
||||
// Returns the 'nobody' identity.
|
||||
// Precondition: init() called
|
||||
|
||||
private:
|
||||
void * operator new( size_t ) ;
|
||||
|
||||
private:
|
||||
static Root * m_this ;
|
||||
static Process::Identity m_special ;
|
||||
static Process::Identity m_nobody ;
|
||||
bool m_change_group ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
@ -216,9 +216,8 @@ State StateMachine<T,State,Event,Arg>::apply( T & t , Event event , const Arg &
|
||||
// look up in the multimap keyed on current-state + event
|
||||
//
|
||||
State state = m_state ;
|
||||
bool done = false ;
|
||||
Map::iterator p = m_map.find(event) ;
|
||||
for( ; !done && p != m_map.end() && (*p).first == event ; ++p )
|
||||
for( ; p != m_map.end() && (*p).first == event ; ++p )
|
||||
{
|
||||
if( (*p).second.from == m_any || (*p).second.from == m_state )
|
||||
{
|
||||
@ -243,10 +242,10 @@ State StateMachine<T,State,Event,Arg>::apply( T & t , Event event , const Arg &
|
||||
State alt_state = (*p).second.alt ;
|
||||
state = m_state = alt_state == m_same ? old_state : alt_state ;
|
||||
}
|
||||
done = true ;
|
||||
return state ;
|
||||
}
|
||||
}
|
||||
return done ? state : m_any ;
|
||||
return m_any ;
|
||||
}
|
||||
|
||||
} ; // namespace
|
||||
|
@ -16,7 +16,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
EXTRA_DIST=gclient_win32.cpp \
|
||||
gdescriptor_win32.cpp \
|
||||
|
@ -28,7 +28,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
@ -81,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -88,6 +88,13 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
EXTRA_DIST = gclient_win32.cpp gdescriptor_win32.cpp gevent_win32.cpp glocal_win32.cpp grequest.cpp gresolve_win32.cpp gsocket_win32.cpp gwinsock.cpp
|
||||
|
||||
@ -132,7 +139,7 @@ OBJECTS = $(libgnet_a_OBJECTS)
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .cpp .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/gnet/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
|
@ -335,7 +335,7 @@ std::string GNet::ClientImp::startConnecting( const Address & address , const st
|
||||
m_s = new StreamSocket ;
|
||||
if( !s().valid() )
|
||||
{
|
||||
return std::string( "error: cannot open socket" ) ;
|
||||
return std::string( "cannot open socket" ) ;
|
||||
}
|
||||
|
||||
// specifiy this as a 'write' event handler for the socket
|
||||
@ -380,7 +380,7 @@ GNet::ClientImp::Status GNet::ClientImp::connectCore( Address remote_address ,
|
||||
bool bound = s().bind(local_address) ;
|
||||
if( !bound )
|
||||
{
|
||||
error = "error: cannot bind socket" ;
|
||||
error = "cannot bind socket" ;
|
||||
return Retry ;
|
||||
}
|
||||
G_DEBUG( "GNet::ClientImp::connectCore: bound local address "
|
||||
@ -392,7 +392,7 @@ GNet::ClientImp::Status GNet::ClientImp::connectCore( Address remote_address ,
|
||||
if( !s().connect( remote_address , &immediate ) )
|
||||
{
|
||||
G_DEBUG( "GNet::ClientImp::connect: immediate failure" ) ;
|
||||
error = "error: cannot connect to " ;
|
||||
error = "cannot connect to " ;
|
||||
error.append( remote_address.displayString().c_str() ) ;
|
||||
|
||||
// we should return Failure here, but Microsoft's stack
|
||||
@ -433,7 +433,7 @@ void GNet::ClientImp::writeEvent()
|
||||
}
|
||||
else if( m_state == Connecting )
|
||||
{
|
||||
std::string message( "error: cannot connect to " ) ;
|
||||
std::string message( "cannot connect to " ) ;
|
||||
message.append( m_address.displayString().c_str() ) ;
|
||||
setState( Failed ) ;
|
||||
close() ;
|
||||
@ -492,12 +492,18 @@ void GNet::ClientImp::run()
|
||||
|
||||
std::pair<bool,GNet::Address> GNet::ClientImp::localAddress() const
|
||||
{
|
||||
return s().getLocalAddress() ;
|
||||
return
|
||||
m_s != NULL ?
|
||||
s().getLocalAddress() :
|
||||
std::make_pair(false,GNet::Address::invalidAddress()) ;
|
||||
}
|
||||
|
||||
std::pair<bool,GNet::Address> GNet::ClientImp::peerAddress() const
|
||||
{
|
||||
return s().getPeerAddress() ;
|
||||
return
|
||||
m_s != NULL ?
|
||||
s().getPeerAddress() :
|
||||
std::make_pair(false,GNet::Address::invalidAddress()) ;
|
||||
}
|
||||
|
||||
std::string GNet::ClientImp::peerName() const
|
||||
|
@ -106,7 +106,7 @@ void GNet::Monitor::report( std::ostream & s , const std::string & px , const st
|
||||
s << px << "clients destroyed: " << m_imp->m_client_removes << eol ;
|
||||
{
|
||||
for( MonitorImp::Clients::const_iterator p = m_imp->m_clients.begin() ;
|
||||
p != m_imp->m_clients.end() ; ++p )
|
||||
p != m_imp->m_clients.end() ; ++p )
|
||||
{
|
||||
s << px
|
||||
<< " client " << (const void *)(*p) << ": "
|
||||
|
@ -37,9 +37,9 @@ GNet::ServerPeer::ServerPeer( StreamSocket * s , Address a ) :
|
||||
{
|
||||
G_ASSERT( m_socket != NULL ) ;
|
||||
G_DEBUG( "GNet::ServerPeer::ctor: fd " << m_socket->asString() << ": " << m_address.displayString() ) ;
|
||||
if( Monitor::instance() ) Monitor::instance()->add(*this) ;
|
||||
m_socket->addReadHandler( *this ) ;
|
||||
m_socket->addExceptionHandler( *this ) ;
|
||||
if( Monitor::instance() ) Monitor::instance()->add(*this) ;
|
||||
}
|
||||
|
||||
GNet::ServerPeer::~ServerPeer()
|
||||
@ -117,8 +117,7 @@ std::pair<bool,GNet::Address> GNet::ServerPeer::localAddress() const
|
||||
|
||||
std::pair<bool,GNet::Address> GNet::ServerPeer::peerAddress() const
|
||||
{
|
||||
G_ASSERT( m_socket != NULL ) ;
|
||||
return m_socket->getPeerAddress() ;
|
||||
return std::pair<bool,Address>( true , m_address ) ;
|
||||
}
|
||||
|
||||
// ===
|
||||
|
@ -144,7 +144,6 @@ public:
|
||||
|
||||
virtual std::pair<bool,Address> peerAddress() const ;
|
||||
// Returns the peer address.
|
||||
// Pair.first is false on error.
|
||||
|
||||
protected:
|
||||
virtual ~ServerPeer() ;
|
||||
|
@ -16,21 +16,17 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
# force symbol stripping on 'make install'
|
||||
AM_INSTALL_PROGRAM_FLAGS=-s
|
||||
|
||||
# change the local-state directory from .../var to .../var/spool/emailrelay
|
||||
localstatedir = ${prefix}/var/spool/emailrelay
|
||||
|
||||
EXTRA_DIST=commandline_win32.cpp main_win32.cpp gmessagestore_win32.cpp emailrelay.dsp icon-32.ico icon2.ico icon3.ico icon4.ico empty_file doxygen.cfg emailrelay.rc resource.h gsasl_cyrus.cpp
|
||||
INCLUDES = -I$(top_srcdir)/lib/gcc2.95 -I$(top_srcdir)/src/glib -I$(top_srcdir)/src/gnet
|
||||
EXTRA_DIST=commandline_win32.cpp main_win32.cpp gmessagestore_win32.cpp emailrelay.dsw emailrelay.dsp common.dsp submit.dsp passwd.dsp icon-32.ico icon2.ico icon3.ico icon4.ico doxygen.cfg emailrelay.rc resource.h gsasl_cyrus.cpp messages.mc
|
||||
INCLUDES = -I$(top_srcdir)/lib/gcc2.95 -I$(top_srcdir)/src/glib -I$(top_srcdir)/src/gnet -DG_SPOOLDIR=\"$(e_spooldir)\"
|
||||
|
||||
noinst_LIBRARIES = libgsmtp.a
|
||||
sbin_PROGRAMS = emailrelay
|
||||
libexec_PROGRAMS = emailrelay-passwd emailrelay-poke emailrelay-submit
|
||||
localstate_DATA = empty_file
|
||||
e_sbin_PROGRAMS = emailrelay emailrelay-submit emailrelay-passwd
|
||||
e_libexec_PROGRAMS = emailrelay-poke
|
||||
e_spool_DATA =
|
||||
|
||||
libgsmtp_a_SOURCES = \
|
||||
gadminserver.cpp \
|
||||
@ -103,3 +99,12 @@ emailrelay_submit_LDADD = \
|
||||
$(top_builddir)/src/glib/libglib.a \
|
||||
$(top_builddir)/src/gnet/libgnet.a
|
||||
|
||||
install-data-local:
|
||||
-chgrp daemon $(DESTDIR)$(e_spooldir)
|
||||
-chmod 775 $(DESTDIR)$(e_spooldir)
|
||||
-chgrp daemon $(DESTDIR)$(e_sbindir)/emailrelay-submit
|
||||
-chmod g+s $(DESTDIR)$(e_sbindir)/emailrelay-submit
|
||||
|
||||
install-exec-local:
|
||||
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
# force symbol stripping on 'make install'
|
||||
|
||||
@ -47,6 +46,7 @@ libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
@ -82,6 +82,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -89,19 +90,23 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
AM_INSTALL_PROGRAM_FLAGS = -s
|
||||
|
||||
# change the local-state directory from .../var to .../var/spool/emailrelay
|
||||
localstatedir = ${prefix}/var/spool/emailrelay
|
||||
|
||||
EXTRA_DIST = commandline_win32.cpp main_win32.cpp gmessagestore_win32.cpp emailrelay.dsp icon-32.ico icon2.ico icon3.ico icon4.ico empty_file doxygen.cfg emailrelay.rc resource.h gsasl_cyrus.cpp
|
||||
INCLUDES = -I$(top_srcdir)/lib/gcc2.95 -I$(top_srcdir)/src/glib -I$(top_srcdir)/src/gnet
|
||||
EXTRA_DIST = commandline_win32.cpp main_win32.cpp gmessagestore_win32.cpp emailrelay.dsw emailrelay.dsp common.dsp submit.dsp passwd.dsp icon-32.ico icon2.ico icon3.ico icon4.ico doxygen.cfg emailrelay.rc resource.h gsasl_cyrus.cpp messages.mc
|
||||
INCLUDES = -I$(top_srcdir)/lib/gcc2.95 -I$(top_srcdir)/src/glib -I$(top_srcdir)/src/gnet -DG_SPOOLDIR=\"$(e_spooldir)\"
|
||||
|
||||
noinst_LIBRARIES = libgsmtp.a
|
||||
sbin_PROGRAMS = emailrelay
|
||||
libexec_PROGRAMS = emailrelay-passwd emailrelay-poke emailrelay-submit
|
||||
localstate_DATA = empty_file
|
||||
e_sbin_PROGRAMS = emailrelay emailrelay-submit emailrelay-passwd
|
||||
e_libexec_PROGRAMS = emailrelay-poke
|
||||
e_spool_DATA =
|
||||
|
||||
libgsmtp_a_SOURCES = gadminserver.cpp gadminserver.h gbase64.cpp gbase64.h gclientprotocol.cpp gclientprotocol.h gfilestore.cpp gfilestore.h gmessagestore.cpp gmessagestore.h gmessagestore_unix.cpp gnewfile.cpp gnewfile.h gnewmessage.cpp gnewmessage.h gprotocolmessage.cpp gprotocolmessage.h gprotocolmessageforward.cpp gprotocolmessageforward.h gprotocolmessagestore.cpp gprotocolmessagestore.h gsasl_native.cpp gsasl.h gsecrets.cpp gsecrets.h gserverprotocol.cpp gserverprotocol.h gsmtp.h gsmtpclient.cpp gsmtpclient.h gsmtpserver.cpp gsmtpserver.h gstoredfile.cpp gstoredfile.h gstoredmessage.cpp gstoredmessage.h gverifier.cpp gverifier.h gxtext.cpp gxtext.h
|
||||
|
||||
@ -138,23 +143,23 @@ gnewmessage.o gprotocolmessage.o gprotocolmessageforward.o \
|
||||
gprotocolmessagestore.o gsasl_native.o gsecrets.o gserverprotocol.o \
|
||||
gsmtpclient.o gsmtpserver.o gstoredfile.o gstoredmessage.o gverifier.o \
|
||||
gxtext.o
|
||||
PROGRAMS = $(libexec_PROGRAMS) $(sbin_PROGRAMS)
|
||||
PROGRAMS = $(e_libexec_PROGRAMS) $(e_sbin_PROGRAMS)
|
||||
|
||||
emailrelay_passwd_OBJECTS = passwd.o
|
||||
emailrelay_passwd_DEPENDENCIES = $(top_builddir)/src/glib/libglib.a
|
||||
emailrelay_passwd_LDFLAGS =
|
||||
emailrelay_poke_OBJECTS = poke.o
|
||||
emailrelay_poke_DEPENDENCIES =
|
||||
emailrelay_poke_LDFLAGS =
|
||||
emailrelay_submit_OBJECTS = submit.o legal.o
|
||||
emailrelay_submit_DEPENDENCIES = $(top_builddir)/src/main/libgsmtp.a \
|
||||
$(top_builddir)/src/glib/libglib.a $(top_builddir)/src/gnet/libgnet.a
|
||||
emailrelay_submit_LDFLAGS =
|
||||
emailrelay_OBJECTS = main_unix.o configuration.o legal.o run.o \
|
||||
commandline.o commandline_unix.o
|
||||
emailrelay_DEPENDENCIES = $(top_builddir)/src/main/libgsmtp.a \
|
||||
$(top_builddir)/src/glib/libglib.a $(top_builddir)/src/gnet/libgnet.a
|
||||
emailrelay_LDFLAGS =
|
||||
emailrelay_submit_OBJECTS = submit.o legal.o
|
||||
emailrelay_submit_DEPENDENCIES = $(top_builddir)/src/main/libgsmtp.a \
|
||||
$(top_builddir)/src/glib/libglib.a $(top_builddir)/src/gnet/libgnet.a
|
||||
emailrelay_submit_LDFLAGS =
|
||||
emailrelay_passwd_OBJECTS = passwd.o
|
||||
emailrelay_passwd_DEPENDENCIES = $(top_builddir)/src/glib/libglib.a
|
||||
emailrelay_passwd_LDFLAGS =
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
@ -163,7 +168,7 @@ CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DATA = $(localstate_DATA)
|
||||
DATA = $(e_spool_DATA)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
@ -172,13 +177,13 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(libgsmtp_a_SOURCES) $(emailrelay_passwd_SOURCES) $(emailrelay_poke_SOURCES) $(emailrelay_submit_SOURCES) $(emailrelay_SOURCES)
|
||||
OBJECTS = $(libgsmtp_a_OBJECTS) $(emailrelay_passwd_OBJECTS) $(emailrelay_poke_OBJECTS) $(emailrelay_submit_OBJECTS) $(emailrelay_OBJECTS)
|
||||
SOURCES = $(libgsmtp_a_SOURCES) $(emailrelay_poke_SOURCES) $(emailrelay_SOURCES) $(emailrelay_submit_SOURCES) $(emailrelay_passwd_SOURCES)
|
||||
OBJECTS = $(libgsmtp_a_OBJECTS) $(emailrelay_poke_OBJECTS) $(emailrelay_OBJECTS) $(emailrelay_submit_OBJECTS) $(emailrelay_passwd_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .cpp .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/main/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@ -219,91 +224,91 @@ libgsmtp.a: $(libgsmtp_a_OBJECTS) $(libgsmtp_a_DEPENDENCIES)
|
||||
$(AR) cru libgsmtp.a $(libgsmtp_a_OBJECTS) $(libgsmtp_a_LIBADD)
|
||||
$(RANLIB) libgsmtp.a
|
||||
|
||||
mostlyclean-libexecPROGRAMS:
|
||||
mostlyclean-e_libexecPROGRAMS:
|
||||
|
||||
clean-libexecPROGRAMS:
|
||||
-test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS)
|
||||
clean-e_libexecPROGRAMS:
|
||||
-test -z "$(e_libexec_PROGRAMS)" || rm -f $(e_libexec_PROGRAMS)
|
||||
|
||||
distclean-libexecPROGRAMS:
|
||||
distclean-e_libexecPROGRAMS:
|
||||
|
||||
maintainer-clean-libexecPROGRAMS:
|
||||
maintainer-clean-e_libexecPROGRAMS:
|
||||
|
||||
install-libexecPROGRAMS: $(libexec_PROGRAMS)
|
||||
install-e_libexecPROGRAMS: $(e_libexec_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libexecdir)
|
||||
@list='$(libexec_PROGRAMS)'; for p in $$list; do \
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_libexecdir)
|
||||
@list='$(e_libexec_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(e_libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(e_libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libexecPROGRAMS:
|
||||
uninstall-e_libexecPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(libexec_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
list='$(e_libexec_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(e_libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
done
|
||||
|
||||
mostlyclean-sbinPROGRAMS:
|
||||
mostlyclean-e_sbinPROGRAMS:
|
||||
|
||||
clean-sbinPROGRAMS:
|
||||
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
|
||||
clean-e_sbinPROGRAMS:
|
||||
-test -z "$(e_sbin_PROGRAMS)" || rm -f $(e_sbin_PROGRAMS)
|
||||
|
||||
distclean-sbinPROGRAMS:
|
||||
distclean-e_sbinPROGRAMS:
|
||||
|
||||
maintainer-clean-sbinPROGRAMS:
|
||||
maintainer-clean-e_sbinPROGRAMS:
|
||||
|
||||
install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||
install-e_sbinPROGRAMS: $(e_sbin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir)
|
||||
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_sbindir)
|
||||
@list='$(e_sbin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(e_sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(e_sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-sbinPROGRAMS:
|
||||
uninstall-e_sbinPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(sbin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
list='$(e_sbin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(e_sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
done
|
||||
|
||||
emailrelay-passwd: $(emailrelay_passwd_OBJECTS) $(emailrelay_passwd_DEPENDENCIES)
|
||||
@rm -f emailrelay-passwd
|
||||
$(CXXLINK) $(emailrelay_passwd_LDFLAGS) $(emailrelay_passwd_OBJECTS) $(emailrelay_passwd_LDADD) $(LIBS)
|
||||
|
||||
emailrelay-poke: $(emailrelay_poke_OBJECTS) $(emailrelay_poke_DEPENDENCIES)
|
||||
@rm -f emailrelay-poke
|
||||
$(LINK) $(emailrelay_poke_LDFLAGS) $(emailrelay_poke_OBJECTS) $(emailrelay_poke_LDADD) $(LIBS)
|
||||
|
||||
emailrelay: $(emailrelay_OBJECTS) $(emailrelay_DEPENDENCIES)
|
||||
@rm -f emailrelay
|
||||
$(CXXLINK) $(emailrelay_LDFLAGS) $(emailrelay_OBJECTS) $(emailrelay_LDADD) $(LIBS)
|
||||
|
||||
emailrelay-submit: $(emailrelay_submit_OBJECTS) $(emailrelay_submit_DEPENDENCIES)
|
||||
@rm -f emailrelay-submit
|
||||
$(CXXLINK) $(emailrelay_submit_LDFLAGS) $(emailrelay_submit_OBJECTS) $(emailrelay_submit_LDADD) $(LIBS)
|
||||
|
||||
emailrelay: $(emailrelay_OBJECTS) $(emailrelay_DEPENDENCIES)
|
||||
@rm -f emailrelay
|
||||
$(CXXLINK) $(emailrelay_LDFLAGS) $(emailrelay_OBJECTS) $(emailrelay_LDADD) $(LIBS)
|
||||
emailrelay-passwd: $(emailrelay_passwd_OBJECTS) $(emailrelay_passwd_DEPENDENCIES)
|
||||
@rm -f emailrelay-passwd
|
||||
$(CXXLINK) $(emailrelay_passwd_LDFLAGS) $(emailrelay_passwd_OBJECTS) $(emailrelay_passwd_LDADD) $(LIBS)
|
||||
.cpp.o:
|
||||
$(CXXCOMPILE) -c $<
|
||||
|
||||
install-localstateDATA: $(localstate_DATA)
|
||||
install-e_spoolDATA: $(e_spool_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(localstatedir)
|
||||
@list='$(localstate_DATA)'; for p in $$list; do \
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_spooldir)
|
||||
@list='$(e_spool_DATA)'; for p in $$list; do \
|
||||
if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(localstatedir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(localstatedir)/$$p; \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_spooldir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(e_spooldir)/$$p; \
|
||||
else if test -f $$p; then \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(localstatedir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(localstatedir)/$$p; \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(e_spooldir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(e_spooldir)/$$p; \
|
||||
fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-localstateDATA:
|
||||
uninstall-e_spoolDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(localstate_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(localstatedir)/$$p; \
|
||||
list='$(e_spool_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(e_spooldir)/$$p; \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
@ -422,9 +427,9 @@ gfilestore.o: gfilestore.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
gmessagestore.h gnewmessage.h gstoredmessage.h \
|
||||
../../src/glib/gstrings.h ../../src/glib/gpath.h \
|
||||
../../src/glib/gexception.h ../../src/glib/gdatetime.h \
|
||||
gnewfile.h gstoredfile.h ../../src/glib/gprocess.h \
|
||||
../../src/glib/gnoncopyable.h ../../src/glib/groot.h \
|
||||
../../src/glib/gprocess.h gnewfile.h gstoredfile.h \
|
||||
../../src/glib/gdirectory.h ../../src/glib/gmemory.h \
|
||||
../../src/glib/groot.h ../../src/glib/gnoncopyable.h \
|
||||
../../src/glib/gfile.h ../../src/glib/gstr.h \
|
||||
../../src/glib/gassert.h ../../src/glib/glogoutput.h
|
||||
gmessagestore.o: gmessagestore.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
@ -448,8 +453,8 @@ gnewfile.o: gnewfile.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
gnewmessage.h gstoredmessage.h ../../src/glib/gstrings.h \
|
||||
../../src/glib/gpath.h ../../src/glib/gexception.h gnewfile.h \
|
||||
gfilestore.h ../../src/glib/gdatetime.h \
|
||||
../../src/glib/gmemory.h ../../src/glib/gprocess.h \
|
||||
../../src/glib/groot.h ../../src/glib/gnoncopyable.h \
|
||||
../../src/glib/gnoncopyable.h ../../src/glib/groot.h \
|
||||
../../src/glib/gprocess.h ../../src/glib/gmemory.h \
|
||||
../../src/glib/gfile.h gxtext.h ../../src/glib/gassert.h \
|
||||
../../src/glib/glogoutput.h
|
||||
gnewmessage.o: gnewmessage.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
@ -565,10 +570,11 @@ gstoredfile.o: gstoredfile.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
gmessagestore.h gnewmessage.h gstoredmessage.h \
|
||||
../../src/glib/gstrings.h ../../src/glib/gpath.h \
|
||||
../../src/glib/gexception.h ../../src/glib/gdatetime.h \
|
||||
gstoredfile.h ../../src/glib/gmemory.h ../../src/glib/groot.h \
|
||||
../../src/glib/gprocess.h ../../src/glib/gnoncopyable.h \
|
||||
gxtext.h ../../src/glib/gfile.h ../../src/glib/gstr.h \
|
||||
../../src/glib/gassert.h ../../src/glib/glogoutput.h
|
||||
../../src/glib/gnoncopyable.h ../../src/glib/groot.h \
|
||||
../../src/glib/gprocess.h gstoredfile.h \
|
||||
../../src/glib/gmemory.h gxtext.h ../../src/glib/gfile.h \
|
||||
../../src/glib/gstr.h ../../src/glib/gassert.h \
|
||||
../../src/glib/glogoutput.h
|
||||
gstoredmessage.o: gstoredmessage.cpp ../../src/glib/gdef.h \
|
||||
../../config.h ../../lib/gcc2.95/iostream \
|
||||
../../lib/gcc2.95/sstream ../../lib/gcc2.95/xlocale \
|
||||
@ -601,13 +607,13 @@ main_unix.o: main_unix.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
../../src/glib/ggetopt.h ../../src/glib/gexception.h \
|
||||
../../src/gnet/geventloop.h ../../src/gnet/geventhandler.h \
|
||||
../../src/glib/gcredentials.h ../../src/glib/gdatetime.h \
|
||||
../../src/gnet/gdescriptor.h ../../src/glib/gdaemon.h \
|
||||
gmessagestore.h gnewmessage.h gstoredmessage.h gsmtpclient.h \
|
||||
gsecrets.h ../../src/gnet/glinebuffer.h \
|
||||
../../src/gnet/gclient.h ../../src/gnet/gaddress.h \
|
||||
../../src/gnet/gconnection.h ../../src/gnet/gsocket.h \
|
||||
../../src/gnet/gevent.h gclientprotocol.h gsasl.h \
|
||||
../../src/gnet/gtimer.h
|
||||
../../src/gnet/gdescriptor.h ../../src/glib/glogoutput.h \
|
||||
../../src/glib/gdaemon.h gmessagestore.h gnewmessage.h \
|
||||
gstoredmessage.h gsmtpclient.h gsecrets.h \
|
||||
../../src/gnet/glinebuffer.h ../../src/gnet/gclient.h \
|
||||
../../src/gnet/gaddress.h ../../src/gnet/gconnection.h \
|
||||
../../src/gnet/gsocket.h ../../src/gnet/gevent.h \
|
||||
gclientprotocol.h gsasl.h ../../src/gnet/gtimer.h
|
||||
passwd.o: passwd.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
../../lib/gcc2.95/iostream ../../lib/gcc2.95/sstream \
|
||||
../../lib/gcc2.95/xlocale ../../lib/gcc2.95/limits \
|
||||
@ -624,30 +630,34 @@ run.o: run.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
../../src/glib/ggetopt.h ../../src/glib/gexception.h \
|
||||
../../src/gnet/geventloop.h ../../src/gnet/geventhandler.h \
|
||||
../../src/glib/gcredentials.h ../../src/glib/gdatetime.h \
|
||||
../../src/gnet/gdescriptor.h ../../src/glib/gdaemon.h \
|
||||
gmessagestore.h gnewmessage.h gstoredmessage.h gsmtpclient.h \
|
||||
gsecrets.h ../../src/gnet/glinebuffer.h \
|
||||
../../src/gnet/gclient.h ../../src/gnet/gaddress.h \
|
||||
../../src/gnet/gconnection.h ../../src/gnet/gsocket.h \
|
||||
../../src/gnet/gevent.h gclientprotocol.h gsasl.h \
|
||||
../../src/gnet/gtimer.h gsmtpserver.h ../../src/gnet/gserver.h \
|
||||
../../src/gnet/gselect.h gverifier.h gserverprotocol.h \
|
||||
gprotocolmessage.h ../../src/glib/gstatemachine.h gfilestore.h \
|
||||
gnewfile.h gadminserver.h ../../src/gnet/gmonitor.h \
|
||||
../../src/gnet/glocal.h ../../src/glib/groot.h \
|
||||
../../src/glib/gprocess.h ../../src/glib/gnoncopyable.h \
|
||||
../../src/glib/gmemory.h ../../src/glib/glogoutput.h \
|
||||
../../src/glib/gdebug.h ../../src/glib/gassert.h
|
||||
../../src/gnet/gdescriptor.h ../../src/glib/glogoutput.h \
|
||||
../../src/glib/gdaemon.h gmessagestore.h gnewmessage.h \
|
||||
gstoredmessage.h gsmtpclient.h gsecrets.h \
|
||||
../../src/gnet/glinebuffer.h ../../src/gnet/gclient.h \
|
||||
../../src/gnet/gaddress.h ../../src/gnet/gconnection.h \
|
||||
../../src/gnet/gsocket.h ../../src/gnet/gevent.h \
|
||||
gclientprotocol.h gsasl.h ../../src/gnet/gtimer.h gsmtpserver.h \
|
||||
../../src/gnet/gserver.h ../../src/gnet/gselect.h gverifier.h \
|
||||
gserverprotocol.h gprotocolmessage.h \
|
||||
../../src/glib/gstatemachine.h gfilestore.h \
|
||||
../../src/glib/gnoncopyable.h ../../src/glib/groot.h \
|
||||
../../src/glib/gprocess.h gnewfile.h gadminserver.h \
|
||||
../../src/gnet/gmonitor.h ../../src/gnet/glocal.h \
|
||||
../../src/glib/gmemory.h ../../src/glib/gdebug.h \
|
||||
../../src/glib/gassert.h
|
||||
submit.o: submit.cpp ../../src/glib/gdef.h ../../config.h \
|
||||
../../lib/gcc2.95/iostream ../../lib/gcc2.95/sstream \
|
||||
../../lib/gcc2.95/xlocale ../../lib/gcc2.95/limits \
|
||||
../../src/gnet/gnet.h gsmtp.h ../../src/glib/glog.h \
|
||||
../../src/gnet/glocal.h ../../src/gnet/gaddress.h \
|
||||
../../src/glib/gexception.h ../../src/glib/garg.h \
|
||||
../../src/glib/gstrings.h ../../src/glib/gstr.h \
|
||||
../../src/glib/ggetopt.h ../../src/glib/gpath.h gfilestore.h \
|
||||
gmessagestore.h gnewmessage.h gstoredmessage.h \
|
||||
../../src/glib/gdatetime.h legal.h
|
||||
../../src/glib/gexception.h ../../src/gnet/geventloop.h \
|
||||
../../src/gnet/geventhandler.h ../../src/glib/gcredentials.h \
|
||||
../../src/glib/gdatetime.h ../../src/gnet/gdescriptor.h \
|
||||
../../src/glib/garg.h ../../src/glib/gstrings.h \
|
||||
../../src/glib/gstr.h ../../src/glib/ggetopt.h \
|
||||
../../src/glib/gpath.h gverifier.h gfilestore.h gmessagestore.h \
|
||||
gnewmessage.h gstoredmessage.h ../../src/glib/gnoncopyable.h \
|
||||
../../src/glib/groot.h ../../src/glib/gprocess.h legal.h
|
||||
|
||||
info-am:
|
||||
info: info-am
|
||||
@ -657,26 +667,26 @@ check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am: install-libexecPROGRAMS install-sbinPROGRAMS \
|
||||
install-localstateDATA
|
||||
install-exec-am: install-e_libexecPROGRAMS install-exec-local
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data-am: install-e_sbinPROGRAMS install-e_spoolDATA \
|
||||
install-data-local
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-libexecPROGRAMS uninstall-sbinPROGRAMS \
|
||||
uninstall-localstateDATA
|
||||
uninstall-am: uninstall-e_libexecPROGRAMS uninstall-e_sbinPROGRAMS \
|
||||
uninstall-e_spoolDATA
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(DATA)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(sbindir) \
|
||||
$(DESTDIR)$(localstatedir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(e_libexecdir) $(DESTDIR)$(e_sbindir) \
|
||||
$(DESTDIR)$(e_spooldir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
@ -689,27 +699,28 @@ distclean-generic:
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-libexecPROGRAMS mostlyclean-sbinPROGRAMS \
|
||||
mostlyclean-tags mostlyclean-generic
|
||||
mostlyclean-e_libexecPROGRAMS \
|
||||
mostlyclean-e_sbinPROGRAMS mostlyclean-tags \
|
||||
mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-noinstLIBRARIES clean-compile clean-libexecPROGRAMS \
|
||||
clean-sbinPROGRAMS clean-tags clean-generic \
|
||||
clean-am: clean-noinstLIBRARIES clean-compile clean-e_libexecPROGRAMS \
|
||||
clean-e_sbinPROGRAMS clean-tags clean-generic \
|
||||
mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-noinstLIBRARIES distclean-compile \
|
||||
distclean-libexecPROGRAMS distclean-sbinPROGRAMS \
|
||||
distclean-e_libexecPROGRAMS distclean-e_sbinPROGRAMS \
|
||||
distclean-tags distclean-generic clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
|
||||
maintainer-clean-compile \
|
||||
maintainer-clean-libexecPROGRAMS \
|
||||
maintainer-clean-sbinPROGRAMS maintainer-clean-tags \
|
||||
maintainer-clean-e_libexecPROGRAMS \
|
||||
maintainer-clean-e_sbinPROGRAMS maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@ -719,20 +730,30 @@ maintainer-clean: maintainer-clean-am
|
||||
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
|
||||
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-libexecPROGRAMS \
|
||||
distclean-libexecPROGRAMS clean-libexecPROGRAMS \
|
||||
maintainer-clean-libexecPROGRAMS uninstall-libexecPROGRAMS \
|
||||
install-libexecPROGRAMS mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \
|
||||
clean-sbinPROGRAMS maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \
|
||||
install-sbinPROGRAMS uninstall-localstateDATA install-localstateDATA \
|
||||
tags mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
|
||||
maintainer-clean-compile mostlyclean-e_libexecPROGRAMS \
|
||||
distclean-e_libexecPROGRAMS clean-e_libexecPROGRAMS \
|
||||
maintainer-clean-e_libexecPROGRAMS uninstall-e_libexecPROGRAMS \
|
||||
install-e_libexecPROGRAMS mostlyclean-e_sbinPROGRAMS \
|
||||
distclean-e_sbinPROGRAMS clean-e_sbinPROGRAMS \
|
||||
maintainer-clean-e_sbinPROGRAMS uninstall-e_sbinPROGRAMS \
|
||||
install-e_sbinPROGRAMS uninstall-e_spoolDATA install-e_spoolDATA tags \
|
||||
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
|
||||
distdir info-am info dvi-am dvi check check-am installcheck-am \
|
||||
installcheck install-exec-am install-exec install-data-am install-data \
|
||||
install-am install uninstall-am uninstall all-redirect all-am all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
installcheck install-exec-local install-exec-am install-exec \
|
||||
install-data-local install-data-am install-data install-am install \
|
||||
uninstall-am uninstall all-redirect all-am all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
install-data-local:
|
||||
-chgrp daemon $(DESTDIR)$(e_spooldir)
|
||||
-chmod 775 $(DESTDIR)$(e_spooldir)
|
||||
-chgrp daemon $(DESTDIR)$(e_sbindir)/emailrelay-submit
|
||||
-chmod g+s $(DESTDIR)$(e_sbindir)/emailrelay-submit
|
||||
|
||||
install-exec-local:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
@ -55,9 +55,12 @@ std::string Main::CommandLine::switchSpec()
|
||||
<< "i!pid-file!records the daemon process-id in the given file!1!pid-file|"
|
||||
<< "p!port!specifies the smtp listening port number!1!port|"
|
||||
<< "r!remote-clients!allows remote clients to connect!0!|"
|
||||
<< "s!spool-dir!specifies the spool directory " << "(default is \"" << dir << "\")!1!dir|"
|
||||
<< "v!verbose!generates more verbose logging " << "(if compiled-in and logging enabled and stderr open)!0!|"
|
||||
<< "V!version!displays version information and exits!0!"
|
||||
<< "s!spool-dir!specifies the spool directory (default is \"" << dir << "\")!1!dir|"
|
||||
<< "v!verbose!generates more verbose logging!0!|"
|
||||
<< "g!debug!generates debug-level logging (if compiled-in)!0!|"
|
||||
<< "V!version!displays version information and exits!0!|"
|
||||
<< "q!as-client!equivalent to \"--log --no-syslog --no-daemon --dont-serve --forward --forward-to\"!" << "1!host:port|"
|
||||
<< "d!as-server!equivalent to \"--log --close-stderr\"!0!"
|
||||
;
|
||||
return ss.str() ;
|
||||
}
|
||||
|
@ -37,9 +37,7 @@ std::string Main::CommandLine::osSwitchSpec()
|
||||
<< "l!log!writes log information on standard error (if open) and syslog (if not disabled)!0!|"
|
||||
<< "t!no-daemon!does not detach from the terminal!0!|"
|
||||
<< "u!user!names the effective user to switch to when started as root (default is \"daemon\")!1!username|"
|
||||
<< "n!no-syslog!disables syslog output!0!|"
|
||||
<< "q!as-client!equivalent to \"--log --no-syslog --no-daemon --dont-serve --forward --forward-to\"!" << "1!host:port|"
|
||||
<< "d!as-server!equivalent to \"--log --close-stderr\"!0!"
|
||||
<< "n!no-syslog!disables syslog output!0!"
|
||||
;
|
||||
return ss.str() ;
|
||||
}
|
||||
|
@ -38,9 +38,7 @@ std::string Main::CommandLine::osSwitchSpec()
|
||||
ss
|
||||
<< "l!log!writes log information on standard error (if open)!0!|"
|
||||
<< "t!no-daemon!use an ordinary window, not the system tray!0!|"
|
||||
<< "n!no-syslog!has no effect on windows!0!|"
|
||||
<< "q!as-client!equivalent to \"--log --no-daemon --dont-serve --forward --forward-to\"!" << "1!host:port|"
|
||||
<< "d!as-server!equivalent to \"--log --close-stderr\" (has little effect on windows)!0!|"
|
||||
<< "n!no-syslog!dont use the event log!0!|"
|
||||
<< "I!icon!selects the application icon!1!0^|1^|2^|3"
|
||||
;
|
||||
|
||||
|
404
src/main/common.dsp
Normal file
404
src/main/common.dsp
Normal file
@ -0,0 +1,404 @@
|
||||
# Microsoft Developer Studio Project File - Name="common" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=common - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "common.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "common.mak" CFG="common - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "common - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "common - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "common - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "CommonRelease"
|
||||
# PROP Intermediate_Dir "CommonRelease"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GR /GX /O2 /I "../../lib/msvc6.0" /I "../gnet" /I "../glib" /I "../win32" /D "NDEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "G_WIN32" /YX"gdef.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "common - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "CommonDebug"
|
||||
# PROP Intermediate_Dir "CommonDebug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "../../lib/msvc6.0" /I "../gnet" /I "../glib" /I "../win32" /D "_DEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "G_WIN32" /YX"gdef.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "common - Win32 Release"
|
||||
# Name "common - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gaddress_ipv4.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gadminserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gappbase.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gappinst.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\garg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\garg_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gbase64.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gclient.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gclient_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gclientprotocol.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gconnection.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gcontrol.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gcracker.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gdaemon.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gdaemon_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gdate.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gdatetime.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gdatetime_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gdescriptor_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gdialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gdirectory.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gdirectory_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gevent_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\geventhandler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\geventloop.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\geventserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gexception.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gfile_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gfilestore.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gfs_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\ggetopt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\glinebuffer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\glocal.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\glocal_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\glog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\glogoutput.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\glogoutput_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gmd5.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gmessagestore.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gmessagestore_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gmonitor.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gnewfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gnewmessage.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gpath.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gprocess_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gprotocolmessage.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gprotocolmessageforward.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gprotocolmessagestore.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gpump.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gpump_dialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\grequest.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gresolve.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gresolve_ipv4.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gresolve_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\groot.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gsasl_native.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gscmap.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gsecrets.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gserverprotocol.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gsmtpclient.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gsmtpserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gsocket.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gsocket_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gstoredfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gstoredmessage.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gstr.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gtime.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gtimer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gtray.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gverifier.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gwinbase.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gwindow.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gwinhid.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gwinsock.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=gxtext.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=legal.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -55,6 +55,7 @@ std::string Main::Configuration::str( const std::string & p , const std::string
|
||||
<< p << "run as daemon? " << yn(daemon()) << eol
|
||||
<< p << "log to stderr/syslog? " << yn(log()) << eol
|
||||
<< p << "verbose logging? " << yn(verbose()) << eol
|
||||
<< p << "debug logging? " << yn(debug()) << eol
|
||||
//<< p << "use syslog? " << yn(syslog()) << eol
|
||||
<< p << "close stderr? " << yn(closeStderr()) << eol
|
||||
<< p << "allow remote clients? " << yn(allowRemoteClients()) << eol
|
||||
@ -82,6 +83,11 @@ bool Main::Configuration::verbose() const
|
||||
return m_cl.contains("verbose") ;
|
||||
}
|
||||
|
||||
bool Main::Configuration::debug() const
|
||||
{
|
||||
return m_cl.contains("debug") ;
|
||||
}
|
||||
|
||||
bool Main::Configuration::syslog() const
|
||||
{
|
||||
return !m_cl.contains("no-syslog") && !m_cl.contains("as-client") ;
|
||||
|
@ -69,6 +69,9 @@ public:
|
||||
// Returns true if doing logging.
|
||||
|
||||
bool verbose() const ;
|
||||
// Returns true if doing verbose logging.
|
||||
|
||||
bool debug() const ;
|
||||
// Returns true if doing debug-level logging.
|
||||
|
||||
bool syslog() const ;
|
||||
|
30
src/main/doxygen.cfg
Normal file → Executable file
30
src/main/doxygen.cfg
Normal file → Executable file
@ -3,7 +3,7 @@
|
||||
# General configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = E-MailRelay
|
||||
PROJECT_NUMBER = 0.9.8
|
||||
PROJECT_NUMBER = 0.9.9
|
||||
OUTPUT_DIRECTORY =
|
||||
OUTPUT_LANGUAGE = English
|
||||
EXTRACT_ALL = YES
|
||||
@ -57,17 +57,21 @@ INPUT = __TOP_SRC__/src/glib \
|
||||
FILE_PATTERNS = *.cpp \
|
||||
*.h
|
||||
RECURSIVE = YES
|
||||
EXCLUDE = src/glib/gdef.h gdef.h \
|
||||
src/gnet/gnet.h gnet.h \
|
||||
src/win32 \
|
||||
src/gnet/resolverd.cpp resolverd.cpp \
|
||||
src/gnet/gwinsock.cpp gwinsock.cpp \
|
||||
src/gnet/gwinsock.h gwinsock.h \
|
||||
src/gnet/gaddress_ipv6.cpp gaddress_ipv6.cpp \
|
||||
src/gnet/gresolve_ipv6.cpp gresolve_ipv6.cpp \
|
||||
src/gnet/grequest.cpp grequest.cpp \
|
||||
src/gnet/grequest.h grequest.h
|
||||
EXCLUDE_PATTERNS = */*_win32.* */*_ipv6.cpp */old/* */resolverd.cpp */gsasl_cyrus.cpp
|
||||
EXCLUDE_PATTERNS = \
|
||||
*/win32/* \
|
||||
*/*_win32.* \
|
||||
*/*_ipv6.cpp \
|
||||
*/old/* \
|
||||
*/resolverd.cpp \
|
||||
*/gsasl_cyrus.cpp \
|
||||
*/gsasl_login.cpp \
|
||||
*/gdef.h \
|
||||
*/gnet.h \
|
||||
*/resolverd.cpp \
|
||||
*/gwinsock.* \
|
||||
*/grequest.* \
|
||||
*/submit.cpp \
|
||||
*/passwd.cpp
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
IMAGE_PATH =
|
||||
@ -83,7 +87,7 @@ IGNORE_PREFIX =
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML =
|
||||
HTML_OUTPUT = html
|
||||
HTML_OUTPUT = doxygen
|
||||
HTML_HEADER = __TOP_SRC__/doc/doxygen_header.html
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
|
@ -42,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /GR /GX /O2 /I "../glib" /I "../gnet" /I "../win32" /I "../../lib/msvc6.0" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "G_WIN32" /D "_CONSOLE" /YX"gdef.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /GR /GX /O2 /I "../win32" /I "../../lib/msvc6.0" /I "../gnet" /I "../glib" /D "NDEBUG" /D "G_WIN32" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /YX"gdef.h" /FD /c
|
||||
# SUBTRACT CPP /X
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
@ -68,7 +68,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "../../src/glib" /I "../../src/gnet" /I "../../lib/msvc6.0" /I "../../src/win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "G_WIN32" /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "../../src/glib" /I "../../src/gnet" /I "../../src/win32" /I "../../lib/msvc6.0" /I "../gnet" /I "../glib" /I "../win32" /D "_DEBUG" /D "G_WIN32" /D "WIN32" /D "_MBCS" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
@ -103,330 +103,6 @@ SOURCE=.\configuration.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gaddress_ipv4.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\main\gadminserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gappbase.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gappinst.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\garg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\garg_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gbase64.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gclient.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gclient_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\main\gclientprotocol.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gconnection.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gcontrol.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gcracker.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gdaemon.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gdaemon_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gdate.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gdatetime.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gdatetime_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gdescriptor_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gdialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gdirectory.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gdirectory_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gevent_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\geventhandler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\geventhandler.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\geventloop.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\geventloop.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\geventserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gexception.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gfile_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gfilestore.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gfs_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\ggetopt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\glinebuffer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\glocal.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\glocal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\glocal_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\glog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\glogoutput.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\glogoutput_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\gmd5.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\main\gmessagestore.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\main\gmessagestore_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gmonitor.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gnewfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gnewmessage.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gpath.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gprocess_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\main\gprotocolmessage.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gprotocolmessageforward.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gprotocolmessagestore.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gpump.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gpump_dialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\grequest.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gresolve.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gresolve_ipv4.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gresolve_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\glib\groot.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsasl_native.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gscmap.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gsecrets.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\main\gserverprotocol.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\main\gsmtpclient.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\main\gsmtpserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gsocket.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gsocket_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gstoredfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gstoredmessage.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gstr.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\glib\gtime.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\gnet\gtimer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gtray.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gverifier.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gwinbase.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gwindow.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\win32\gwinhid.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\gnet\gwinsock.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gxtext.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\legal.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\main_win32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -448,6 +124,59 @@ SOURCE=.\emailrelay.rc
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\icon-32.ico"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\icon2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\icon3.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\icon4.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\messages.mc
|
||||
|
||||
!IF "$(CFG)" == "emailrelay - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\messages.mc
|
||||
|
||||
BuildCmds= \
|
||||
mc messages.mc
|
||||
|
||||
"messages.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"messages.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "emailrelay - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
# Begin Custom Build
|
||||
InputPath=.\messages.mc
|
||||
|
||||
BuildCmds= \
|
||||
mc messages.mc
|
||||
|
||||
"messages.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"messages.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"msg00001.bin" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
|
74
src/main/emailrelay.dsw
Normal file
74
src/main/emailrelay.dsw
Normal file
@ -0,0 +1,74 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "common"=".\common.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "emailrelay"=".\emailrelay.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name common
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "passwd"=".\passwd.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name common
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "submit"=".\submit.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name common
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
@ -50,7 +50,7 @@ END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"#include <messages.rc>\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
@ -106,6 +106,52 @@ BEGIN
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,9,9,0
|
||||
PRODUCTVERSION 0,9,9,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x10004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "080904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", " \0"
|
||||
VALUE "FileDescription", "E-MailRelay Application\0"
|
||||
VALUE "FileVersion", "0, 9, 9, 0\0"
|
||||
VALUE "InternalName", "emailrelay\0"
|
||||
VALUE "LegalCopyright", "Copyright © Graeme Walker, 2002\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "emailrelay.rc\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "E-MailRelay\0"
|
||||
VALUE "ProductVersion", "0, 9, 9, 0\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x809, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
#endif // English (U.K.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -116,7 +162,7 @@ END
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
#include <messages.rc>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "gprocess.h"
|
||||
#include "gdirectory.h"
|
||||
#include "gmemory.h"
|
||||
#include "groot.h"
|
||||
#include "gpath.h"
|
||||
#include "gfile.h"
|
||||
#include "gstr.h"
|
||||
@ -119,14 +118,17 @@ std::string GSmtp::FileStore::format( int n )
|
||||
//static
|
||||
void GSmtp::FileStore::checkPath( const G::Path & directory_path )
|
||||
{
|
||||
G::Root claim_root ;
|
||||
// (void) G::File::mkdir( directory_path ) ;
|
||||
FileWriter claim_writer ;
|
||||
G::Directory dir_test( directory_path ) ;
|
||||
if( ! dir_test.valid() )
|
||||
|
||||
bool test_for_creation = false ;
|
||||
if( ! dir_test.valid(test_for_creation) )
|
||||
{
|
||||
throw InvalidDirectory( directory_path.str() ) ;
|
||||
}
|
||||
if( ! dir_test.valid(true) )
|
||||
|
||||
test_for_creation = true ;
|
||||
if( ! dir_test.valid(test_for_creation) )
|
||||
{
|
||||
G_WARNING( "GSmtp::MessageStore: "
|
||||
<< "directory not writable: \""
|
||||
@ -136,7 +138,7 @@ void GSmtp::FileStore::checkPath( const G::Path & directory_path )
|
||||
|
||||
std::auto_ptr<std::ostream> GSmtp::FileStore::stream( const G::Path & path )
|
||||
{
|
||||
G::Root claim_root ;
|
||||
FileWriter claim_writer ;
|
||||
std::auto_ptr<std::ostream> ptr(
|
||||
new std::ofstream( path.pathCstr() ,
|
||||
std::ios_base::binary | std::ios_base::out | std::ios_base::trunc ) ) ;
|
||||
@ -196,7 +198,7 @@ bool GSmtp::FileStore::empty() const
|
||||
|
||||
bool GSmtp::FileStore::emptyCore() const
|
||||
{
|
||||
G::Root claim_root ;
|
||||
FileReader claim_reader ;
|
||||
G::Directory dir( m_dir ) ;
|
||||
G::DirectoryIterator iter( dir , "*.envelope" ) ;
|
||||
const bool no_more = iter.error() || !iter.more() ;
|
||||
@ -205,7 +207,7 @@ bool GSmtp::FileStore::emptyCore() const
|
||||
|
||||
GSmtp::MessageStore::Iterator GSmtp::FileStore::iterator()
|
||||
{
|
||||
G::Root claim_root ;
|
||||
FileReader claim_reader ;
|
||||
return MessageStore::Iterator( new FileIterator(G::Directory(m_dir) ) ) ;
|
||||
}
|
||||
|
||||
@ -236,3 +238,28 @@ std::auto_ptr<GSmtp::NewMessage> GSmtp::FileStore::newMessage( const std::string
|
||||
return std::auto_ptr<NewMessage>( new NewFile(from,*this) ) ;
|
||||
}
|
||||
|
||||
// ===
|
||||
|
||||
GSmtp::FileReader::FileReader() :
|
||||
m_imp(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
GSmtp::FileReader::~FileReader()
|
||||
{
|
||||
}
|
||||
|
||||
// ===
|
||||
|
||||
GSmtp::FileWriter::FileWriter() :
|
||||
m_imp( new G::Root(false) )
|
||||
{
|
||||
G::Process::setUmask( false ) ;
|
||||
}
|
||||
|
||||
GSmtp::FileWriter::~FileWriter()
|
||||
{
|
||||
delete m_imp ;
|
||||
G::Process::setUmask( true ) ;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "gmessagestore.h"
|
||||
#include "gdatetime.h"
|
||||
#include "gexception.h"
|
||||
#include "gnoncopyable.h"
|
||||
#include "groot.h"
|
||||
#include "gpath.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@ -36,6 +38,8 @@
|
||||
namespace GSmtp
|
||||
{
|
||||
class FileStore ;
|
||||
class FileReader ;
|
||||
class FileWriter ;
|
||||
} ;
|
||||
|
||||
// Class: GSmtp::FileStore
|
||||
@ -115,5 +119,33 @@ private:
|
||||
unsigned long m_pid_modifier ;
|
||||
} ;
|
||||
|
||||
// Class: GSmtp::FileReader
|
||||
// Description: Used by GSmtp::FileStore, GSmtp::NewFile and
|
||||
// GSmtp::StoredFile to claim read permissions.
|
||||
// See also: G::Root
|
||||
//
|
||||
class GSmtp::FileReader : public G::noncopyable
|
||||
{
|
||||
public:
|
||||
FileReader() ;
|
||||
~FileReader() ;
|
||||
private:
|
||||
G::Root * m_imp ;
|
||||
} ;
|
||||
|
||||
// Class: GSmtp::FileWriter
|
||||
// Description: Used by GSmtp::FileStore, GSmtp::NewFile and
|
||||
// GSmtp::StoredFile to claim write permissions.
|
||||
// See also: G::Root
|
||||
//
|
||||
class GSmtp::FileWriter : public G::noncopyable
|
||||
{
|
||||
public:
|
||||
FileWriter() ;
|
||||
~FileWriter() ;
|
||||
private:
|
||||
G::Root * m_imp ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -26,9 +26,17 @@
|
||||
#include "gmessagestore.h"
|
||||
#include "gpath.h"
|
||||
|
||||
#ifndef G_SPOOLDIR
|
||||
#define G_SPOOLDIR ""
|
||||
#endif
|
||||
|
||||
//static
|
||||
G::Path GSmtp::MessageStore::defaultDirectory()
|
||||
{
|
||||
return G::Path( "/usr/local/var/spool/emailrelay" ) ;
|
||||
std::string spooldir( G_SPOOLDIR ) ;
|
||||
if( spooldir.empty() )
|
||||
spooldir = "/var/spool/emailrelay" ;
|
||||
|
||||
return G::Path( spooldir ) ;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ bool GSmtp::NewFile::store( const std::string & auth_id , const std::string & cl
|
||||
|
||||
// commit the envelope, or rollback the content
|
||||
//
|
||||
G::Root claim_root ;
|
||||
FileWriter claim_writer ;
|
||||
if( ! ok || ! G::File::rename(p0,p1,G::File::NoThrow() ) )
|
||||
{
|
||||
G_ASSERT( m_content_path.str().length() != 0U ) ;
|
||||
@ -176,10 +176,10 @@ void GSmtp::NewFile::deliver( const G::Strings & /*to*/ ,
|
||||
// could shell out to "procmail" or "deliver" here, but keep it
|
||||
// simple and within the scope of a "message-store" class
|
||||
|
||||
G_LOG( "GSmtp::NewMessage: copying message for local recipient(s): "
|
||||
G_LOG_S( "GSmtp::NewMessage: copying message for local recipient(s): "
|
||||
<< content_path.basename() << ".local" ) ;
|
||||
|
||||
G::Root claim_root ;
|
||||
FileWriter claim_writer ;
|
||||
G::File::copy( content_path.str() , content_path.str()+".local" ) ;
|
||||
G::File::copy( envelope_path_now.str() , envelope_path_later.str()+".local" ) ;
|
||||
}
|
||||
|
@ -70,8 +70,8 @@ bool GSmtp::ProtocolMessageStore::addTo( const std::string & to , Verifier::Stat
|
||||
G_ASSERT( m_msg.get() != NULL ) ;
|
||||
if( to.length() > 0U && m_msg.get() != NULL )
|
||||
{
|
||||
const bool is_local = to_status.first ;
|
||||
const bool is_valid = is_local && to_status.second.length() != 0U ;
|
||||
const bool is_local = to_status.is_local ;
|
||||
const bool is_valid = is_local && to_status.full_name.length() != 0U ;
|
||||
if( is_local && !is_valid )
|
||||
{
|
||||
G_WARNING( "GSmtp::ProtocolMessage: rejecting local recipent (not postmaster): " << to ) ;
|
||||
@ -79,7 +79,7 @@ bool GSmtp::ProtocolMessageStore::addTo( const std::string & to , Verifier::Stat
|
||||
}
|
||||
else
|
||||
{
|
||||
m_msg->addTo( to , is_local ) ;
|
||||
m_msg->addTo( to_status.address , is_local ) ;
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ namespace GSmtp
|
||||
|
||||
// Class: GSmtp::Sasl
|
||||
// Description: A singleton class representing the SASL library.
|
||||
// The SASL challenge/response concept is described in RFC2222.
|
||||
// See also: GSmtp::SaslClient, GSmtp::SaslServer, RFC2554, RFC2222
|
||||
//
|
||||
class GSmtp::Sasl
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ bool GSmtp::SaslServerImp::validate( const std::string & secret , const std::str
|
||||
G_WARNING( "GSmtp::SaslServer: exception: " << e.what() ) ;
|
||||
return false ;
|
||||
}
|
||||
catch( ... )
|
||||
catch(...)
|
||||
{
|
||||
G_WARNING( "GSmtp::SaslServer: exception" ) ;
|
||||
return false ;
|
||||
|
@ -146,9 +146,9 @@ void GSmtp::ServerProtocol::doVrfy( const std::string & line , bool & )
|
||||
{
|
||||
std::string mbox = parseMailbox( line ) ;
|
||||
Verifier::Status rc = m_verifier.verify( mbox ) ;
|
||||
bool local = rc.first ;
|
||||
if( local && rc.second.length() )
|
||||
sendVerified( rc.second ) ;
|
||||
bool local = rc.is_local ;
|
||||
if( local && rc.full_name.length() )
|
||||
sendVerified( rc.full_name ) ;
|
||||
else if( local )
|
||||
sendNotVerified( mbox ) ;
|
||||
else
|
||||
|
@ -157,7 +157,7 @@ bool GSmtp::Client::sendNext()
|
||||
std::auto_ptr<StoredMessage> message( m_iter.next() ) ;
|
||||
if( message.get() == NULL )
|
||||
{
|
||||
G_LOG( "GSmtp::Client: no more messages to send" ) ;
|
||||
G_LOG_S( "GSmtp::Client: no more messages to send" ) ;
|
||||
GNet::Socket * s = m_socket ;
|
||||
m_socket = NULL ;
|
||||
s->close() ;
|
||||
@ -231,7 +231,7 @@ void GSmtp::Client::onData( const char * data , size_t size )
|
||||
|
||||
void GSmtp::Client::onError( const std::string & error )
|
||||
{
|
||||
G_WARNING( "GSmtp::Client: error: \"" << error << "\"" ) ;
|
||||
G_WARNING( "GSmtp::Client: smtp client error: \"" << error << "\"" ) ;
|
||||
doCallback( std::string("error on connection to server: ") + error ) ;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ GSmtp::ServerPeer::ServerPeer( GNet::StreamSocket * socket , GNet::Address peer_
|
||||
m_pmessage( pmessage ) ,
|
||||
m_protocol( *this, m_verifier, *m_pmessage.get(), thishost(), peer_address.displayString(false) )
|
||||
{
|
||||
G_LOG( "GSmtp::ServerPeer: new connection from " << peer_address.displayString() ) ;
|
||||
G_LOG_S( "GSmtp::ServerPeer: new connection from " << peer_address.displayString() ) ;
|
||||
m_protocol.init( ident ) ;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ void GSmtp::ServerPeer::protocolSend( const std::string & line )
|
||||
|
||||
void GSmtp::ServerPeer::protocolDone()
|
||||
{
|
||||
G_LOG( "GSmtp::ServerPeer: disconnecting" ) ;
|
||||
G_LOG_S( "GSmtp::ServerPeer: disconnecting from " << peerAddress().second.displayString() ) ;
|
||||
doDelete() ; // onDelete() and "delete this"
|
||||
}
|
||||
|
||||
@ -135,6 +135,7 @@ GSmtp::Server::Server( unsigned int port , bool allow_remote , const std::string
|
||||
void GSmtp::Server::bind( GSmtp::ServerImp & gnet_server , GNet::Address address , unsigned int port )
|
||||
{
|
||||
address.setPort(port) ;
|
||||
G_LOG_S( "GSmtp::Server::bind: listening on " << address.displayString() ) ;
|
||||
gnet_server.init( address ) ;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "gfilestore.h"
|
||||
#include "gstoredfile.h"
|
||||
#include "gmemory.h"
|
||||
#include "groot.h"
|
||||
#include "gxtext.h"
|
||||
#include "gfile.h"
|
||||
#include "gstr.h"
|
||||
@ -35,7 +34,9 @@
|
||||
#include <fstream>
|
||||
|
||||
GSmtp::StoredFile::StoredFile( const G::Path & path ) :
|
||||
m_envelope_path(path)
|
||||
m_envelope_path(path) ,
|
||||
m_eight_bit(false) ,
|
||||
m_errors(0U)
|
||||
{
|
||||
G_DEBUG( "StoredFile: \"" << path << "\"" ) ;
|
||||
}
|
||||
@ -65,7 +66,7 @@ bool GSmtp::StoredFile::readEnvelope( std::string & reason , bool check )
|
||||
|
||||
void GSmtp::StoredFile::readEnvelopeCore( bool check )
|
||||
{
|
||||
G::Root claim_root ;
|
||||
FileReader claim_reader ;
|
||||
std::ifstream stream( m_envelope_path.str().c_str() , std::ios_base::binary | std::ios_base::in ) ;
|
||||
if( ! stream.good() )
|
||||
throw OpenError() ;
|
||||
@ -86,6 +87,8 @@ void GSmtp::StoredFile::readEnvelopeCore( bool check )
|
||||
|
||||
if( ! stream.good() )
|
||||
throw StreamError() ;
|
||||
|
||||
readReasons( stream ) ;
|
||||
}
|
||||
|
||||
void GSmtp::StoredFile::readFormat( std::istream & stream )
|
||||
@ -150,11 +153,22 @@ void GSmtp::StoredFile::readEnd( std::istream & stream )
|
||||
throw NoEnd() ;
|
||||
}
|
||||
|
||||
void GSmtp::StoredFile::readReasons( std::istream & stream )
|
||||
{
|
||||
m_errors = 0U ;
|
||||
while( stream.good() )
|
||||
{
|
||||
std::string reason = getline(stream) ;
|
||||
if( reason.find(FileStore::x()+"Reason") == 0U )
|
||||
m_errors++ ;
|
||||
}
|
||||
}
|
||||
|
||||
bool GSmtp::StoredFile::openContent( std::string & reason )
|
||||
{
|
||||
try
|
||||
{
|
||||
G::Root claim_root ;
|
||||
FileReader claim_reader ;
|
||||
G::Path content_path = contentPath() ;
|
||||
G_DEBUG( "GSmtp::FileStore::openContent: \"" << content_path << "\"" ) ;
|
||||
std::auto_ptr<std::istream> stream( new std::ifstream(
|
||||
@ -207,7 +221,7 @@ std::string GSmtp::StoredFile::crlf() const
|
||||
|
||||
bool GSmtp::StoredFile::lock()
|
||||
{
|
||||
G::Root claim_root ;
|
||||
FileWriter claim_writer ;
|
||||
G::Path & src = m_envelope_path ;
|
||||
G::Path dst( src.str() + ".busy" ) ;
|
||||
bool ok = G::File::rename( src , dst , G::File::NoThrow() ) ;
|
||||
@ -223,7 +237,7 @@ void GSmtp::StoredFile::fail( const std::string & reason )
|
||||
{
|
||||
try
|
||||
{
|
||||
G::Root claim_root ;
|
||||
FileWriter claim_writer ;
|
||||
|
||||
// write the reason into the file
|
||||
{
|
||||
@ -235,7 +249,7 @@ void GSmtp::StoredFile::fail( const std::string & reason )
|
||||
G::Path env_temp( m_envelope_path ) ; // "foo.envelope.busy"
|
||||
env_temp.removeExtension() ; // "foo.envelope"
|
||||
G::Path bad( env_temp.str() + ".bad" ) ; // "foo.envelope.bad"
|
||||
G_LOG( "GSmtp::StoredMessage: failing file: "
|
||||
G_LOG_S( "GSmtp::StoredMessage: failing file: "
|
||||
<< "\"" << m_envelope_path.basename() << "\" -> "
|
||||
<< "\"" << bad.basename() << "\"" ) ;
|
||||
|
||||
@ -250,7 +264,7 @@ void GSmtp::StoredFile::destroy()
|
||||
{
|
||||
try
|
||||
{
|
||||
G::Root claim_root ;
|
||||
FileWriter claim_writer ;
|
||||
G_LOG( "GSmtp::StoredMessage: deleting file: \"" << m_envelope_path.basename() << "\"" ) ;
|
||||
G::File::remove( m_envelope_path , G::File::NoThrow() ) ;
|
||||
|
||||
@ -293,7 +307,13 @@ size_t GSmtp::StoredFile::remoteRecipientCount() const
|
||||
return m_to_remote.size() ;
|
||||
}
|
||||
|
||||
size_t GSmtp::StoredFile::errorCount() const
|
||||
{
|
||||
return m_errors ;
|
||||
}
|
||||
|
||||
std::string GSmtp::StoredFile::authentication() const
|
||||
{
|
||||
return m_authentication ;
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,9 @@ public:
|
||||
virtual size_t remoteRecipientCount() const ;
|
||||
// From StoredMessage.
|
||||
|
||||
virtual size_t errorCount() const ;
|
||||
// From StoredMessage.
|
||||
|
||||
private:
|
||||
StoredFile( const StoredFile & ) ;
|
||||
void operator=( const StoredFile & ) ;
|
||||
@ -107,6 +110,7 @@ private:
|
||||
void readFrom( std::istream & stream ) ;
|
||||
void readToList( std::istream & stream ) ;
|
||||
void readEnd( std::istream & stream ) ;
|
||||
void readReasons( std::istream & stream ) ;
|
||||
void readAuthentication( std::istream & stream ) ;
|
||||
void readClientIp( std::istream & stream ) ;
|
||||
void readEnvelopeCore( bool ) ;
|
||||
@ -121,6 +125,7 @@ private:
|
||||
std::string m_authentication ;
|
||||
std::string m_format ;
|
||||
std::string m_client_ip ;
|
||||
size_t m_errors ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
@ -69,6 +69,9 @@ public:
|
||||
virtual size_t remoteRecipientCount() const = 0 ;
|
||||
// Returns the number of non-local recipients.
|
||||
|
||||
virtual size_t errorCount() const = 0 ;
|
||||
// Returns the number of accumulated submission errors.
|
||||
|
||||
virtual ~StoredMessage() ;
|
||||
// Destructor.
|
||||
|
||||
|
@ -46,21 +46,21 @@ GSmtp::Verifier::Status GSmtp::Verifier::verify( const std::string & address ) c
|
||||
G::Str::toUpper( host ) ;
|
||||
G::Str::toUpper( user ) ;
|
||||
|
||||
Status status ;
|
||||
status.is_local = false ;
|
||||
status.address = address ;
|
||||
if( user == "POSTMASTER" && ( host.empty() || host == "LOCALHOST" || host == fqdn ) )
|
||||
{
|
||||
// accept 'postmaster' for local delivery
|
||||
std::string full_name( "Local postmaster <postmaster@localhost>" ) ;
|
||||
return std::make_pair( true , full_name ) ;
|
||||
status.is_local = true ;
|
||||
status.full_name = "Local postmaster <postmaster@localhost>" ;
|
||||
status.address = "postmaster" ;
|
||||
}
|
||||
else if( host.empty() || host == "LOCALHOST" )
|
||||
{
|
||||
// reject local addressees
|
||||
return std::make_pair( true , std::string() ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
// forward
|
||||
return std::make_pair( false , std::string() ) ;
|
||||
status.is_local = true ;
|
||||
}
|
||||
return status ;
|
||||
}
|
||||
|
||||
|
@ -42,17 +42,30 @@ namespace GSmtp
|
||||
class GSmtp::Verifier
|
||||
{
|
||||
public:
|
||||
typedef std::pair<bool,std::string> Status ;
|
||||
struct Status
|
||||
{
|
||||
bool is_local ;
|
||||
std::string full_name ;
|
||||
std::string address ;
|
||||
} ;
|
||||
|
||||
std::pair<bool,std::string> verify( const std::string & recipient_address ) const ;
|
||||
Status verify( const std::string & recipient_address ) const ;
|
||||
// Checks a recipient address returning
|
||||
// <is-local>|<local-full-name>.
|
||||
// a structure which indicates whether the
|
||||
// address is local, what the full name is,
|
||||
// and the canonical address.
|
||||
//
|
||||
// If syntactically local then 'first' is
|
||||
// returned true. If local and valid then
|
||||
// 'second' is set to the full description.
|
||||
// If syntactically remote, then 'first'
|
||||
// is returned false and 'second' is empty.
|
||||
// If syntactically local then 'is_local' is
|
||||
// set true. If local and valid then
|
||||
// 'full_name' is set to the full description
|
||||
// and 'address' is set to the
|
||||
// canonical local address (without an
|
||||
// at sign).
|
||||
//
|
||||
// If syntactically remote, then 'is_local'
|
||||
// is set false, 'full_name' is empty,
|
||||
// and 'address' is copied from
|
||||
// 'recipient_address'.
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
@ -41,7 +41,7 @@ int main( int argc , char * argv [] )
|
||||
{
|
||||
std::cerr << G::Arg::prefix(argv) << ": exception: " << e.what() << std::endl ;
|
||||
}
|
||||
catch( ... )
|
||||
catch(...)
|
||||
{
|
||||
std::cerr << G::Arg::prefix(argv) << ": unrecognised exception" << std::endl ;
|
||||
}
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "gexception.h"
|
||||
#include "gmemory.h"
|
||||
#include "glog.h"
|
||||
#include "glogoutput.h"
|
||||
#include "gassert.h"
|
||||
|
||||
namespace
|
||||
@ -414,7 +413,6 @@ int WINAPI WinMain( HINSTANCE hinstance , HINSTANCE previous ,
|
||||
try
|
||||
{
|
||||
Run run( app , arg ) ;
|
||||
G::LogOutput log( run.cfg().log() , run.cfg().verbose() ) ;
|
||||
if( run.prepare() )
|
||||
{
|
||||
const bool visible = ! run.cfg().daemon() ;
|
||||
|
24
src/main/messages.mc
Normal file
24
src/main/messages.mc
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
MessageIdTypedef=DWORD
|
||||
|
||||
MessageId=1001
|
||||
Severity=Informational
|
||||
Facility=Application
|
||||
Language=English
|
||||
%1!s!
|
||||
.
|
||||
|
||||
MessageId=1002
|
||||
Severity=Warning
|
||||
Facility=Application
|
||||
Language=English
|
||||
%1!s!
|
||||
.
|
||||
|
||||
MessageId=1003
|
||||
Severity=Error
|
||||
Facility=Application
|
||||
Language=English
|
||||
%1!s!
|
||||
.
|
||||
|
@ -63,7 +63,7 @@ int main( int argc , char * argv [] )
|
||||
{
|
||||
std::cerr << arg.prefix() << ": exception: " << e.what() << std::endl ;
|
||||
}
|
||||
catch( ... )
|
||||
catch(...)
|
||||
{
|
||||
std::cerr << arg.prefix() << ": unknown exception" << std::endl ;
|
||||
}
|
||||
|
102
src/main/passwd.dsp
Normal file
102
src/main/passwd.dsp
Normal file
@ -0,0 +1,102 @@
|
||||
# Microsoft Developer Studio Project File - Name="passwd" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=passwd - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "passwd.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "passwd.mak" CFG="passwd - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "passwd - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "passwd - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "passwd - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "PasswdRelease"
|
||||
# PROP Intermediate_Dir "PasswdRelease"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GR /GX /O2 /I "../../lib/msvc6.0" /I "../gnet" /I "../glib" /I "../win32" /D "NDEBUG" /D "_CONSOLE" /D "G_WIN32" /D "WIN32" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "passwd - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "PasswdDebug"
|
||||
# PROP Intermediate_Dir "PasswdDebug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\glib" /I "../../lib/msvc6.0" /I "../gnet" /I "../glib" /I "../win32" /D "_DEBUG" /D "G_WIN32" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "passwd - Win32 Release"
|
||||
# Name "passwd - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\passwd.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -29,6 +29,9 @@
|
||||
#define IDI_ICON3 106
|
||||
#define IDI_ICON4 107
|
||||
#define IDC_EDIT1 1000
|
||||
#define IDS_EVENTLOG_INFORMATION 1001
|
||||
#define IDS_EVENTLOG_WARNING 1002
|
||||
#define IDS_EVENTLOG_ERROR 1003
|
||||
#define IDM_OPEN 40001
|
||||
#define IDM_QUIT 40002
|
||||
#define IDM_CLOSE 40005
|
||||
|
33
src/main/run.cpp
Normal file → Executable file
33
src/main/run.cpp
Normal file → Executable file
@ -48,7 +48,7 @@
|
||||
//static
|
||||
std::string Main::Run::versionNumber()
|
||||
{
|
||||
return "0.9.8" ;
|
||||
return "0.9.9" ;
|
||||
}
|
||||
|
||||
Main::Run::Run( const G::Arg & arg ) :
|
||||
@ -114,18 +114,39 @@ bool Main::Run::prepare()
|
||||
do_run = true ;
|
||||
}
|
||||
|
||||
// (prefix,output,log,verbose-log,debug,level,timestamp,strip-context)
|
||||
m_log_output <<= new G::LogOutput( m_arg.prefix() , cfg().log() , cfg().log() ,
|
||||
cfg().verbose() , cfg().debug() , true ,
|
||||
cfg().logTimestamp() , !cfg().debug() ) ;
|
||||
|
||||
return do_run ;
|
||||
}
|
||||
|
||||
void Main::Run::run()
|
||||
{
|
||||
// logging
|
||||
try
|
||||
{
|
||||
runCore() ;
|
||||
G_LOG( "Main::Run::run: done" ) ;
|
||||
}
|
||||
catch( std::exception & e )
|
||||
{
|
||||
G_LOG( "Main::Run::run: exception: " << e.what() ) ;
|
||||
throw ;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
G_LOG( "Main::Run::run: unknown exception" ) ;
|
||||
throw ;
|
||||
}
|
||||
}
|
||||
|
||||
void Main::Run::runCore()
|
||||
{
|
||||
// syslog initialisation
|
||||
//
|
||||
G::LogOutput log( cfg().log() , cfg().verbose() ) ;
|
||||
if( cfg().syslog() )
|
||||
log.syslog(G::LogOutput::Mail) ;
|
||||
if( cfg().logTimestamp() )
|
||||
log.timestamp() ;
|
||||
G::LogOutput::instance()->syslog(G::LogOutput::Mail) ;
|
||||
|
||||
// fqdn override option
|
||||
//
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "configuration.h"
|
||||
#include "commandline.h"
|
||||
#include "geventloop.h"
|
||||
#include "glogoutput.h"
|
||||
#include "gdaemon.h"
|
||||
#include "garg.h"
|
||||
#include "gmessagestore.h"
|
||||
@ -97,6 +98,7 @@ private:
|
||||
|
||||
private:
|
||||
std::auto_ptr<CommandLine> m_cl ;
|
||||
std::auto_ptr<G::LogOutput> m_log_output ;
|
||||
G::Arg m_arg ;
|
||||
} ;
|
||||
|
||||
|
@ -35,11 +35,13 @@
|
||||
#include "gsmtp.h"
|
||||
#include "glocal.h"
|
||||
#include "gaddress.h"
|
||||
#include "geventloop.h"
|
||||
#include "garg.h"
|
||||
#include "gstrings.h"
|
||||
#include "gstr.h"
|
||||
#include "ggetopt.h"
|
||||
#include "gpath.h"
|
||||
#include "gverifier.h"
|
||||
#include "gfilestore.h"
|
||||
#include "gnewmessage.h"
|
||||
#include "gexception.h"
|
||||
@ -81,12 +83,13 @@ static void process( const G::Path & path , std::istream & stream ,
|
||||
|
||||
// add "To:" lines to the envelope
|
||||
//
|
||||
GSmtp::Verifier verifier ;
|
||||
for( G::Strings::const_iterator to_p = to_list.begin() ; to_p != to_list.end() ; ++to_p )
|
||||
{
|
||||
std::string to = *to_p ;
|
||||
G::Str::trim( to , " \t\r\n" ) ;
|
||||
const bool is_local = false ;
|
||||
msg->addTo( to , is_local ) ;
|
||||
GSmtp::Verifier::Status status = verifier.verify( to ) ;
|
||||
msg->addTo( status.address , status.is_local ) ;
|
||||
}
|
||||
|
||||
// stream out the header
|
||||
@ -152,6 +155,9 @@ static void run( const G::Arg & arg )
|
||||
}
|
||||
else
|
||||
{
|
||||
std::auto_ptr<GNet::EventLoop> event_loop( GNet::EventLoop::create() ) ;
|
||||
event_loop->init() ;
|
||||
|
||||
G::Path path = GSmtp::MessageStore::defaultDirectory() ;
|
||||
if( getopt.contains("spool-dir") )
|
||||
path = getopt.value("spool-dir") ;
|
||||
|
102
src/main/submit.dsp
Normal file
102
src/main/submit.dsp
Normal file
@ -0,0 +1,102 @@
|
||||
# Microsoft Developer Studio Project File - Name="submit" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=submit - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "submit.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "submit.mak" CFG="submit - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "submit - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "submit - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "submit - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "SubmitRelease"
|
||||
# PROP Intermediate_Dir "SubmitRelease"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GR /GX /O2 /I "../../lib/msvc6.0" /I "../gnet" /I "../glib" /I "../win32" /D "NDEBUG" /D "_CONSOLE" /D "G_WIN32" /D "WIN32" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "submit - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "SubmitDebug"
|
||||
# PROP Intermediate_Dir "SubmitDebug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\glib" /I "../../lib/msvc6.0" /I "../gnet" /I "../glib" /I "../win32" /D "_DEBUG" /D "G_WIN32" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "submit - Win32 Release"
|
||||
# Name "submit - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\submit.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -16,7 +16,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
EXTRA_DIST = \
|
||||
gappinst.cpp \
|
||||
|
@ -28,7 +28,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# ===
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
@ -81,6 +80,7 @@ AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
GZIP = @GZIP@
|
||||
HAVE_DOXYGEN = @HAVE_DOXYGEN@
|
||||
HAVE_MAN2HTML = @HAVE_MAN2HTML@
|
||||
MAKE = @MAKE@
|
||||
@ -88,6 +88,13 @@ MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
e_docdir = @e_docdir@
|
||||
e_examplesdir = @e_examplesdir@
|
||||
e_initdir = @e_initdir@
|
||||
e_libexecdir = @e_libexecdir@
|
||||
e_man1dir = @e_man1dir@
|
||||
e_sbindir = @e_sbindir@
|
||||
e_spooldir = @e_spooldir@
|
||||
|
||||
EXTRA_DIST = gappinst.cpp gappinst.h gappbase.cpp gappbase.h gcracker.cpp gcracker.h gdialog.cpp gdialog.h gcontrol.cpp gcontrol.h gpump.cpp gpump.h gpump_dialog.cpp gscmap.h gscmap.cpp gsize.h gtray.h gtray.cpp gwinbase.cpp gwinbase.h gwindow.cpp gwindow.h gwinhid.cpp gwinhid.h
|
||||
|
||||
@ -103,7 +110,7 @@ TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/win32/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
|
Loading…
x
Reference in New Issue
Block a user