people/ms/dma.git
16 months agoMerge pull request #34 from mtremer/better-authentication master
Simon Schubert [Mon, 12 Feb 2018 17:49:29 +0000 (18:49 +0100)]
Merge pull request #34 from mtremer/better-authentication

Parse EHLO response and use for authentication

16 months agoMerge pull request #57 from mtremer/better-tls
Simon Schubert [Sun, 11 Feb 2018 21:02:28 +0000 (22:02 +0100)]
Merge pull request #57 from mtremer/better-tls

crypto: Don't limit to TLSv1 only

16 months agocrypto: Don't limit to TLSv1 only better-tls
Michael Tremer [Sun, 11 Feb 2018 11:05:43 +0000 (11:05 +0000)]
crypto: Don't limit to TLSv1 only

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
21 months agocorrect spelling mistake
Edward Betts [Fri, 1 Sep 2017 13:41:51 +0000 (14:41 +0100)]
correct spelling mistake

2 years agouse basename to select executable identity
Mask66 [Fri, 10 Feb 2017 17:36:29 +0000 (18:36 +0100)]
use basename to select executable identity

We ran into problems calling dma (on FreeBSD) from the nagios check_mailq script, and found out that it behaves correctly when called as just "mailq", but incorrectly when called as "/usr/bin/mailq" (with a path) for example. This patch written by my colleague Klaus-Uwe Ittner corrects this.

Also reported as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216910.

2 years agodma-mbox-create: refactor to use a /var/mail directory fd
Ed Maste [Thu, 29 Sep 2016 21:25:36 +0000 (17:25 -0400)]
dma-mbox-create: refactor to use a /var/mail directory fd

Based on a patch to Capsicumize dma-mbox-create for FreeBSD by
cem@FreeBSD.org, in https://reviews.freebsd.org/D7988

2 years agofix 'cannt' typo in error message
Ed Maste [Thu, 29 Sep 2016 21:17:04 +0000 (17:17 -0400)]
fix 'cannt' typo in error message

