summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2019-10-12 12:43:24 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2019-10-12 15:55:18 +0300
commit739c6ee525a4f7bb76b8fe2bd75e81a122764ced (patch)
treeb90dfed5972048513d2076e5562a77e4e862d8b0
parent6ec886e647516e800febddee3f70491edfb561b0 (diff)
downloadmailutils-739c6ee525a4f7bb76b8fe2bd75e81a122764ced.tar.gz
mailutils-739c6ee525a4f7bb76b8fe2bd75e81a122764ced.tar.bz2
Split maidag into three single-purpose tools
Maidag operated in three modes: mda, url and lmtp. In mda mode it is normally started by sendmail with non-root privileges. In order to be able to write to other users' mailboxes, the binary must be setuid, which creates certain security threats. As these appear to be impossible to avoid in a single multi-purpose program, it has been decided to replace maidag with three single-purpose tools: mda, putmail, and lmtpd. The mda tool is a local mail delivery agent. It is the only one for which the setuid bit is required, so special measures have been taken to secure it. In particular, to avoid unverified user inputs it disallows to override any configuration settings from the command line. The two other tools provide the functionality of the url and lmtp mode. * Makefile.am (MAIDAG_DIR): Replace with MDA_DIR * configure.ac (MU_COND_MAILBOX_QUOTA): New conditional. Use names relative to ${top_builddir} instead of ".". * maidag: Remove. * mda/.gitignore: New file. * mda/Makefile.am: New file. * mda/lib/Makefile.am: New file. * mda/lib/deliver.c: New file. * mda/lib/forward.c: New file. * mda/lib/libmda.h: New file. * mda/lib/mailquota.c: New file. * mda/lib/script.c: New file. * mda/lib/util.c: New file. * mda/lmtpd.c: New file. * mda/mda.c: New file. * mda/putmail.c: New file. * mda/tests/.gitignore: New file. * mda/tests/Makefile.am: New file. * mda/tests/atlocal.in: New file. * mda/tests/input.msg: New file. * mda/tests/lmtpd.at: New file. * mda/tests/putmail.at: New file. * mda/tests/testsuite.at: New file. * doc/texinfo/programs/maidag.texi: Remove. * doc/texinfo/programs/mda.texi: New file. * doc/texinfo/programs/lmtpd.texi: New file.
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac16
-rw-r--r--doc/texinfo/Makefile.am4
-rw-r--r--doc/texinfo/mailutils.texi61
-rw-r--r--doc/texinfo/programs.texi20
-rw-r--r--doc/texinfo/programs/lmtpd.texi66
-rw-r--r--doc/texinfo/programs/mda.texi (renamed from doc/texinfo/programs/maidag.texi)515
-rw-r--r--doc/texinfo/programs/putmail.texi83
-rw-r--r--doc/texinfo/sieve.texi6
-rw-r--r--maidag/.gitignore6
-rw-r--r--maidag/maidag.c592
-rw-r--r--maidag/maidag.h205
-rw-r--r--maidag/script.c135
-rw-r--r--maidag/tests/forward.at79
-rw-r--r--maidag/tests/mda.at50
-rw-r--r--mda/.gitignore3
-rw-r--r--mda/Makefile.am (renamed from maidag/Makefile.am)55
-rw-r--r--mda/lib/Makefile.am34
-rw-r--r--mda/lib/deliver.c (renamed from maidag/deliver.c)206
-rw-r--r--mda/lib/forward.c (renamed from maidag/forward.c)79
-rw-r--r--mda/lib/libmda.h129
-rw-r--r--mda/lib/mailquota.c (renamed from maidag/mailquota.c)70
-rw-r--r--mda/lib/script.c260
-rw-r--r--mda/lib/util.c (renamed from maidag/util.c)75
-rw-r--r--mda/lmtpd.c (renamed from maidag/lmtp.c)284
-rw-r--r--mda/mda.c143
-rw-r--r--mda/putmail.c76
-rw-r--r--mda/tests/.gitignore (renamed from maidag/tests/.gitignore)0
-rw-r--r--mda/tests/Makefile.am (renamed from maidag/tests/Makefile.am)8
-rw-r--r--mda/tests/atlocal.in (renamed from maidag/tests/atlocal.in)4
-rw-r--r--mda/tests/input.msg (renamed from maidag/tests/input.msg)0
-rw-r--r--mda/tests/lmtpd.at (renamed from maidag/tests/lmtp.at)10
-rw-r--r--mda/tests/putmail.at (renamed from maidag/tests/url-mbox.at)10
-rw-r--r--mda/tests/testsuite.at (renamed from maidag/tests/testsuite.at)19
34 files changed, 1697 insertions, 1612 deletions
diff --git a/Makefile.am b/Makefile.am
index a0fb57c50..716be7a72 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,4 +34,4 @@ endif
-if MU_COND_MAIDAG
- MAIDAG_DIR = maidag
+if MU_COND_MDA
+ MDA_DIR = mda
endif
@@ -107,3 +107,3 @@ SUBDIRS = . \
$(IMAP4D_DIR)\
- $(MAIDAG_DIR)\
+ $(MDA_DIR)\
$(MAIL_DIR)\
diff --git a/configure.ac b/configure.ac
index c841acfbf..5c7717289 100644
--- a/configure.ac
+++ b/configure.ac
@@ -935,3 +935,3 @@ if test -n "$SQL_MODULES"; then
BUILD_SQL=libsql.la
- SQLLIB=../sql/libsql.la
+ SQLLIB='${top_builddir}/sql/libsql.la'
@@ -959,3 +959,2 @@ if test -n "$SQL_MODULES"; then
fi
-
@@ -982,2 +981,6 @@ fi
+# Mailbox quota support
+AM_CONDITIONAL([MU_COND_MAILBOX_QUOTA],[test -n "$status_dbm$status_mysql"])
+
+
# Virtual domain support
@@ -1184,3 +1187,3 @@ GINT_INIT([gint],[2.2.0 with-guile],
fi
- LIBMU_SCM=../libmu_scm/libmu_scm.la
+ LIBMU_SCM='${top_builddir}/libmu_scm/libmu_scm.la'
LIBMU_SCM_DEPS='${MU_LIB_MAILBOX} ${MU_LIB_MAILER}'
@@ -1326,3 +1329,3 @@ MU_ENABLE_BUILD(comsat,,,["$mu_build_servers" = yes],,[server_list])
MU_ENABLE_BUILD(frm,,,["$mu_build_clients" = yes],,[client_list])
-MU_ENABLE_BUILD(maidag,,,["$mu_build_clients" = yes],,[client_list])
+MU_ENABLE_BUILD(mda,,,["$mu_build_clients" = yes],,[client_list])
@@ -1365,3 +1368,3 @@ MU_CONFIG_TESTSUITE(libmailutils)
MU_CONFIG_TESTSUITE(frm)
-MU_CONFIG_TESTSUITE(maidag)
+MU_CONFIG_TESTSUITE(mda)
MU_CONFIG_TESTSUITE(mail)
@@ -1520,3 +1523,4 @@ AC_CONFIG_FILES([
libproto/mailer/Makefile
- maidag/Makefile
+ mda/Makefile
+ mda/lib/Makefile
mail/Makefile
diff --git a/doc/texinfo/Makefile.am b/doc/texinfo/Makefile.am
index 453997fbc..95438eb00 100644
--- a/doc/texinfo/Makefile.am
+++ b/doc/texinfo/Makefile.am
@@ -38,3 +38,5 @@ programs_TEXINFOS = \
programs/guimb.texi\
- programs/maidag.texi\
+ programs/mda.texi\
+ programs/lmtpd.texi\
+ programs/putmail.texi\
programs/mimeview.texi\
diff --git a/doc/texinfo/mailutils.texi b/doc/texinfo/mailutils.texi
index b1a0a2724..f93f23367 100644
--- a/doc/texinfo/mailutils.texi
+++ b/doc/texinfo/mailutils.texi
@@ -143,3 +143,5 @@ Mailutils Programs
-* maidag:: General-purpose Mail Delivery Agent.
+* mda:: Local Mail Delivery Agent.
+* lmtpd:: LMTP Daemon.
+* putmail:: Incorporate a Message to a Mailbox.
@@ -204,5 +206,5 @@ Debugging
* Invoking Mail:: Command Line Options.
+* Reading Mail:: Reading Mail.
* Composing Mail:: Composing Mail.
* MIME:: How to Attach Files.
-* Reading Mail:: Reading Mail.
* Scripting:: Scripting.
@@ -211,18 +213,2 @@ Debugging
-Composing Mail
-
-* Quitting Compose Mode::
-* Getting Help on Compose Escapes::
-* Editing the Message::
-* Modifying the Headers::
-* Enclosing Another Message::
-* Adding a File to the Message::
-* Attaching a File to the Message::
-* Printing And Saving the Message::
-* Signing the Message::
-* Printing Another Message::
-* Inserting Value of a Mail Variable::
-* Executing Other Mail Commands::
-* Executing Shell Commands::
-
Reading Mail
@@ -247,2 +233,18 @@ Reading Mail
+Composing Mail
+
+* Quitting Compose Mode::
+* Getting Help on Compose Escapes::
+* Editing the Message::
+* Modifying the Headers::
+* Enclosing Another Message::
+* Adding a File to the Message::
+* Attaching a File to the Message::
+* Printing And Saving the Message::
+* Signing the Message::
+* Printing Another Message::
+* Inserting Value of a Mail Variable::
+* Executing Other Mail Commands::
+* Executing Shell Commands::
+
@command{movemail} --- Moves Mail from the User Maildrop to the Local File
@@ -276,13 +278,12 @@ A Sieve Interpreter
-maidag
+mda
-* Sendmail-maidag:: Using @command{maidag} with Sendmail.
-* Exim-maidag:: Using @command{maidag} with Exim.
-* MeTA1-maidag:: Using @command{maidag} with MeTA1.
+* Sendmail-mda:: Using @command{mda} with Sendmail.
+* Exim-mda:: Using @command{mda} with Exim.
+* MeTA1-mda:: Using @command{mda} with MeTA1.
* Mailbox Quotas::
-* Maidag Scripting::
+* MDA Scripting::
* Forwarding::
-* Url-mode:: Delivering Messages to a URL.
-* Remote Mailbox Delivery::
-* Conf-maidag:: Maidag Configuration File Summary
+* Conf-mda:: @command{mda} Configuration File Summary.
+* Mailing lists:: How to implement Mailing Lists with @command{mda}.
@@ -293,7 +294,7 @@ Mailbox Quotas
-Maidag Scripting
+Scripting in @command{mda}
-* Sieve Maidag Filters::
-* Scheme Maidag Filters::
-* Python Maidag Filters::
+* Sieve MDA Filters::
+* Scheme MDA Filters::
+* Python MDA Filters::
diff --git a/doc/texinfo/programs.texi b/doc/texinfo/programs.texi
index c8c3b978d..f2de68767 100644
--- a/doc/texinfo/programs.texi
+++ b/doc/texinfo/programs.texi
@@ -34,3 +34,5 @@ syntax.
-* maidag:: General-purpose Mail Delivery Agent.
+* mda:: Local Mail Delivery Agent.
+* lmtpd:: LMTP Daemon.
+* putmail:: Incorporate a Message to a Mailbox.
@@ -2892,5 +2894,15 @@ Show payload information
@page
-@node maidag
-@section maidag
-@include programs/maidag.texi
+@node mda
+@section mda
+@include programs/mda.texi
+
+@page
+@node lmtpd
+@section lmtpd
+@include programs/lmtpd.texi
+
+@page
+@node putmail
+@section putmail
+@include programs/putmail.texi
diff --git a/doc/texinfo/programs/lmtpd.texi b/doc/texinfo/programs/lmtpd.texi
new file mode 100644
index 000000000..e0212db2f
--- /dev/null
+++ b/doc/texinfo/programs/lmtpd.texi
@@ -0,0 +1,66 @@
+@c This is part of the GNU Mailutils manual.
+@c Copyright (C) 1999-2019 Free Software Foundation, Inc.
+@c See file mailutils.texi for copying conditions.
+@comment *******************************************************************
+@pindex lmtpd
+The @acronym{LMTP} is a local mail transport protocol defined in RFC
+2033. GNU Mailutils is shipped with @command{lmtpd} - a daemon for
+delivering messages using this protocol.
+
+The daemon shares most of its codebase and configuration with
+@command{mda} and consequently provides the same features.
+@xref{mda}, for a detailed description of these.
+
+The behavior of @command{lmtpd} is affected by the following configuration
+statements:
+
+@multitable @columnfractions 0.3 0.6
+@headitem Statement @tab Reference
+@item server @tab @xref{Server Settings}
+@item acl @tab @xref{acl statement}.
+@item tcp-wrappers @tab @xref{tcp-wrappers statement}.
+@item debug @tab @xref{debug statement}.
+@item mailbox @tab @xref{mailbox statement}.
+@item locking @tab @xref{locking statement}.
+@item pam @tab @xref{pam statement}.
+@item sql @tab @xref{sql statement}.
+@item virtdomain @tab @xref{virtdomain statement}.
+@item radius @tab @xref{radius statement}.
+@item ldap @tab @xref{ldap statement}.
+@item auth @tab @xref{auth statement}.
+@item mailer @tab @xref{mailer statement}.
+@end multitable
+
+@menu
+* MeTA1-lmtpd:: Using @command{lmtpd} with MeTA1.
+@end menu
+
+@node MeTA1-lmtpd
+@subsection Using @command{lmtpd} with MeTA1.
+MeTA1 (@uref{http://meta1.org}) communicates with the delivery agent
+using @acronym{LMTP}.
+
+The socket to listen for LMTP requests must be specified using the
+@code{server} statement (@pxref{Server Settings}). For the purposes of
+this section, let's suppose @command{lmtpd} will listen on a
+@acronym{UNIX} socket @file{/var/spool/meta1/lmtpsock}. Then, the
+following (minimal) @command{lmtpd} configuration will do the job:
+
+@example
+# @r{Run as daemon.}
+mode daemon;
+# @r{Switch to this group after startup.}
+group meta1c;
+# @r{Configure server:}
+server unix:///var/spool/meta1/lmtpsock @{
+ transcript no;
+@};
+@end example
+
+To configure MeTA1 to use this socket, add the following statement to
+the @samp{smtpc} section in @file{/etc/meta1/meta1.conf}:
+
+@example
+ LMTP_socket="lmtpsock";
+@end example
+
diff --git a/doc/texinfo/programs/maidag.texi b/doc/texinfo/programs/mda.texi
index c66d4aefa..acce8301f 100644
--- a/doc/texinfo/programs/maidag.texi
+++ b/doc/texinfo/programs/mda.texi
@@ -4,18 +4,15 @@
@comment *******************************************************************
-@pindex maidag
-@UNREVISED
-
-The name @samp{maidag} stands for @i{Mai}l @i{d}elivery @i{ag}ent. It
-is a general-purpose @acronym{MDA} offering a rich set of
-features. It can operate both in traditional mode, reading the message
-from its standard input, and in @acronym{LMTP} mode. @command{Maidag}
-is able to deliver mail to any mailbox format, supported by GNU
-Mailutils. These formats, among others, include @samp{smtp://},
-@samp{prog://} and @samp{sendmail://} which are
+@pindex mda
+GNU local mail delivery agent reads a message from its standard input
+and delivers it to one or more local recipients listed in the command
+line. When we speak about @i{local} recipients, we mean that these
+are system users that are known to the system that runs @command{mda}.
+However, the mailboxes of these users can be local as well as remote
+ones. @command{mda} is able to deliver mail to any mailbox format,
+supported by GNU Mailutils. These formats, among others, include
+@samp{smtp://}, @samp{prog://} and @samp{sendmail://} which are
equivalent to forwarding a message over @acronym{SMTP} to a remote
-node. Thus, @command{maidag} supersedes both @command{mail.local} and
-@command{mail.remote} utilities from GNU Mailutils versions prior to
-2.0.
+node.
-@command{Maidag} is also able to process incoming messages using
+@command{Mda} is also able to process incoming messages using
Sieve, Scheme or Python scripts and, based on results of this
@@ -23,31 +20,30 @@ processing, to take a decision on whether to actually deliver and
where to deliver them. Due to its extensive scripting facilities,
-@command{maidag} offers much more flexibility than other popular
-@acronym{MDA}s, such as @command{procmail}.
+@command{mda} offers much more flexibility than other popular
+@acronym{MDA}s.
@menu
-* Sendmail-maidag:: Using @command{maidag} with Sendmail.
-* Exim-maidag:: Using @command{maidag} with Exim.
-* MeTA1-maidag:: Using @command{maidag} with MeTA1.
+* Sendmail-mda:: Using @command{mda} with Sendmail.
+* Exim-mda:: Using @command{mda} with Exim.
+* MeTA1-mda:: Using @command{mda} with MeTA1.
* Mailbox Quotas::
-* Maidag Scripting::
+* MDA Scripting::
* Forwarding::
-* Url-mode:: Delivering Messages to a URL.
-* Remote Mailbox Delivery::
-* Conf-maidag:: Maidag Configuration File Summary
+* Conf-mda:: @command{mda} Configuration File Summary.
+* Mailing lists:: How to implement Mailing Lists with @command{mda}.
@end menu
-@node Sendmail-maidag
-@subsection Using @command{maidag} with Sendmail.
+@node Sendmail-mda
+@subsection Using @command{mda} with Sendmail.
@cindex Sendmail
-When used as a @acronym{MDA} with Sendmail, @command{maidag} must be
-invoked from the local mailer definition in the @file{sendmail.cf}
-file. It must have the following flags set: @samp{lswS}. These mean:
-the mailer is local, quote characters should be stripped off the
-address before invoking the mailer, the user must have a valid account
-on this machine and the userid should not be reset before calling the
-mailer. Additionally, the flags @samp{fn} may be specified to allow
-@command{maidag} to generate the usual @samp{From } envelope instead
+When used with Sendmail, @command{mda} must be invoked from the local
+mailer definition in the @file{sendmail.cf} file. The flags
+@samp{lswS} must be set for the mailer. These mean: the mailer is
+local, quote characters should be stripped off the address before
+invoking the mailer, the user must have a valid account on this
+machine and the userid should not be reset before calling the mailer.
+Additionally, the @samp{fn} flags may be specified to allow
+@command{mda} to generate the usual @samp{From } envelope instead
of the one supplied by @command{sendmail}.
-If you wish to use @command{maidag} with non-local authentication,
+If you wish to use @command{mda} with non-local authentication,
such as @acronym{SQL} or @acronym{LDAP}, you also need to remove the
@@ -59,3 +55,3 @@ Here is an example of mailer definition in @file{sendmail.cf}
@example
-Mlocal, P=/usr/local/sbin/maidag,
+Mlocal, P=/usr/local/sbin/mda,
F=lsDFMAw5:/|@@qSPfhn9,
@@ -70,3 +66,3 @@ set:
@example
-define(`LOCAL_MAILER_PATH', `/usr/local/sbin/maidag')
+define(`LOCAL_MAILER_PATH', `/usr/local/sbin/mda')
define(`LOCAL_MAILER_ARGS', `mail $u')
@@ -74,7 +70,7 @@ define(`LOCAL_MAILER_ARGS', `mail $u')
-@node Exim-maidag
-@subsection Using @command{maidag} with Exim.
+@node Exim-mda
+@subsection Using @command{mda} with Exim.
@cindex Exim
-Using @command{maidag} with Exim is quite straightforward. The
+Using @command{mda} with Exim is quite straightforward. The
following example illustrates the definition of the appropriate transport
@@ -84,5 +80,5 @@ and director in @file{exim.conf}:
# transport
-maidag_pipe:
+mda_pipe:
driver = pipe
- command = /usr/local/sbin/maidag $local_part
+ command = /usr/local/sbin/mda $local_part
return_path_add
@@ -92,40 +88,14 @@ maidag_pipe:
# director
-maidag:
+mda:
driver = localuser
- transport = maidag_pipe
+ transport = mda_pipe
@end example
-@node MeTA1-maidag
-@subsection Using @command{maidag} with MeTA1.
-@cindex LMTP
+@node MeTA1-mda
+@subsection Using @command{mda} with MeTA1.
@cindex MeTA1
MeTA1 (@uref{http://meta1.org}) communicates with the delivery agent
-using @acronym{LMTP}.
-
-LMTP mode is enabled in @command{maidag} by the @samp{delivery-mode lmtp}
-statement. The socket to listen on must be specified using
-@code{server} statement (@pxref{Server Settings}). For the purposes of
-this section, let's suppose @command{maidag} will listen on a
-@acronym{UNIX} socket @file{/var/spool/meta1/lmtpsock}. Then, the
-following (minimal) @command{maidag} configuration will do the job:
-
-@example
-# @r{Start in LMTP mode.}
-delivery-mode lmtp;
-# @r{Run as daemon.}
-mode daemon;
-# @r{Switch to this group after startup.}
-group meta1c;
-# @r{Configure server:}
-server unix:///var/spool/meta1/lmtpsock @{
- transcript no;
-@};
-@end example
-
-To configure MeTA1 to use this socket, add the following statement to
-the @samp{smtpc} section in @file{/etc/meta1/meta1.conf}:
-
-@example
- LMTP_socket="lmtpsock";
-@end example
+using @acronym{LMTP}. Instead of using @command{mda} you will have to
+start the @acronym{LMTP} daemon @command{lmtpd} and configure MeTA1 to
+communicate with it. @xref{MeTA1-lmtpd}, for details.
@@ -135,3 +105,3 @@ the @samp{smtpc} section in @file{/etc/meta1/meta1.conf}:
@dfn{Mailbox quota} is a limit on the size of the mailbox. When a
-mailbox size reaches this limit, @command{maidag} stops accepting
+mailbox size reaches this limit, @command{mda} stops accepting
messages for this recipient and returns an error condition to the
@@ -157,3 +127,5 @@ unavailable} (corresponding to the @acronym{SMTP} return code
@example
-exit-quota-tempfail yes;
+quota @{
+ exit-tempfail yes;
+@}
@end example
@@ -183,3 +155,3 @@ be compiled with one of the following command line options:
@option{--with-tokyocabinet}, or @option{--with-kyotocabinet}.
-Examine the output of @command{maidag --show-config-options}, if not sure.
+Examine the output of @command{mda --show-config-options}, if not sure.
@@ -201,3 +173,3 @@ A special value @samp{NONE} means no mailbox size limit for this user.
-Here is an example of a valid quota database
+Here is an example of a quota database in text form:
@@ -217,6 +189,9 @@ karin 10mB
To use the @acronym{DBM} quota database, specify its absolute name using
-@code{quota-db} configuration statement, e.g.:
+the @code{database} configuration statement in the @code{quota}
+section, e.g.:
@example
-quota-db /etc/mail/quota.db;
+quota @{
+ database /etc/mail/quota.db;
+@}
@end example
@@ -226,4 +201,3 @@ quota-db /etc/mail/quota.db;
-Configuration statement @code{quota-query} allows to specify a special
-query to retrieve the quota from the database. Currently (as of mailutils
+User quotas can be kept in an SQL table as well. Currently (as of mailutils
version @value{VERSION}) it is assumed that this table can be accessed
@@ -250,7 +224,17 @@ SELECT quota FROM mailbox_quota WHERE user_name='$@{user@}'
+To define this query use the @code{sql-query} statement:
+
+@example
+quota @{
+ sql-query "SELECT quota "
+ "FROM mailbox_quota "
+ "WHERE user_name='$@{user@}'";
+@}
+@end example
+
There are no special provisions for specifying group quotas, similar to
@samp{DEFAULT} in @acronym{DBM} databases. This is because group quotas can
-easily be implemented using @acronym{SQL} language. @command{Maidag}
+easily be implemented using @acronym{SQL} language. @command{Mda}
always uses the first tuple from the set returned by mailbox quota
-query. So, you may add a special entry to the @code{mailbox_quota}
+query. So, you can add a special entry to the @code{mailbox_quota}
table that would keep the group quota. In the discussion below we assume
@@ -270,4 +254,4 @@ will return two tuples if the user is found in
@code{mailbox_quota}. Due to @code{ORDER} statement, the first tuple
-will contain the quota for the user, which will be used by
-@command{maidag}. On the other hand, if the requested user name is not
+will contain quota for the user, which will be used by
+@command{mda}. On the other hand, if the requested user name is not
present in the table, the above query will return a single tuple
@@ -279,3 +263,4 @@ use this query for retrieving the user quota:
@example
-quota-query "SELECT quota "
+quota @{
+ sql-query "SELECT quota "
"FROM mailbox_quota "
@@ -283,7 +268,8 @@ quota-query "SELECT quota "
"ORDER BY user_name DESC";
+@}
@end example
-@node Maidag Scripting
-@subsection Maidag Scripting
-@command{Maidag} can use global or per-user @dfn{mail filters} to
+@node MDA Scripting
+@subsection Scripting in @command{mda}
+@command{Mda} can use global or per-user @dfn{mail filters} to
decide whether to deliver the message, and where to deliver it. As of
@@ -312,2 +298,3 @@ Expands to the recipient user name.
+@anchor{scripting language}
By default, the filename extension decides which scripting language will
@@ -317,4 +304,6 @@ statement. For example:
@example
-language "python"
-script "~/.maidag-py-filter"
+script @{
+ language python;
+ pattern "~/.maidag-py-filter";
+@}
@end example
@@ -322,9 +311,9 @@ script "~/.maidag-py-filter"
@menu
-* Sieve Maidag Filters::
-* Scheme Maidag Filters::
-* Python Maidag Filters::
+* Sieve MDA Filters::
+* Scheme MDA Filters::
+* Python MDA Filters::
@end menu
-@node Sieve Maidag Filters
-@subsubsection Sieve Maidag Filters
+@node Sieve MDA Filters
+@subsubsection Sieve MDA Filters
@kwindex script
@@ -335,3 +324,5 @@ configuration statement:
@example
-script "~/.maidag.sv"
+script @{
+ pattern "~/.maidag.sv";
+@}
@end example
@@ -352,4 +343,4 @@ Sieve code will be visible in the delivered message.
-@node Scheme Maidag Filters
-@subsubsection Scheme Maidag Filters
+@node Scheme MDA Filters
+@subsubsection Scheme MDA Filters
@kwindex script
@@ -360,3 +351,5 @@ configuration statement:
@example
-script "~/.maidag.scm"
+script @{
+ pattern "~/.maidag.scm";
+@}
@end example
@@ -364,7 +357,7 @@ script "~/.maidag.scm"
@noindent
-instructs `maidag' to use file `.maidag.scm' in the recipient home
-directory as a Scheme filter.
+instructs @command{mda} to use file @file{.maidag.scm} in the
+recipient home directory as a Scheme filter.
-@node Python Maidag Filters
-@subsubsection Python Maidag Filters
+@node Python MDA Filters
+@subsubsection Python MDA Filters
@kwindex script
@@ -376,3 +369,5 @@ configuration statement:
@example
-script "~/.maidag.py"
+script @{
+ pattern "~/.maidag.py";
+@}
@end example
@@ -380,4 +375,4 @@ script "~/.maidag.py"
@noindent
-instructs `maidag' to use file `.maidag.py' in the recipient home
-directory as a Python filter.
+instructs @command{mda} to use the file @file{.maidag.py} in the
+recipient home directory as a Python filter.
@@ -418,3 +413,3 @@ except Exception:
@cindex forward
-@dfn{Forward file} is a special file in the user's home directory that
+A @dfn{forward file} is a special file in the user's home directory that
contains the email address of the mailbox where the user wants to
@@ -424,11 +419,23 @@ feature. One of them is MeTA1.
-@command{Maidag} provides a forwarding feature that is useful to
-compensate the lack of it.
+@command{Mda} provides a forwarding feature that is useful to
+compensate the lack of it. This feature is controlled by the
+@code{forward} section in the configuration file:
-@kwindex forward-file
-Name of the forward file is given using @code{forward-file}
-configuration statement. A common usage is:
+@example
+forward @{
+ # Process forward file.
+ file @var{name};
+ # Configure safety checks for the forward file.
+ file-checks (@var{list});
+@}
+@end example
+
+@kwindex file, forward
+The name of the forward file is given by the @code{file}
+statement in the @code{forward} section. A common usage is:
@example
-forward-file .forward;
+forward @{
+ file .forward;
+@}
@end example
@@ -437,7 +444,14 @@ The forward file is always searched in the recipient home directory.
-@kwindex forward-file-checks
-Before actually using the file, a number of safety checks are
+Before actually using the forward file, a number of safety checks are
performed on it. If the file fails to pass one of these checks, no
forwarding is performed and the message is delivered as usual. These
-checks can be configured using @code{forward-file-checks} statement.
+checks are configured using the @code{forward.file-checks} statement:
+
+@example
+forward @{
+ file .forward;
+ file-checks (@var{list});
+@}
+@end example
+
Its argument is a list of the following keywords:
@@ -469,3 +483,3 @@ All of the above checks.
-The default is @samp{forward-file-checks all}.
+The default is @samp{file-checks all}.
@@ -475,38 +489,146 @@ particular check. For example:
@example
-forward-file-checks (nodir_iwoth, nodir_iwgrp);
+forward @{
+ file-checks (nodir_iwoth, nodir_iwgrp);
+ file .forward;
+@}
@end example
-@node Url-mode
-@subsection Delivering Messages to a URL.
-When invoked with the @option{--url} command line option,
-@command{maidag} treats its arguments as a list of mailbox
-@acronym{URL}s and attempts to deliver the message to each of them.
+@node Conf-mda
+@subsection MDA Configuration File Summary
-For example:
+The behavior of @command{mda} is affected by the following configuration
+statements:
+
+@multitable @columnfractions 0.3 0.6
+@headitem Statement @tab Reference
+@item debug @tab @xref{debug statement}.
+@item mailbox @tab @xref{mailbox statement}.
+@item locking @tab @xref{locking statement}.
+@item pam @tab @xref{pam statement}.
+@item sql @tab @xref{sql statement}.
+@item virtdomain @tab @xref{virtdomain statement}.
+@item radius @tab @xref{radius statement}.
+@item ldap @tab @xref{ldap statement}.
+@item auth @tab @xref{auth statement}.
+@item mailer @tab @xref{mailer statement}.
+@end multitable
+
+@deffn {MDA Config} stderr @var{bool}
+If @var{bool} is true, log to standard error instead of syslog.
+@end deffn
+
+@deffn {MDA Config} deliver @{ ... @}
+This section contains general delivery settings:
@example
-$ maidag --url maildir:///home/smith/Mail
+deliver @{
+ domain @var{string};
+ exit-multiple-delivery-success @var{arg};
+@};
@end example
+@end deffn
+
+@deffn {deliver} domain @var{name}
+Default email domain.
+@end deffn
+
+@deffn {deliver} exit-multiple-delivery-success @var{arg};
+In case of multiple delivery, exit with code 0 if at least
+one delivery succeeded.
+@end deffn
-The same effect has the @samp{delivery-mode url} configuration statement.
-@node Remote Mailbox Delivery
-@subsection Remote Mailbox Delivery
-@command{Maidag} can be used to deliver mail to remote mailboxes, such
-as @samp{imap} or @samp{smtp}. If the mailbox @acronym{URL}
-is @samp{smtp} or @samp{sendmail}, the message is
-actually forwarded over @acronym{SMTP} to the remote node, so
-@command{maidag} acts as a message transfer agent. For example:
+@deffn {MDA Config} forward @{ ... @}
+Controls the forwarding support:
@example
-$ maidag --url smtp://10.10.1.100:24
+forward @{
+ file @var{name};
+ file-checks (@var{list});
+@}
+@end example
+@end deffn
+
+@deffn {forward} file @var{name}
+Defines the name of the forward file. E.g.:
+
+@example
+forward @{
+ file .forward;
+@}
@end example
-This command line will send the message to the machine
-@samp{10.10.1.100} using port @samp{24} (private mail system).
+@xref{Forwarding}, for a detailed description.
+@end deffn
-The @samp{prog} mailbox may be of special use. Delivering to
-this mailbox results in invoking the specified command with the given
-arguments and passing the message to its standard input. There are two
-ways to specify a @samp{prog} mailb