Skip to content

Commit

Permalink
Move spool directory to /var/spool/nullmailer, like other MTAs
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceg committed Jan 21, 2016
1 parent 1ff9b88 commit 0aa7132
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
localstatedir = @localstatedir@/nullmailer
localstatedir = @localstatedir@/spool/nullmailer
sysconfdir = @sysconfdir@/nullmailer

EXTRA_DIST = BUGS HOWTO INSTALL TODO spec \
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Changes in version 2.0
- Fixed nullmailer-inject and -queue to handle the null (empty) sender
address. Needed for RFC 3798 (Message Disposition Notification).

- Moved spool directory to /var/spool/nullmailer like other MTAs.

Development of this version has been sponsored by FutureQuest, Inc.
ossi@FutureQuest.net http://www.FutureQuest.net/
-------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions doc/nullmailer-queue.8
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ If this file is not empty, its contents will override the envelope
sender on all messages.
.SH OTHER FILES
.TP
.B /var/nullmailer/queue
.B /var/spool/nullmailer/queue
The directory into which the completed messages are moved.
.TP
.B /var/nullmailer/tmp
.B /var/spool/nullmailer/tmp
The directory in which messages are formed temporarily.
.TP
.B /var/nullmailer/trigger
.B /var/spool/nullmailer/trigger
A pipe used to trigger
.BR nullmailer-send
to immediately start sending the message from the queue.
Expand Down
6 changes: 3 additions & 3 deletions doc/nullmailer-send.8
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ Don't abort a TLS connection if the server certificate fails validation.
Use this only if you know the server uses an invalid certificate.
.SH FILES
.TP
.B /var/nullmailer/failed
.B /var/spool/nullmailer/failed
The failed message queue.
.TP
.B /var/nullmailer/queue
.B /var/spool/nullmailer/queue
The outgoing message queue.
.TP
.B /var/nullmailer/trigger
.B /var/spool/nullmailer/trigger
A trigger file to cause immediate delivery.
.TP
.B /usr/local/etc/nullmailer
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ libnullmailer.a: mergelib.sh libmisc.a fdbuf/libfdbuf.a \
defines.cc: Makefile make_defines.sh
@echo Creating defines.cc
@sh $(srcdir)/make_defines.sh \
@localstatedir@/nullmailer \
@localstatedir@/spool/nullmailer \
@sysconfdir@/nullmailer \
@libexecdir@/nullmailer \
@bindir@ \
Expand Down
4 changes: 2 additions & 2 deletions scripts/nullmailer.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Description=Nullmailer relay-only MTA
Requires=network.target
After=local-fs.target
ConditionPathExists=/var/nullmailer/queue
ConditionPathExists=/var/spool/nullmailer/queue
ConditionPathExists=/etc/nullmailer/defaultdomain
ConditionPathExists=/etc/nullmailer/me

[Service]
WorkingDirectory=/var/nullmailer
WorkingDirectory=/var/spool/nullmailer
ExecStart=/usr/sbin/nullmailer-send
User=nullmail
Group=nullmail
Expand Down
11 changes: 6 additions & 5 deletions spec
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ make
rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc
mkdir -p $RPM_BUILD_ROOT/usr/lib
mkdir -p $RPM_BUILD_ROOT/var/nullmailer/service/log
mkdir -p $RPM_BUILD_ROOT/var/service/nullmailer/log
mkdir -p $RPM_BUILD_ROOT/var/log/nullmailer

make DESTDIR=$RPM_BUILD_ROOT install-strip
ln -s ../sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
install scripts/nullmailer.run $RPM_BUILD_ROOT/var/nullmailer/service/run
install scripts/nullmailer-log.run $RPM_BUILD_ROOT/var/nullmailer/service/log/run
install scripts/nullmailer.run $RPM_BUILD_ROOT/var/service/nullmailer/run
install scripts/nullmailer-log.run $RPM_BUILD_ROOT/var/service/nullmailer/log/run

%clean
rm -rf $RPM_BUILD_ROOT
Expand All @@ -55,7 +55,7 @@ fi

%post
if ! [ -L /service/nullmailer ]; then
svc-add /var/nullmailer/service nullmailer
svc-add /var/service/nullmailer
fi
if ! [ -s /etc/nullmailer/me ]; then
/bin/hostname --fqdn >/etc/nullmailer/me
Expand Down Expand Up @@ -91,4 +91,5 @@ fi
/usr/sbin/nullmailer-send
/usr/sbin/sendmail
%dir /var/log/nullmailer
/var/nullmailer
/var/service/nullmailer
/var/spool/nullmailer
2 changes: 1 addition & 1 deletion test/functions.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
srcdir=@SRCDIR@
tmpdir=@TMPDIR@
SYSCONFDIR=@TMPDIR@/etc/nullmailer
QUEUEDIR=@TMPDIR@/var/nullmailer
QUEUEDIR=@TMPDIR@/var/spool/nullmailer
rm -rf $tmpdir
mkdir -p \
$QUEUEDIR/{failed,queue,tmp} \
Expand Down
8 changes: 4 additions & 4 deletions test/tests/inject/queue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
echo 'Testing that inject queues messages properly.'

echo 'To: nobody' | inject
test $( ls $tmpdir/var/nullmailer/queue | wc -l ) = 1
egrep -i '^to: *nobody' $tmpdir/var/nullmailer/queue/* >/dev/null
test $( ls $tmpdir/var/spool/nullmailer/queue | wc -l ) = 1
egrep -i '^to: *nobody' $tmpdir/var/spool/nullmailer/queue/* >/dev/null

echo 'Testing that inject honors $NULLMAILER_QUEUE.'

rm -f $tmpdir/var/nullmailer/queue/*
rm -f $tmpdir/var/spool/nullmailer/queue/*
NULLMAILER_QUEUE=/bin/cat
echo 'To: nobody' | inject >/dev/null
test $( ls $tmpdir/var/nullmailer/queue | wc -l ) = 0
test $( ls $QUEUEDIR/queue | wc -l ) = 0
4 changes: 2 additions & 2 deletions test/tests/queue/rewrite
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
que() {
set -e
../src/nullmailer-queue && \
cat $tmpdir/var/nullmailer/queue/* && \
rm -f $tmpdir/var/nullmailer/queue/*
cat $QUEUEDIR/queue/* && \
rm -f $QUEUEDIR/queue/*
}
que-recip() {
set -e
Expand Down
2 changes: 1 addition & 1 deletion test/tests/smtpd
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ diff -u - $out <<EOF
EOF

echo ' testing queued message envelope'
qf=$tmpdir/var/nullmailer/queue/*
qf=$QUEUEDIR/queue/*
grep -q '^f@example.com$' $qf
grep -q '^r@example.com$' $qf
grep -q '^r2@example.com$' $qf
Expand Down

0 comments on commit 0aa7132

Please sign in to comment.