1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<!-- Copyright 1998 - 2009 Double Precision, Inc. See COPYING for -->
<!-- distribution information. -->
<refentry id="maildrop">
<info><author><firstname>Sam</firstname><surname>Varshavchik</surname><contrib>Author</contrib></author><productname>Courier Mail Server</productname></info>
<refmeta>
<refentrytitle>maildrop</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class='manual'>Double Precision, Inc.</refmiscinfo>
</refmeta>
<refnamediv>
<refname>maildrop</refname>
<refpurpose>mail delivery filter/agent</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis sepchar=" ">
<command>maildrop</command>
<arg rep="repeat" choice="opt">option</arg>
<arg choice="opt" rep="norepeat">-d <replaceable>user</replaceable></arg>
<arg rep="repeat" choice="opt"><replaceable>arg</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>maildrop</command>
<arg rep="repeat" choice="opt">option</arg>
<arg choice="opt" rep="norepeat"><replaceable>filename</replaceable></arg>
<arg rep="repeat" choice="opt"><replaceable>arg</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="description">
<title>DESCRIPTION</title>
<para>
<command>maildrop</command> is a replacement local mail delivery agent that
includes a mail filtering language.
The system administrator can either
replace the existing mail delivery agent with <command>maildrop</command>,
or users may
run <command>maildrop</command> using the 'forward to program' mechanism of
the existing mail delivery agent.</para>
<para>
<command>maildrop</command> first reads the E-mail message on
standard input.
Trailing carriage return characters are automatically stripped.
An E-mail message consists of header lines, followed by a blank line, followed
by the contents of the message.</para>
<para>
<command>maildrop</command> does not accept an mbox-style
<literal>From_</literal>
line before the first header line.
<command>maildrop</command> does not accept leading empty lines before
the first non-blank header line. If the message can possibly start with
empty lines, and a
<literal>From_</literal>
line, use <command>reformail -f0</command> to remove any initial
empty lines, and replace a <literal>From_</literal> line with a
proper <quote>Return-Path:</quote> header; then pipe it to
<command>maildrop</command>.</para>
<para>
If the file <filename>@withetcdir@/maildroprc</filename> exists, mail
delivery or mail filtering instructions are read from that file.
<command>maildrop</command>'s delivery/filtering instructions may direct
<command>maildrop</command> to save the
message in specific mailbox, discard it, return it to sender, or forward it to
a different E-mail address.
</para>
<para>
If <filename>@withetcdir@/maildroprc</filename> does not exist, or
its mail delivery instructions do not completely dispose of this message,
<command>maildrop</command> then reads the mail delivery instructions
from <filename>$HOME/.mailfilter</filename>.
If it doesn't exist, or its mail delivery instructions do not completely
dispose of the message, <command>maildrop</command>
then saves the E-mail message
in the default mailbox.</para>
<para>
<command>maildrop</command> knows how to deliver mail to an standard mailbox
files; it
also knows how to deliver to maildirs. A <literal>maildir</literal> is a
directory-based mail format used by the
<ulink url="http://www.courier-mta.org"><application>Courier</application></ulink>
and
<application>Qmail</application>
mail servers.
Many other mail servers also know how to read maildirs.
When delivering to mailbox files, <command>maildrop</command> will lock the
mailbox for the duration of the delivery.</para>
<para>
This is the general mail delivery behavior.
There are minor differences in behavior depending on
<command>maildrop</command> delivery mode, which is determined based on
how
<command>maildrop</command> was started.
<command>maildrop</command> uses three different primary operating modes:
</para>
<variablelist>
<varlistentry>
<term>Manual mode</term>
<listitem>
<para>
A file containing filtering instructions -
<replaceable>filename</replaceable>
is specified as an argument to the <command>maildrop</command> command.
<command>maildrop</command> reads this
<replaceable>filename</replaceable>
and follows the instructions in it.
Unless the message is explicitly forwarded, bounced,
deleted, or delivered to a specific mailbox, it will be delivered to the
user's system mailbox.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Delivery mode</term>
<listitem>
<para>
<command>maildrop</command>
is the mail server's mail delivery agent.
<command>maildrop</command> runs in
delivery mode when no <replaceable>filename</replaceable>
is specified on the command line.
<command>maildrop</command> changes the current directory to the user's
home directory, then reads <filename>@withetcdir@/maildroprc</filename>,
then <filename>$HOME/.mailfilter</filename>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Embedded mode</term>
<listitem>
<para>
<command>maildrop</command> functions as a part of another application.
The embedded mode is used by the
<ulink url="http://www.courier-mta.org"><application>Courier</application></ulink>
mail server to integrate mail filtering directly
into the process of receiving mail from a remote mail relay, thus rejecting
unwanted mail before it is even accepted for local mail delivery.
Embedded mode is used when either the -m, or the -M, option is specified,
and is described below.
See below for a more extensive description of the embedded mode.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="security">
<title>SECURITY</title>
<para>
It is safe to install <command>maildrop</command> as a root setuid program.
<ulink url="http://www.courier-mta.org">The <application>Courier</application> mail server</ulink>
installs <command>maildrop</command> as a root setuid program by default,
in order to be able to use <command>maildrop</command> in embedded mode.
If root runs <command>maildrop</command> (or it is setuided to root)
the <option>-d</option> option may be used to
specify the message's recipient. <command>maildrop</command>
immediately resets its userid to the one specified by the
<option>-d</option> option. The
user's
<filename>$HOME/.mailfilter</filename>
is read (if it exists), and the message
is delivered to the indicated user.</para>
<para>
The system administrator can configure <command>maildrop</command> to restrict
the <option>-d</option> option for everyone except the mail system
itself.</para>
<para>
If in delivery mode the user's home directory has the sticky bit set,
<command>maildrop</command> immediately terminates with an exit code of
<errorcode>EX_TEMPFAIL</errorcode>, without doing anything.
Mail servers interpret the
<errorcode>EX_TEMPFAIL</errorcode> exit code as a request to reschedule the
message
for another delivery attempt later. Setting the sticky bit allows
<filename>$HOME/.mailfilter</filename> to be edited while
temporarily holding all incoming mail.</para>
<para>
<command>maildrop</command> also terminates with
<errorcode>EX_TEMPFAIL</errorcode> if the user's home directory has world write
permissions.</para>
<para>
<command>maildrop</command> immediately terminates with
<errorcode>EX_TEMPFAIL</errorcode> if the <filename>filename</filename> is
not owned by the user,
or if it has any group or world permissions. This includes read permissions.
The permissions on
<filename>$HOME/.mailfilter</filename> may only include read and
write privileges to the user.</para>
<para>When using the special embedded mode (see below)
<command>maildrop</command>
immediately terminates with the exit code set to
<errorcode>EX_TEMPFAIL</errorcode> if
<filename>$HOME/.mailfilters</filename>
is not owned by the user, or if it has any
group or world permissions.</para>
</refsect1>
<refsect1 id="temporaryfiles">
<title>TEMPORARY FILES</title>
<para>
<command>maildrop</command> is heavily optimized and tries to use as
little resources as possible. <command>maildrop</command> reads small
messages into
memory, then filters and/or delivers the message directly from memory. For
larger messages, <command>maildrop</command> accesses the message directly
from the file.
If the standard input is not a file, <command>maildrop</command> writes the
message to a
temporary file, then accesses the message from the temporary file. The
temporary file is automatically removed when the message is delivered.</para>
</refsect1>
<refsect1 id="options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>-a</term>
<listitem>
<para>
Makes the <application>Courier</application>
Authentication Library usage mandatory, i.e. maildrop
will throw a temporary error code if the call to the authlib mechanism
fails for some reason, such as authdaemon being inaccessible.</para>
<note>
<para>
This setting may already be the default, depending on maildrop's
configuration.</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>-A "<replaceable>Header: value</replaceable>"</term>
<listitem>
<para>
Adds an additional header to the message. Specifying
<emphasis>-A "Foo: Bar"</emphasis> effectively adds this header to the
message being delivered.</para>
<para>
The mail transport agent usually adds additional headers when delivering a
message to a local mailbox. The way it's usually done is by the mail
transport agent sending the message using a pipe to the local delivery
agent - such as <command>maildrop</command> - and adding some additional
headers in the
process.
Because <command>maildrop</command> receives the message from a pipe,
<command>maildrop</command> must either save the message in memory or write
the message into a temporary file.</para>
<para>
The <option>-A</option> option enables the file containing the message
to be provided to <command>maildrop</command> directly, as standard input,
and the additional headers specified on the command line.
Because the standard input is a file,
<command>maildrop</command> will not need a temporary file.
Multiple <option>-A</option> options may be specified.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-d <replaceable>user</replaceable></term>
<listitem>
<para>
Run <command>maildrop</command> in delivery mode for this user ID.</para>
<para>
The system administrator may optionally restrict the
<option>-d</option> option to be available to the mail system only, so
it may not be available to you.
In all cases, the <option>-d</option> option is allowed if
<replaceable>user</replaceable> is the same user who is running
<command>maildrop</command>.
Also, for the <option>-d</option> option to work at all,
<command>maildrop</command> must be executed by root, or
<command>maildrop</command> must be a root-owned program with the setuid bit
set.
Absence of a <filename>filename</filename>
on
<command>maildrop</command>'s command line
implies the <option>-d</option> option for the user running
<command>maildrop</command>.</para>
<para>
If <option>-d</option> is not specified, the first argument following all the
options is
a name of the file containing filtering instructions. The remaining
arguments, if any, are assigned to the variables
<varname>$1</varname>,
<varname>$2</varname>, and so on (see
<ulink url="maildropfilter.html#environment">"Environment"</ulink> and
<ulink url="maildropfilter.html#varsubst">"Variable substitution"</ulink>).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-f <replaceable>address</replaceable></term>
<listitem>
<para>
Sets the FROM variable (message envelope sender) to
<replaceable>address</replaceable>.
The system administrator may optionally disable the
<option>-f</option> option for users, so it may not be available to you.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-m</term>
<listitem>
<para>
Run <command>maildrop</command> in embedded mode.
It's possible to use both the <option>-m</option>, and the
<option>-d</option> options, but it doesn't make much sense to do so.
Even if you really wanted to run your message through someone else's
<filename>.mailfilter</filename>,
that <filename>.mailfilter</filename> probably has at least one
instruction which is not allowed in the embedded mode.</para>
<para>
The <filename>filename</filename> argument to <command>maildrop</command>
should be specified.
<filename>filename</filename> is a file that includes filtering
instructions to be processed in embedded mode.
The <filename>-m</filename> option is used for debugging filter files which
are later placed in
<filename>$HOME/.mailfilters</filename>, and used with the
<option>-M</option> option.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-M <replaceable>filterfile</replaceable></term>
<listitem>
<anchor id="moption"/>
<para>
Run <command>maildrop</command> in a special embedded mode.
The <option>-d</option>
option is implied when <option>-M</option> is used, and if absent it defaults
to the userid running <command>maildrop</command>.</para>
<para>
All the requirements for the <option>-d</option> option apply.
<command>maildrop</command> must either
be executed by root, or the <command>maildrop</command> program must be owned
by root with the setuid bit set.
<command>maildrop</command> immediately gives up root
privileges by changing its user ID to the one specified by <option>-d</option>,
then reads
<filename>$HOME/.mailfilters/<replaceable>filterfile</replaceable></filename>. For security reasons the name of the file may not begin with a slash or include
periods.
<command>maildrop</command> is very paranoid:
both <filename>$HOME/.mailfilters</filename>, and
<filename>$HOME/.mailfilters/<replaceable>filterfile</replaceable></filename>
must be owned by the user, and may not have any group or world
permissions.</para>
<para>
The <option>-M</option> option allows for some friendly cooperation between
the user
running the application, and the user who provides a filter for the
embedded mode. The user running the application can use someone else's
canned filter and be assured that the filter is not going to run amok and
start sending mail or create files all over the place. The user who
provides the filter can be assured that the environment variables are
clean, and that there are no surprises.</para>
<para>
<command>maildrop</command> supports the concept of "default" filter files.
If the
file specified by the <command>-M</command> option cannot be found in
<filename>$HOME/.mailfilters</filename>,
<command>maildrop</command> will try to open
<filename>$HOME/.mailfilters/<replaceable>filterfileprefix</replaceable>-default</filename>.
<replaceable>filterfileprefix</replaceable> is the initial part
of <replaceable>filterfile</replaceable> up until the last '-' character in
<replaceable>filterfile</replaceable>.</para>
<para>
If
<filename>$HOME/.mailfilters/<replaceable>filterfileprefix</replaceable>-default</filename>
does not exist, and there are any other dashes left in
<replaceable>filterfileprefix</replaceable>, maildrop
removes the last dash and everything
following it, then tries again.</para>
<para>
As a last resort <command>maildrop</command>
tries to open <filename>$HOME/.mailfilters/default</filename>.</para>
<para>
For example, if the parameter to the <option>-M</option> option is
<emphasis>mailfilter-lists-maildrop</emphasis>, <command>maildrop</command> will try to open the following files, in order:
<blockquote>
<literallayout format="linespecific" class="normal">
<filename>$HOME/.mailfilters/mailfilter-lists-maildrop</filename>
<filename>$HOME/.mailfilters/mailfilter-lists-maildrop-default</filename>
<filename>$HOME/.mailfilters/mailfilter-lists-default</filename>
<filename>$HOME/.mailfilters/mailfilter-default</filename>
<filename>$HOME/.mailfilters/default</filename>
</literallayout>
</blockquote>
</para>
<para>
Note that <command>maildrop</command> looks for -default files ONLY if
<option>-M</option> is used.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-D <replaceable>uuu/ggg</replaceable></term>
<listitem>
<para>
This option is reserved for use by the version of
<command>maildrop</command> that comes integrated with the
<ulink url="http://www.courier-mta.org"><application>Courier</application> mail server</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-V <replaceable>level</replaceable></term>
<listitem>
<para>
Initialize the <varname>VERBOSE</varname> variable to
<replaceable>level</replaceable>.
Because <command>maildrop</command> parses the
entire file before
running it, this option is used to produce debugging output in the
parsing phase. Otherwise, if <filename>filename</filename>
has syntax errors, then
no debugging output is possible because the <varname>VERBOSE</varname> variable
is not yet set.</para>
<para>
<option>-V</option> is ignored when <command>maildrop</command> runs in
delivery mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-w <replaceable>N</replaceable></term>
<listitem>
<para>
The <option>-w N</option> option places a warning message
into the maildir if the maildir has a quota setting, and after
the message was successfully delivered the maildir was at least
<replaceable>N</replaceable> percent full.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-W <replaceable>filename</replaceable></term>
<listitem>
<para>
Copy the warning message from <replaceable>filename</replaceable>, or from
<filename>@sysconfdir@/quotawarnmsg</filename> if this option is not specified,
with the addition of the
"<literal>Date:</literal>" and
"<literal>Message-Id:</literal>" headers.
The warning is repeated every 24 hours (at least), until the maildir drops
below
<replaceable>N</replaceable> percent full.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-t <replaceable>socket</replaceable></term>
<listitem>
<para>
This option is available if maildrop is compiled with optional
Dovecot authentication support. <replaceable>socket</replaceable>
specifies the location of Dovecot master authentication socket,
for example <filename>/var/run/dovecot/auth-master</filename>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="deliverymode">
<title>DELIVERY MODE</title>
<para>
If a <filename>filename</filename> is not specified on the command line, or
if the <option>-d</option>
option is used, <command>maildrop</command> will run in delivery mode.
In delivery mode,
<command>maildrop</command> changes to the home directory of the user
specified by the <option>-d</option>
option (or the user who is running <command>maildrop</command> if the
<option>-d</option> option was not
given) and reads <filename>$HOME/.mailfilter</filename> for filtering
instructions. <filename>$HOME/.mailfilter</filename> must be owned by the
user, and have no group
or global permissions (<command>maildrop</command> terminates if it
does).</para>
<para>
If <filename>$HOME/.mailfilter</filename> does not exist,
<command>maildrop</command> will
simply deliver the message to the user's mailbox.</para>
<para>If the file <filename>@withetcdir@/maildroprc</filename> exists,
<command>maildrop</command> reads filtering instructions from this file first,
before reading
<filename>$HOME/.mailfilter</filename>. This allows the system administrator
to provide global filtering instructions for all users.</para>
<note>
<para>
<filename>@withetcdir@/maildroprc</filename> is read only in
delivery mode.</para>
</note>
</refsect1>
<refsect1 id="virtualaccounts">
<title>VIRTUAL ACCOUNTS</title>
<para>
The <option>-d</option> option can also specify a name of a virtual account
or mailbox. See the
<citerefentry><refentrytitle>makeuserdb</refentrytitle><manvolnum>1</manvolnum></citerefentry>
manual page in the <application>Courier</application>
Authentication library's documentation
for more information.</para>
</refsect1>
<refsect1 id="embeddedmode">
<title>EMBEDDED MODE</title>
<anchor id="embedded"/>
<para>
The embedded mode is used when <command>maildrop</command>'s filtering
abilities are
desired, but no actual mail delivery is needed. In embedded mode
<command>maildrop</command> is executed by another application, and
<ulink url="#options">is
passed the ‐m or the ‐M option.</ulink> <command>maildrop</command> reads the
message, then runs the filtering rules specified in
<filename>filename</filename>.</para>
<para>
<filename>filename</filename>
may contain any filtering instructions EXCEPT the following:
<variablelist>
<varlistentry>
<term>` ... `</term>
<listitem>
<para>
Text strings delimited by back-tick characters (run shell
command) are not allowed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropfilter.html#cc">cc</ulink></term>
<listitem>
<para>
The <command>cc</command> command is not allowed in embedded mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropfilter.html#dotlock">dotlock</ulink></term>
<listitem>
<para>
The <command>dotlock</command> command is not allowed in embedded mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropfilter.html#flock">flock</ulink></term>
<listitem>
<para>
The <command>flock</command> command is not allowed in embedded mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropgdbm.html">gdbmopen</ulink></term>
<listitem>
<para>
In embedded mode, GDBM
databases may be opened only for reading.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropfilter.html#log">log</ulink></term>
<listitem>
<para>
The <command>log</command> command is not allowed in embedded mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropfilter.html#log">logfile</ulink></term>
<listitem>
<para>
The <command>logfile</command> command is not allowed in embedded mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropfilter.html#system">system</ulink></term>
<listitem>
<para>
The <command>system</command> command is not allowed in embedded mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropfilter.html#to">to</ulink></term>
<listitem>
<para>
The <command>to</command> command is not allowed in embedded mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="maildropfilter.html#xfilter">xfilter</ulink></term>
<listitem>
<para>
The <command>xfilter</command> command is not allowed in embedded mode.</para>
</listitem>
</varlistentry>
</variablelist></para>
<para>
Normally when the <filename>filename</filename> does not explicitly delivers
a message,
<command>maildrop</command> will deliver the message to the user's default mailbox. This is also disabled in embedded mode.</para>
<para>
The <filename>filename</filename> may communicate with the parent application
by
using the <ulink url="maildropfilter.html#echo">echo</ulink> statement and the
<varname>EXITCODE</varname> environment variable.</para>
<refsect2 id="maildroprcs">
<title><filename>@withetcdir@/maildroprcs</filename></title>
<para>If <command>maildrop</command> encounters an
<ulink url="maildropfilter.html#include">include</ulink>
statement where the filename
starts with <filename>@withetcdir@/maildroprcs/</filename>,
the normal restrictions
for the embedded mode are suspended while executing the filter file in the
<filename>@withetcdir@/maildroprcs</filename> directory. The restrictions are
also
suspended for any additional filter files that are included from
<filename>@withetcdir@/maildroprcs</filename>. The restrictions resume once
<command>maildrop</command> finishes executing the file from
<filename>@withetcdir@/maildroprcs</filename>.</para>
<para>
This allows the system administrator to have a controlled environment for
running external commands (via the backticks, the
<ulink url="maildropfilter.html#system">system</ulink>
or the
<ulink url="maildropfilter.html#xfilter">xfilter</ulink> commands).</para>
<para>
The name of the file may not contain any periods (so that a creative
individual can't write <emphasis>include
"@withetcdir@/maildroprcs/../../home/user/recipe"</emphasis>).</para>
<para>
Before executing the commands in the
<filename>@withetcdir@/maildroprcs</filename>
file, <command>maildrop</command> automatically resets the following variables to their
initial values: <varname>DEFAULT</varname>, <varname>HOME</varname>,
<varname>LOCKEXT</varname>, <varname>LOCKSLEEP</varname>,
<varname>LOCKTIMEOUT</varname>, <varname>LOCKREFRESH</varname>,
<varname>LOGNAME</varname>, <varname>PATH</varname>,
<varname>SENDMAIL</varname>, and <varname>SHELL</varname>.
Please note that the previous
values of these variables (if they were changed) will NOT be restored once
<command>maildrop</command> finishes executing the commands from
<filename>@withetcdir@/maildroprcs</filename>.</para>
</refsect2>
</refsect1>
<refsect1 id="watchdog">
<title>WATCHDOG TIMER</title>
<para>
<command>maildrop</command> has a watchdog timer that attempts to abort runaway
filtering. If filtering is not complete within a predefined time interval
(defined by the system administrator, usually five minutes),
<command>maildrop</command>
terminates.</para>
</refsect1>
<refsect1 id="files">
<title>FILES</title>
<variablelist>
<varlistentry>
<term><filename>/etc/passwd</filename></term>
<listitem>
<para>
Sets user's home directory, and related
variables. If NIS/YP is install, that will be used as well.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>@withetcdir@/maildroprc</filename></term>
<listitem>
<para>
Global filtering instructions for delivery mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>/var/mail</filename></term>
<listitem>
<para>
System mailbox (actual directory defined by the system administrator).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>/usr/lib/sendmail</filename></term>
<listitem>
<para>
Program to forward mail (exact program defined by the system
administrator).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>$HOME/.mailfilter</filename></term>
<listitem>
<para>
Filtering instructions in delivery mode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>$HOME/.mailfilters</filename></term>
<listitem>
<para>
Directory containing files used in special embedded mode.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="seealso">
<title>SEE ALSO</title>
<para>
<ulink url="lockmail.html"><citerefentry><refentrytitle>lockmail</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink>,
<ulink url="maildropfilter.html"><citerefentry><refentrytitle>maildropfilter</refentrytitle><manvolnum>7</manvolnum></citerefentry></ulink>,
<ulink url="makedat.html"><citerefentry><refentrytitle>makedat</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink>,
<ulink url="maildropgdbm.html"><citerefentry><refentrytitle>maildropgdbm</refentrytitle><manvolnum>7</manvolnum></citerefentry></ulink>,
<ulink url="maildropex.html"><citerefentry><refentrytitle>maildropex</refentrytitle><manvolnum>7</manvolnum></citerefentry></ulink>,
<ulink url="reformail.html"><citerefentry><refentrytitle>reformail</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink>,
<ulink url="makemime.html"><citerefentry><refentrytitle>makemime</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink>,
<ulink url="reformime.html"><citerefentry><refentrytitle>reformime</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink>,
<citerefentry><refentrytitle>egrep</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>grep</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
,
<ulink url="courier.html"><citerefentry><refentrytitle>courier</refentrytitle><manvolnum>8</manvolnum></citerefentry></ulink>,
<citerefentry><refentrytitle>sendmail</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
</refsect1>
</refentry>
|