File: filter_22.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 (107 lines) | stat: -rw-r--r-- 3,417 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
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from filter on 25 November 2000 -->

<TITLE>Exim Filter Specification - Testing for personal mail</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_21.html">previous</A>, <A HREF="filter_23.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="SEC22" HREF="filter_toc.html#TOC22">Testing for personal mail</A></H2>

<P>
A common requirement is to distinguish between incoming personal mail and mail
from a mailing list.
In particular, this test is normally required for so-called `vacation
messages'.
The condition

<PRE>
     personal
</PRE>

<P>
is a shorthand for

<PRE>
     $header_to: contains $local_part@$domain and
     $header_from: does not contain $local_part@$domain and
     $header_from: does not contain server@ and
     $header_from: does not contain daemon@ and
     $header_from: does not contain root@ and
     $header_subject: does not contain "circular" and
     $header_precedence: does not contain "bulk" and
     $header_precedence: does not contain "list" and
     $header_precedence: does not contain "junk"
</PRE>

<P>
The variable <TT>`$local_part'</TT> contains the local part of the mail address of
the user whose filter file is being run -- it is normally your login id. The
<TT>`$domain'</TT> variable contains the mail domain. This condition tests for the
appearance of the current user in the <TT>`To:'</TT> header, checks that the sender is
not the current user or one of a number of common daemons, and checks the
content of the <TT>`Subject:'</TT> and <TT>`Precedence:'</TT> headers.

</P>
<P>
If prefixes or suffixes are in use for local parts -- something which depends
on the configuration of Exim (see section 26 below) -- then the first
two tests above are also done with

<PRE>
$local_part_prefix$local_part$local_part_suffix
</PRE>

<P>
instead of just $<EM>local_part</EM>. If the system is configured to rewrite local
parts of mail addresses, for example, to rewrite `dag46' as `Dirk.Gently', then
the rewritten form of the address is also used in the tests.

</P>
<P>
This example shows the use of <EM>personal</EM> in a filter file that is sending out
vacation messages:

<PRE>
if personal then
  mail
   to $reply_address
   subject "Re: $h_subject:"
   file $home/vacation/message
   once $home/vacation/once
   once_repeat 10d
endif
</PRE>

<P>
It is quite common for people who have mail accounts on a number of different
systems to forward all their mail to one system, and in this case a check for
personal mail should test all their various mail addresses. To allow for this,
the <EM>personal</EM> condition keyword can be followed by

<PRE>
alias &#60;<EM>address</EM>&#62;
</PRE>

<P>
any number of times, for example

<PRE>
personal alias smith@else.where alias jones@other.place
</PRE>

<P>
<font color=green>
This causes messages containing the alias addresses in any places where the
local address is tested to be treated as personal.
</font>

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