2 years agodma - Fix security hole (#46)
Zach Crownover [Fri, 5 Aug 2016 22:24:27 +0000 (15:24 -0700)]
dma - Fix security hole (#46)

Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
finding out from BSDNow Episode 152. Comments following were from his commit
which explains better than I. Just taking his change and putting it here as well.

* dma makes an age-old mistake of not properly checking whether a file
  owned by a user is a symlink or not, a bug which the original mail.local
  also had.

* Add O_NOFOLLOW to disallow symlinks.

Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
           about the mail.local bug.

3 years agoMerge pull request #41 from Gottox/fix-musl
Simon Schubert [Mon, 16 May 2016 16:19:37 +0000 (18:19 +0200)]
Merge pull request #41 from Gottox/fix-musl

Include <sys/param.h> for roundup() declaration with musl libc

3 years agoInclude <sys/param.h> for roundup() declaration with musl libc
Enno Boland [Mon, 16 May 2016 15:10:42 +0000 (17:10 +0200)]
Include <sys/param.h> for roundup() declaration with musl libc

3 years agoIncrease error message size
duraseb [Sat, 21 Nov 2015 17:55:44 +0000 (18:55 +0100)]
Increase error message size

3 years agoAdded recipient email addresses to log
duraseb [Thu, 19 Nov 2015 16:11:25 +0000 (17:11 +0100)]
Added recipient email addresses to log

3 years agoIgnore some files
duraseb [Thu, 19 Nov 2015 12:11:40 +0000 (13:11 +0100)]
Ignore some files

3 years agoClose connections on failure
duraseb [Thu, 19 Nov 2015 08:43:35 +0000 (09:43 +0100)]
Close connections on failure

3 years agorelease dma 0.11
Simon Schubert [Sun, 7 Feb 2016 12:41:49 +0000 (13:41 +0100)]
release dma 0.11

3 years agolocal: use space instead of tab in "From " separator
Simon Schubert [Sat, 30 Jan 2016 09:17:14 +0000 (10:17 +0100)]
local: use space instead of tab in "From " separator

Submitted-by: Gregor Larson
3 years agoImplement better authentication better-authentication
Michael Tremer [Mon, 9 Nov 2015 21:52:08 +0000 (21:52 +0000)]
Implement better authentication

DMA tries to authenticate by simply trying various authentication
mechanisms. This is obviously not conforming to RFC and some mail
providers detect this is spam and reject all emails.

This patch parses the EHLO response and reads various keywords
from it that can then later in the program be used to jump into
certain code paths.

Currently this is used to only authenticate with CRAM-MD5 and/or
LOGIN if the server supports one or both of these. The
implementation can be easily be extended though.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 years agorelease dma 0.10
Simon Schubert [Fri, 25 Sep 2015 21:45:29 +0000 (23:45 +0200)]
release dma 0.10

4 years agodns: do not treat unreachable DNS server as permanent error
Andreas Schweitzer [Wed, 3 Jun 2015 21:33:38 +0000 (23:33 +0200)]
dns: do not treat unreachable DNS server as permanent error

getaddrinfo() does not distinguish between "DNS server not reachable"
and "DNS server told me host does not exist". For SMARTHOSTS it is
better to defer than to bounce in order to survive network outages.

Bug: fixes #30

4 years agoMerge pull request #28 from mp39590/freebsd_build
corecode [Wed, 8 Apr 2015 11:09:06 +0000 (13:09 +0200)]
Merge pull request #28 from mp39590/freebsd_build

Fix build on FreeBSD

4 years agoMerge pull request #27 from mp39590/sysexits
corecode [Wed, 8 Apr 2015 11:08:50 +0000 (13:08 +0200)]
Merge pull request #27 from mp39590/sysexits

use proper sysexits(3) codes

4 years agoFix build on FreeBSD
Mikhail [Wed, 8 Apr 2015 10:19:50 +0000 (13:19 +0300)]
Fix build on FreeBSD

4 years agoInitial version
Mikhail [Tue, 7 Apr 2015 13:21:49 +0000 (16:21 +0300)]
Initial version

4 years agoChange BSD Makefiles so dma-mbox-create can be built
Antonio Huete Jimenez [Wed, 18 Mar 2015 16:49:01 +0000 (17:49 +0100)]
Change BSD Makefiles so dma-mbox-create can be built

4 years agoMove declarations to dma header file
Antonio Huete Jimenez [Wed, 18 Mar 2015 16:20:28 +0000 (17:20 +0100)]
Move declarations to dma header file

4 years agoAdd more information to "bad mail input format" error
Daniel Hahler [Mon, 22 Sep 2014 16:35:53 +0000 (18:35 +0200)]
Add more information to "bad mail input format" error

Ref: https://github.com/corecode/dma/issues/18

5 years agoupdate copyright notice
Simon Schubert [Fri, 21 Feb 2014 16:18:28 +0000 (17:18 +0100)]
update copyright notice

5 years agodrop debian directory, they maintain it themselves
Simon Schubert [Fri, 21 Feb 2014 16:11:52 +0000 (17:11 +0100)]
drop debian directory, they maintain it themselves

5 years agodeliver_remote: only require host when not using smarthost
Simon Schubert [Thu, 13 Feb 2014 16:44:43 +0000 (17:44 +0100)]
deliver_remote: only require host when not using smarthost

5 years agoAdd NULLCLIENT support
Baptiste Daroussin [Wed, 12 Feb 2014 23:43:48 +0000 (00:43 +0100)]
Add NULLCLIENT support

5 years agoflushspool: use O_TRUNC instead of utimes(2)
Simon Schubert [Thu, 25 Jul 2013 21:22:24 +0000 (23:22 +0200)]
flushspool: use O_TRUNC instead of utimes(2)

utimes(2) only works if the file is owned by the current user.  Use
open(..., O_TRUNC|...) instead, together with a group writable flush
file.

5 years agodma.8: mandoc fixes + correct mail address
Simon Schubert [Mon, 22 Jul 2013 19:54:07 +0000 (21:54 +0200)]
dma.8: mandoc fixes + correct mail address

Submitted-by: Sascha Wildner <saw@online.de>
5 years agonewaliases: provide command alias
Simon Schubert [Sat, 6 Jul 2013 19:02:18 +0000 (21:02 +0200)]
newaliases: provide command alias

`newaliases' simply checks the aliases file and ignores any other
argument.

Submitted-by: Arno Töll <arno@debian.org>
5 years agoaliases: log errors to syslog and abort
Simon Schubert [Sat, 6 Jul 2013 19:00:05 +0000 (21:00 +0200)]
aliases: log errors to syslog and abort

5 years agoset_from: always fully qualify envelope from
Simon Schubert [Sat, 6 Jul 2013 17:22:44 +0000 (19:22 +0200)]
set_from: always fully qualify envelope from

Debian-bug: #697871

6 years agorelease dma 0.9
Simon Schubert [Mon, 3 Jun 2013 14:03:15 +0000 (16:03 +0200)]
release dma 0.9

6 years agoMerge pull request #14 from emaste/master
corecode [Wed, 21 Nov 2012 17:56:37 +0000 (09:56 -0800)]
Merge pull request #14 from emaste/master

Build fix for BSDmakefile

6 years agoMore detailed error message for tmp file failure.
Ed Maste [Wed, 21 Nov 2012 14:54:19 +0000 (09:54 -0500)]
More detailed error message for tmp file failure.

6 years agoAdd CONF_DIR, as in Makefile
Ed Maste [Wed, 21 Nov 2012 14:38:09 +0000 (09:38 -0500)]
Add CONF_DIR, as in Makefile

6 years agoMerge pull request #13 from emaste/master
corecode [Tue, 20 Nov 2012 21:03:26 +0000 (13:03 -0800)]
Merge pull request #13 from emaste/master

Patches from the FreeBSD ports tree mail/dma

6 years agoAdd compat #ifdef for older OpenSSL
Ed Maste [Tue, 20 Nov 2012 16:57:31 +0000 (11:57 -0500)]
Add compat #ifdef for older OpenSSL

Obtained from: mail/dma in the FreeBSD ports tree

6 years agoAllow DMA_ROOT_USER & DMA_GROUP to be overridden.
Ed Maste [Tue, 20 Nov 2012 16:38:57 +0000 (11:38 -0500)]
Allow DMA_ROOT_USER & DMA_GROUP to be overridden.

6 years agoMerge pull request #12 from emaste/master
corecode [Tue, 20 Nov 2012 16:34:52 +0000 (08:34 -0800)]
Merge pull request #12 from emaste/master

Be explicit about missing user.

6 years agoBe explicit about missing user.
Ed Maste [Tue, 20 Nov 2012 16:29:09 +0000 (11:29 -0500)]
Be explicit about missing user.

Previously the error message for a missing 'mail' user was
dma: cannot drop root privileges: No error: 0

7 years agospool.c: bzero contents of pointer
Simon Schubert [Fri, 15 Jun 2012 16:18:15 +0000 (18:18 +0200)]
spool.c: bzero contents of pointer

Reported-by: Sascha Wildner <saw@online.de>
7 years agorelease dma 0.8
Simon Schubert [Fri, 30 Mar 2012 10:04:27 +0000 (12:04 +0200)]
release dma 0.8

7 years agoimplement queue flushing prod
Simon Schubert [Sat, 18 Feb 2012 00:15:22 +0000 (01:15 +0100)]
implement queue flushing prod

So far dma would sleep for the whole backoff period before retrying a
delivery.  However, this also meant that a user issuing `dma -q` could
not force these mails to be retried immediately.

Switch to sleeping for only 30 seconds at a time, and poll the mtime
of a special queue flush signal file `flush` in the spool directory.
If the flush file has been touched since the beginning of the backoff
period, initiate a retry right away.

When flushing the queue with `dma -q` we now touch the flush file to
make waiting instances of dma process this user request.

The 30 second poll interval at the same time avoids a DoS via
excessive `dma -q` by any user.

fixes #3
Bug: https://github.com/corecode/dma/issues/3

7 years agodon't complain when we can't lock a queue file during flush
Simon Schubert [Sat, 18 Feb 2012 00:02:18 +0000 (01:02 +0100)]
don't complain when we can't lock a queue file during flush

When we can't lock a queue file during flush it means another process
is already sitting on the item, so no need to complain or return error.

7 years agodeliver_remote: propagate back DNS errors
Simon Schubert [Sat, 18 Feb 2012 00:00:01 +0000 (01:00 +0100)]
deliver_remote: propagate back DNS errors

7 years agodon't treat -options following -q as argument to it
Simon Schubert [Fri, 17 Feb 2012 20:52:30 +0000 (21:52 +0100)]
don't treat -options following -q as argument to it

sendmail's -q takes an optional argument, but the way we use getopt(3)
does not support this.  Work around this by backtracking if the
argument to -q starts with a dash, indicating that it is an option instead.

7 years agoMerge pull request #2 from mohag/master
Simon Schubert [Mon, 30 Jan 2012 21:16:55 +0000 (13:16 -0800)]
Merge pull request #2 from mohag/master

add INSTALL and make SH configurable

7 years agoMake Makefile and README consistent with INSTALL
Gert van den Berg [Thu, 12 Jan 2012 19:04:13 +0000 (21:04 +0200)]
Make Makefile and README consistent with INSTALL

7 years agoAdded some more documentation on compiling
Gert van den Berg [Thu, 12 Jan 2012 18:58:14 +0000 (20:58 +0200)]
Added some more documentation on compiling

7 years agodma.8: we only have 2 config files at the moment
Simon Schubert [Sun, 8 Jan 2012 13:22:08 +0000 (14:22 +0100)]
dma.8: we only have 2 config files at the moment

Submitted-by: Max Herrgaard
7 years agodma.8: Fix a few small issues.
Sascha Wildner [Thu, 5 Jan 2012 13:30:39 +0000 (14:30 +0100)]
dma.8: Fix a few small issues.

7 years agorelease dma 0.7
Simon Schubert [Tue, 3 Jan 2012 13:54:05 +0000 (14:54 +0100)]
release dma 0.7

7 years agomark printf-alike functions
Simon Schubert [Mon, 2 Jan 2012 19:48:50 +0000 (20:48 +0100)]
mark printf-alike functions

Submitted-by: Sascha Wildner <saw@online.de>
7 years agoclear up warnings found by clang static analysis
Simon Schubert [Mon, 2 Jan 2012 19:41:02 +0000 (20:41 +0100)]
clear up warnings found by clang static analysis

7 years agoparse_conf: fix bug with masqueraded domains
Simon Schubert [Mon, 2 Jan 2012 19:40:22 +0000 (20:40 +0100)]
parse_conf: fix bug with masqueraded domains

We need to clear the @ symbol instead of NULLing the pointer.

Found-by: clang static analysis
7 years agoadd semicolon before date in Received: header
Simon Schubert [Sun, 25 Dec 2011 18:05:08 +0000 (19:05 +0100)]
add semicolon before date in Received: header

Submitted-by: Miquel van Smoorenburg <miquels@cistron.nl>
Via: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=650268

7 years agorelease dma 0.6
Simon Schubert [Wed, 7 Dec 2011 11:42:51 +0000 (12:42 +0100)]
release dma 0.6

7 years agodeliver_local: quote "From " more liberally
Simon Schubert [Wed, 7 Dec 2011 11:39:46 +0000 (12:39 +0100)]
deliver_local: quote "From " more liberally

It seems that when scanning for mails in mbox files, most MUAs just
look for lines beginning with "From ", and not only for "From " lines
after an empty line.  Therefore quote "From " more liberally, and also
implement the mboxro format by quoting />*From / lines that have been
quoted before.

Reported-by: Pierre Frenkiel <pierre.frenkiel@gmail.com>
7 years agorelease dma 0.5
Simon Schubert [Wed, 16 Nov 2011 12:35:22 +0000 (13:35 +0100)]
release dma 0.5

7 years agoimplement the "*" catch-all alias
Simon Schubert [Wed, 16 Nov 2011 12:32:05 +0000 (13:32 +0100)]
implement the "*" catch-all alias

7 years agoaccess config files at CONF_PATH, add makefile target to install conf files
Simon Schubert [Wed, 16 Nov 2011 11:55:30 +0000 (12:55 +0100)]
access config files at CONF_PATH, add makefile target to install conf files

7 years agoimplement masquerading using the MASQUERADE config option
Simon Schubert [Wed, 16 Nov 2011 11:38:49 +0000 (12:38 +0100)]
implement masquerading using the MASQUERADE config option

7 years agorelease dma 0.4
Simon Schubert [Tue, 15 Nov 2011 23:09:26 +0000 (00:09 +0100)]
release dma 0.4

7 years agoREADME: elaborate, use markdown
Simon Schubert [Tue, 15 Nov 2011 22:59:59 +0000 (23:59 +0100)]
README: elaborate, use markdown

7 years agoMakefile: add symlink for mailq
Simon Schubert [Tue, 15 Nov 2011 22:59:39 +0000 (23:59 +0100)]
Makefile: add symlink for mailq

7 years agoMakefile: create spool directories in a separate target
Simon Schubert [Tue, 15 Nov 2011 22:08:43 +0000 (23:08 +0100)]
Makefile: create spool directories in a separate target

On some systems we don't want to create these directories, so putting
them in a separate target allows downstream maintainers to use our
Makefile without patching.

7 years agoAdd symlink for sendmail which is expected by many packages
Simon Schubert [Tue, 15 Nov 2011 21:53:43 +0000 (22:53 +0100)]
Add symlink for sendmail which is expected by many packages

Bug #833485

7 years agoMerge commit 'refs/merge-requests/4' of git://gitorious.org/dma/dma
Simon Schubert [Tue, 15 Nov 2011 21:46:55 +0000 (22:46 +0100)]
Merge commit 'refs/merge-requests/4' of git://gitorious.org/dma/dma

7 years agoMerge commit 'refs/merge-requests/3' of git://gitorious.org/dma/dma
Simon Schubert [Tue, 15 Nov 2011 21:44:08 +0000 (22:44 +0100)]
Merge commit 'refs/merge-requests/3' of git://gitorious.org/dma/dma

7 years agoLICENSE: add
Simon Schubert [Mon, 14 Nov 2011 22:10:57 +0000 (23:10 +0100)]
LICENSE: add

7 years agoMakefile: put libraries at the end when linking
Simon Schubert [Mon, 14 Nov 2011 22:01:25 +0000 (23:01 +0100)]
Makefile: put libraries at the end when linking

With some linker configurations, libraries will have to be specified
after the objects that require them, otherwise the linker will not
include these libraries, leading to a link error.

7 years agorelease dma 0.3
Simon Schubert [Sat, 9 Jul 2011 00:39:33 +0000 (02:39 +0200)]
release dma 0.3

7 years agoparse_addrs: fix parsing for multiple <addresses>
Simon Schubert [Sat, 9 Jul 2011 00:34:53 +0000 (02:34 +0200)]
parse_addrs: fix parsing for multiple <addresses>

We would treat [,;] as address separator, triggering a new recipient.
However, if the previous recipient was enclosed in <brackets>, we
already added this recipient.  Fix this by skipping over [,;] if the
current address is empty.

Bug: #807712 <https://bugs.launchpad.net/dma/+bug/807712>

7 years agomake dma compile again on DragonFly
Simon Schubert [Fri, 8 Jul 2011 23:25:02 +0000 (16:25 -0700)]
make dma compile again on DragonFly

Pointed-out-by: Robin Green <greenrd@greenrd.org>
7 years agoIn OpenSSL 1.0, TLSv1_client_method() returns a const pointer.
Peter Pentchev [Tue, 5 Jul 2011 12:41:27 +0000 (15:41 +0300)]
In OpenSSL 1.0, TLSv1_client_method() returns a const pointer.

8 years agoFix a minor memory leak discovered by cppcheck.
Peter Pentchev [Wed, 23 Feb 2011 10:09:52 +0000 (12:09 +0200)]
Fix a minor memory leak discovered by cppcheck.

8 years agoFix straight SSL/TLS delivery to remote MX's.
Peter Pentchev [Tue, 25 Jan 2011 09:18:32 +0000 (11:18 +0200)]
Fix straight SSL/TLS delivery to remote MX's.

If the SECURETRANS option is enabled but STARTTLS is not, this ought
to mean that dma should start talking SSL to the remote MX straight
away, without waiting for its greeting.  Thus, postpone waiting for
the SMTP banner in this case until after the SSL connection has been
successfully initialized.

8 years agoreadmail: accept mail without newline at the end
Simon Schubert [Sat, 8 Jan 2011 14:30:12 +0000 (15:30 +0100)]
readmail: accept mail without newline at the end

8 years agoMake add_host() really return an error code.
Peter Pentchev [Fri, 17 Dec 2010 11:31:41 +0000 (13:31 +0200)]
Make add_host() really return an error code.

Now that add_host() *may* return an error, it is kind of confusing
(and actually leads to errors) that it also returns the number of
hosts added to the value/result "hosts" array.  Since the caller
really checks add_host()'s return value now, a successful lookup that
returns one host added will be treated as an error :)

8 years agodns_get_mx_list: handle errors properly
Simon Schubert [Mon, 13 Dec 2010 01:59:54 +0000 (02:59 +0100)]
dns_get_mx_list: handle errors properly

Pointed-out-by: Peter Pentchev <roam@ringlet.net>
8 years agodma-mbox-create: add error/status logging
Simon Schubert [Sun, 12 Dec 2010 23:51:45 +0000 (00:51 +0100)]
dma-mbox-create: add error/status logging

8 years agoerrlog: preserve errno
Simon Schubert [Sun, 12 Dec 2010 23:51:19 +0000 (00:51 +0100)]
errlog: preserve errno

8 years agodma-mbox-create: group mail only needs to write to mboxes
Simon Schubert [Mon, 1 Nov 2010 21:18:45 +0000 (22:18 +0100)]
dma-mbox-create: group mail only needs to write to mboxes

8 years agotodo: we create mboxes properly now
Simon Schubert [Mon, 1 Nov 2010 08:58:49 +0000 (09:58 +0100)]
todo: we create mboxes properly now

8 years agorelease dma 0.2
Simon Schubert [Sun, 31 Oct 2010 22:36:46 +0000 (23:36 +0100)]
release dma 0.2

8 years agomake ppa: proper name
Simon Schubert [Sun, 31 Oct 2010 22:55:45 +0000 (23:55 +0100)]
make ppa: proper name

8 years agomake ppa: force lower version number
Simon Schubert [Sun, 31 Oct 2010 22:41:45 +0000 (23:41 +0100)]
make ppa: force lower version number

8 years agodebian: fix lintian warnings and errors
Simon Schubert [Sun, 31 Oct 2010 22:31:59 +0000 (23:31 +0100)]
debian: fix lintian warnings and errors

8 years agodebian: remove unused files
Simon Schubert [Sun, 31 Oct 2010 17:32:27 +0000 (18:32 +0100)]
debian: remove unused files

8 years agodebian: build with consistent flags
Simon Schubert [Sun, 31 Oct 2010 17:31:50 +0000 (18:31 +0100)]
debian: build with consistent flags

8 years agoimplement mbox creation via setuid helper
Simon Schubert [Sun, 31 Oct 2010 12:24:39 +0000 (13:24 +0100)]
implement mbox creation via setuid helper

8 years agodrop privileges when run by root
Simon Schubert [Sun, 31 Oct 2010 16:40:31 +0000 (17:40 +0100)]
drop privileges when run by root

8 years agowritequeuef: create files with g+rw
Simon Schubert [Sun, 31 Oct 2010 15:54:42 +0000 (16:54 +0100)]
writequeuef: create files with g+rw

8 years agosetlogident: openlog() wants a static variable
Simon Schubert [Sun, 31 Oct 2010 15:54:20 +0000 (16:54 +0100)]
setlogident: openlog() wants a static variable

8 years agoRevert "debian: better mark as UNRELEASED"
Simon Schubert [Sun, 31 Oct 2010 12:50:43 +0000 (13:50 +0100)]
Revert "debian: better mark as UNRELEASED"

This reverts commit dab6eb174f99aee478b552baa1a86e04ee1df0e8.  I'll mark
every release as, well, released.

8 years agopartially adopt 34-manpage-defaults.patch: AUTHPATH is not set by default
Simon Schubert [Sun, 31 Oct 2010 11:34:26 +0000 (12:34 +0100)]
partially adopt 34-manpage-defaults.patch: AUTHPATH is not set by default