File: headers.rc

package info (click to toggle)
procmail-lib 1:1995.08.28-4.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 156 kB
  • ctags: 32
  • sloc: perl: 213; makefile: 143
file content (77 lines) | stat: -rw-r--r-- 2,910 bytes parent folder | download | duplicates (3)
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
# procmail rc to define patterns to recognize the headers
#
# $Id: headers.rc,v 1.3 1995/07/14 20:49:58 aks Exp $
#
#    Copyright (C) 1995  Alan K. Stebbens <aks@hub.ucsb.edu>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
# Use these is recipes like this:
#
#  # If mail is from john or mary, then file in "+urgent"
#  :0
#  * $ $FROM(john|mary)@
#  urgent/.
#
#  # if the mail is directly to me, then file it
#  :0
#  * $ $TO($USER)@
#  mymail/.
# 
# These patterns span any comment text before and after email addresses
# Use PRE_ADDR_SPAN before any names; it will span a string of non-address
# characters up to the beginning of a valid email address.

PRE_ADDR_SPAN='(.*[^-(.%@a-zA-Z0-9])?'

# Use POST_ADDR_SPAN after any names; it will span a string of non-address
# characters up to the a comma "," or the end of the line
POST_ADDR_SPAN='(([^),.!:a-zA-Z0-9].*)?(,|$[^>]))'

# These are to match RFC822 style addresses (not including UUCP addresses)
# Use $USERADDR to match a user name part of an email address
USERADDR='[-a-zA-Z0-9$_:.+=/]+'

# Use $HOSTADDR to match the FQDN hostname part of an address
HOSTADDR='[-a-zA-Z0-9$_:.+=/]+'

# Use $HOSTNAME to match the "plain" hostname (not include any domains)
HOSTNAME='[-a-zA-Z0-9$_:+=/]+'

# Use $ADDR to match either an RFC 822 or UUCP email address
ADDRESS="<?($USERADDR(@$HOSTADDR)?|($HOSTADDR!)+$USERADDR)>?"

# Use $FROM to match mail from someone
FROM="(^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )$PRE_ADDR_SPAN)"

# Use $TO to match mail to someone (but only "To:", not "Cc:")
TO="(^((Original-)?(Resent-)?To|(X-Envelope|Apparently(-Resent)?)-To):$PRE_ADDR_SPAN)"

# Use $CC to match mail to someone (but only "Cc:", not "To")
CC="(^((Original-)?(Resent-)?Cc|(X-Envelope|Apparently(-Resent)?)-Cc):$PRE_ADDR_SPAN)"

# For completeness, this should be roughly equivalent to ^TO
TOCC="($TO|$CC)"

# Pattern to recognize lists by precedence
LIST_PRECEDENCE='(^Precedence:.*(junk|bulk|list))'

# Names of common list mailers
LIST_MAILERS='((Mailer-)?daemon|root|LISTSERV|[a-zA-Z0-9-]+-(list|request|owner)|\
Majordomo|Mailagent|Postmaster|mmdf|news|n?uucp)'

# Pattern to put them all together
FROM_LIST="($LIST_PRECEDENCE|$FROM$LIST_MAILERS$POST_ADDR_SPAN)"