diff options
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | configure.ac | 16 | ||||
-rw-r--r-- | doc/texinfo/Makefile.am | 4 | ||||
-rw-r--r-- | doc/texinfo/mailutils.texi | 61 | ||||
-rw-r--r-- | doc/texinfo/programs.texi | 20 | ||||
-rw-r--r-- | doc/texinfo/programs/lmtpd.texi | 66 | ||||
-rw-r--r-- | doc/texinfo/programs/mda.texi (renamed from doc/texinfo/programs/maidag.texi) | 515 | ||||
-rw-r--r-- | doc/texinfo/programs/putmail.texi | 83 | ||||
-rw-r--r-- | doc/texinfo/sieve.texi | 6 | ||||
-rw-r--r-- | maidag/.gitignore | 6 | ||||
-rw-r--r-- | maidag/maidag.c | 592 | ||||
-rw-r--r-- | maidag/maidag.h | 205 | ||||
-rw-r--r-- | maidag/script.c | 135 | ||||
-rw-r--r-- | maidag/tests/forward.at | 79 | ||||
-rw-r--r-- | maidag/tests/mda.at | 50 | ||||
-rw-r--r-- | mda/.gitignore | 3 | ||||
-rw-r--r-- | mda/Makefile.am (renamed from maidag/Makefile.am) | 55 | ||||
-rw-r--r-- | mda/lib/Makefile.am | 34 | ||||
-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.h | 129 | ||||
-rw-r--r-- | mda/lib/mailquota.c (renamed from maidag/mailquota.c) | 70 | ||||
-rw-r--r-- | mda/lib/script.c | 260 | ||||
-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.c | 143 | ||||
-rw-r--r-- | mda/putmail.c | 76 | ||||
-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 @@ -32,8 +32,8 @@ if MU_COND_IMAP4D IMAP4D_DIR = imap4d endif -if MU_COND_MAIDAG - MAIDAG_DIR = maidag +if MU_COND_MDA + MDA_DIR = mda endif if MU_COND_MAIL @@ -105,7 +105,7 @@ SUBDIRS = . \ $(FRM_DIR)\ $(POP3D_DIR)\ $(IMAP4D_DIR)\ - $(MAIDAG_DIR)\ + $(MDA_DIR)\ $(MAIL_DIR)\ $(SIEVE_DIR)\ $(MESSAGES_DIR)\ diff --git a/configure.ac b/configure.ac index c841acfbf..5c7717289 100644 --- a/configure.ac +++ b/configure.ac @@ -933,7 +933,7 @@ if test -n "$SQL_MODULES"; then USE_SQL=1 AC_DEFINE(USE_SQL) BUILD_SQL=libsql.la - SQLLIB=../sql/libsql.la + SQLLIB='${top_builddir}/sql/libsql.la' for module in $SQL_MODULES do @@ -957,7 +957,6 @@ if test -n "$SQL_MODULES"; then SQL_MODULES="$SQL_MODULES" fi]) fi - # LDAP support AC_ARG_WITH(ldap, @@ -980,6 +979,10 @@ if test $status_ldap = maybe; then fi +# Mailbox quota support +AM_CONDITIONAL([MU_COND_MAILBOX_QUOTA],[test -n "$status_dbm$status_mysql"]) + + # Virtual domain support MU_ENABLE_SUPPORT(virtual-domains) AC_SUBST(SITE_VIRTUAL_PWDDIR) @@ -1182,7 +1185,7 @@ GINT_INIT([gint],[2.2.0 with-guile], if test -z "$GUILE_BINDIR"; then GUILE_BINDIR="`guile-config info prefix`/bin" 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}' MU_GUILE_SIEVE_MOD_DIR='$(GUILE_SITE)/$(PACKAGE)/sieve-modules' GINT_INCLUDES='${MU_APP_COMMON_INCLUDES}' @@ -1324,7 +1327,7 @@ MU_ENABLE_BUILD(imap4d,,,["$mu_build_servers" = yes],,[server_list]) 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]) MU_ENABLE_BUILD(mail,,,["$mu_build_clients" = yes],,[client_list]) AC_SUBST([MAILBINDIR],'${bindir}') @@ -1363,7 +1366,7 @@ AC_CONFIG_FILES([testsuite/Makefile testsuite/atlocal]) MU_CONFIG_TESTSUITE(libmailutils) MU_CONFIG_TESTSUITE(frm) -MU_CONFIG_TESTSUITE(maidag) +MU_CONFIG_TESTSUITE(mda) MU_CONFIG_TESTSUITE(mail) MU_CONFIG_TESTSUITE(messages) MU_CONFIG_TESTSUITE(readmsg) @@ -1518,7 +1521,8 @@ AC_CONFIG_FILES([ libproto/Makefile libproto/mbox/Makefile libproto/mailer/Makefile - maidag/Makefile + mda/Makefile + mda/lib/Makefile mail/Makefile mail/testsuite/Makefile libmailutils/auth/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 @@ -36,7 +36,9 @@ programs_TEXINFOS = \ programs/readmsg.texi\ programs/sieve.texi\ programs/guimb.texi\ - programs/maidag.texi\ + programs/mda.texi\ + programs/lmtpd.texi\ + programs/putmail.texi\ programs/mimeview.texi\ programs/pop3d.texi\ programs/imap4d.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 @@ -141,7 +141,9 @@ Mailutils Programs * sieve:: Mail Filtering Utility. * guimb:: Mailbox Scanning and Processing Language. -* maidag:: General-purpose Mail Delivery Agent. +* mda:: Local Mail Delivery Agent. +* lmtpd:: LMTP Daemon. +* putmail:: Incorporate a Message to a Mailbox. * mimeview:: Universal File Viewer. @@ -202,29 +204,13 @@ Debugging @command{mail} --- Send and Receive Mail * Invoking Mail:: Command Line Options. +* Reading Mail:: Reading Mail. * Composing Mail:: Composing Mail. * MIME:: How to Attach Files. -* Reading Mail:: Reading Mail. * Scripting:: Scripting. * Mail Variables:: How to Alter the Behavior of @command{mail}. * Mail Configuration Files:: Personal and System-wide Configuration Files. -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 * Command Syntax:: Syntax of mail internal commands. @@ -245,6 +231,22 @@ Reading Mail * Incorporating New Mail:: * Shell Escapes:: +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 * Movemail Configuration:: @@ -274,28 +276,27 @@ A Sieve Interpreter * Passing Options to Scheme:: * Command Line Option Summary:: -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}. Mailbox Quotas * DBM Quotas:: Keeping Quotas in DBM File. * SQL Quotas:: Keeping Quotas in SQL Database. -Maidag Scripting +Scripting in @command{mda} -* Sieve Maidag Filters:: -* Scheme Maidag Filters:: -* Python Maidag Filters:: +* Sieve MDA Filters:: +* Scheme MDA Filters:: +* Python MDA Filters:: mimeview 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 @@ -32,7 +32,9 @@ syntax. * sieve:: Mail Filtering Utility. * guimb:: Mailbox Scanning and Processing Language. -* maidag:: General-purpose Mail Delivery Agent. +* mda:: Local Mail Delivery Agent. +* lmtpd:: LMTP Daemon. +* putmail:: Incorporate a Message to a Mailbox. * mimeview:: Universal File Viewer. @@ -2890,9 +2892,19 @@ Show payload information @include programs/guimb.texi @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 @page @node mimeview 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 @@ -2,54 +2,50 @@ @c Copyright (C) 1999-2019 Free Software Foundation, Inc. @c See file mailutils.texi for copying conditions. @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 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 @samp{w} flag, since in that case the user is not required to have a valid account on the machine that runs @command{sendmail}. @@ -57,7 +53,7 @@ valid account on the machine that runs @command{sendmail}. 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, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, T=DNS/RFC822/X-Unix, @@ -68,72 +64,46 @@ To define local mailer in @samp{mc} source file, it will suffice to set: @example -define(`LOCAL_MAILER_PATH', `/usr/local/sbin/maidag') +define(`LOCAL_MAILER_PATH', `/usr/local/sbin/mda') define(`LOCAL_MAILER_ARGS', `mail $u') @end example -@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 and director in @file{exim.conf}: @example # transport -maidag_pipe: +mda_pipe: driver = pipe - command = /usr/local/sbin/maidag $local_part + command = /usr/local/sbin/mda $local_part return_path_add delivery_date_add envelope_to_add # 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. @node Mailbox Quotas @subsection Mailbox Quotas @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 sender. The error code is accompanied by the following error message: @@ -155,7 +125,9 @@ unavailable} (corresponding to the @acronym{SMTP} return code @command{maidag} configuration file: @example -exit-quota-tempfail yes; +quota @{ + exit-tempfail yes; +@} @end example @noindent @@ -181,7 +153,7 @@ To use @acronym{DBM} quota database, GNU Mailutils must be compiled with one of the following command line options: @option{--with-gdbm}, @option{--with-berkeley-db}, @option{--with-ndbm}, @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. The quota database should have the following structure: @@ -199,7 +171,7 @@ maximum mailbox size in bytes. A number may optionally be followed by A special value @samp{NONE} means no mailbox size limit for this user. @end table -Here is an example of a valid quota database +Here is an example of a quota database in text form: @example # Default quota value: @@ -215,17 +187,19 @@ karin 10mB @end example 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 @node SQL Quotas @subsubsection Keeping Quotas in SQL Database -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 using the credentials set in @samp{sql} configuration statement (@pxref{SQL Statement}). @@ -248,11 +222,21 @@ To retrieve user quota the following query can be used: SELECT quota FROM mailbox_quota WHERE user_name='$@{user@}' @end example +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 that the @code{user_name} column for this entry is lexicographically less than any other user name in the table. Let's suppose the group @@ -268,8 +252,8 @@ ORDER BY user_name DESC @noindent 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 containing the group quota. @@ -277,15 +261,17 @@ The following configuration statement instructs @command{maidag} to use this query for retrieving the user quota: @example -quota-query "SELECT quota " +quota @{ + sql-query "SELECT quota " "FROM mailbox_quota " "WHERE user_name IN ('$@{user@}','00DEFAULT') " "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 Mailutils version @value{VERSION}, such mail filters may be written in the following languages: @@ -310,30 +296,35 @@ Expands to the recipient home directory. Expands to the recipient user name. @end table +@anchor{scripting language} By default, the filename extension decides which scripting language will be used. User can alter the choice using @samp{language} configuration statement. For example: @example -language "python" -script "~/.maidag-py-filter" +script @{ + language python; + pattern "~/.maidag-py-filter"; +@} @end example @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 The file name of the Sieve filter to use is specified using @samp{script} configuration statement. For example, the following configuration statement: @example -script "~/.maidag.sv" +script @{ + pattern "~/.maidag.sv"; +@} @end example @noindent @@ -350,23 +341,25 @@ example, to deliver message to another mailbox, use the Any modifications to headers or body of the message performed by the 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 The file name of the Scheme mail filter is specified using @samp{script} configuration statement. For example, the following configuration statement: @example -script "~/.maidag.scm" +script @{ + pattern "~/.maidag.scm"; +@} @end example @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 The file name of the Python mail filter is specified using @@ -374,12 +367,14 @@ The file name of the Python mail filter is specified using configuration statement: @example -script "~/.maidag.py" +script @{ + pattern "~/.maidag.py"; +@} @end example @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. @noindent A simple example of a mail filter written in Python: @@ -416,30 +411,49 @@ except Exception: @node Forwarding @subsection Forwarding @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 forward his mail. Normally, forward files are processed by @acronym{MTA}. However, there are some @acronym{MTA} that lack this 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 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: @table @asis @@ -467,48 +481,156 @@ The file cannot reside in a world writable directory. All of the above checks. @end table -The default is @samp{forward-file-checks all}. +The default is @samp{file-checks all}. Each of these keywords may be prefixed by @samp{no} to disable this 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 |