File: filter_16.html

package info (click to toggle)
exim-html 3.20-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge, woody
  • size: 2,868 kB
  • ctags: 4,188
  • sloc: makefile: 40; sh: 19
file content (164 lines) | stat: -rw-r--r-- 6,697 bytes parent folder | download
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
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from filter on 25 November 2000 -->

<TITLE>Exim Filter Specification - Mail commands</TITLE>
</HEAD>
<body bgcolor="#FFFFFF" text="#00005A" link="#FF6600" alink="#FF9933" vlink="#990000">
Go to the <A HREF="filter_1.html">first</A>, <A HREF="filter_15.html">previous</A>, <A HREF="filter_17.html">next</A>, <A HREF="filter_34.html">last</A> section, <A HREF="filter_toc.html">table of contents</A>.
<P><HR><P>


<H2><A NAME="SEC16" HREF="filter_toc.html#TOC16">Mail commands</A></H2>

<P>
There are two commands which cause the creation of a new mail message, neither
of which count as a significant delivery unless the command is preceded by the
word <TT>`seen'</TT>. This is a powerful facility, but it should be used with care,
because of the danger of creating infinite sequences of messages. The system
administrator can forbid the use of these commands altogether.

</P>
<P>
To help prevent runaway message sequences, these commands have no effect when
the incoming message is a delivery error message, and messages sent by this
means are treated as if they were reporting delivery errors. Thus they should
never themselves cause a delivery error message to be returned. The basic
mail-sending command is

<PRE>
     mail [to &#60;<EM>address-list</EM>&#62;]
          [cc &#60;<EM>address-list</EM>&#62;]
          [bcc &#60;<EM>address-list</EM>&#62;]
          [from &#60;<EM>address</EM>&#62;]
          [reply_to &#60;<EM>address</EM>&#62;]
          [subject &#60;<EM>text</EM>&#62;]
          [text &#60;<EM>text</EM>&#62;]
          [[expand] file &#60;<EM>filename</EM>&#62;]
          [return message]
          [log &#60;<EM>log file name</EM>&#62;]
          [once &#60;<EM>note file name</EM>&#62;]
          [once_repeat &#60;<EM>time interval</EM>&#62;]
<P>
e.g. mail text "Your message about $h_subject has been received"
</PRE>

<P>
As a convenience for use in one common case, there is also a command called
<EM>vacation</EM>. It behaves in the same way as <EM>mail</EM>, except that the defaults for
the <TT>`file'</TT>, <TT>`log'</TT>, <TT>`once'</TT>,
and <TT>`once_repeat'</TT>
options are

<PRE>
expand file .vacation.msg
log  .vacation.log
once .vacation
once_repeat 7d
</PRE>

<P>
respectively.
These are the same file names and repeat period used by the traditional Unix
<EM>vacation</EM> command. The defaults can be overridden by explicit settings, but
if a file name is given its contents are expanded only if explicitly requested.
The <EM>vacation</EM> command is normally used conditionally, subject to the
<EM>personal</EM> condition (see section 21 below) so as not to send
automatic replies to non-personal messages from mailing lists or elsewhere.

</P>
<P>
For both commands, the key/value argument pairs can appear in any order. At
least one of <TT>`text'</TT> or <TT>`file'</TT> must appear (except with <TT>`vacation'</TT>); if
both are present, the text string appears first in the message. If <TT>`expand'</TT>
precedes <TT>`file'</TT>, then each line of the file is subject to string expansion as
it is included in the message.

</P>
<P>
Several lines of text can be supplied to <TT>`text'</TT> by including the escape
sequence `\n' in the string where newlines are required. If the command is
output during filter file testing, newlines in the text are shown as `\n'.

</P>
<P>
Note that the keyword for creating a <TT>`Reply-To:'</TT> header is <EM>reply_to</EM>,
because Exim keywords may contain underscores, but not hyphens. If the <EM>from</EM>
keyword is present and the given address does not match the user who owns the
forward file, Exim normally adds a <EM>Sender:</EM> header to the message,
<font color=green>
though it can be configured not to do this.
</font>

</P>
<P>
If no <TT>`to'</TT> argument appears, the message is sent to the address in the
<TT>`$reply_address'</TT> variable (see section 6 above).
An <TT>`In-Reply-To:'</TT> header is automatically included in the created message,
giving a reference to the message identification of the incoming message.

</P>
<P>
If <EM>return message</EM> is specified, the incoming message that caused the filter
file to be run is added to the end of the message, subject to a maximum size
limitation.

</P>
<P>
If a log file is specified, a line is added to it for each message sent.

</P>
<P>
If a <TT>`once'</TT> file is specified, it is used to hold a database for remembering
who has received a message, and no more than one message is ever sent to any
particular address,
unless <TT>`once_repeat'</TT> is set. This specifies a time interval after which
another copy of the message is sent. The interval is specified as a sequence of
numbers, each followed by the initial letter of one of `seconds', `minutes',
`hours', `days', or `weeks'. For example,

<PRE>
once_repeat 5d4h
</PRE>

<P>
causes a new message to be sent if 5 days and 4 hours have elapsed since the
last one was sent. There must be no white space in a time interval.

</P>
<P>
Commonly, the file name specified for <TT>`once'</TT> is used as the base name for
direct-access (DBM) file operations. There are a number of different DBM
libraries in existence. Some operating systems provide one as a default, but
even in this case a different one may have been used when building Exim. With
some DBM libraries, specifying <TT>`once'</TT> results in two files being created,
with the suffixes <TT>`.dir'</TT> and <TT>`.pag'</TT> being added to the given name. With
some others a single file with the suffix <TT>`.db'</TT> is used, or the name is used
unchanged.

</P>
<P>
<font color=green>
Using a DBM file for implementing the <TT>`once'</TT> feature means that the file
grows as large as necessary. This is not usually a problem, but some system
administrators want to put a limit on it. The facility can be configured not to
use a DBM file, but instead, to use a regular file with a maximum size. The
data in such a file is searched sequentially, and if the file fills up, the
oldest entry is deleted to make way for a new one. This means that some
correspondents may receive a second copy of the message after an unpredicatable
interval. Consult your local information to see if your system is configured
this way.
</font>

</P>
<P>
More than one <EM>mail</EM> or <EM>vacation</EM> command may be obeyed in a single filter
run; they are all honoured, even when they are to the same recipient.

</P>

<P><HR><P>
Go to the <A HREF="filter_1.html">first</A>, <A HREF="filter_15.html">previous</A>, <A HREF="filter_17.html">next</A>, <A HREF="filter_34.html">last</A> section, <A HREF="filter_toc.html">table of contents</A>.
</BODY>
</HTML>