File: pf-check.rc

package info (click to toggle)
procmail-lib 1:1997.07.22-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 280 kB
  • ctags: 22
  • sloc: perl: 213; makefile: 126; sh: 6
file content (49 lines) | stat: -rw-r--r-- 1,185 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
# pf-check.rc
#
# $Id: pf-check.rc,v 1.1.1.1 1996/08/16 18:27:12 aks Exp $
#
# Procmail recipe file to check if an address is from a given 
# address or, if it is from me, if it is *to* that same address.
#
# If the address matches, append DEST to PF_DEST.
#
# After all checks are complete, invoke pf-save.rc to save the
# message into the appropriate folders.  See its comments for details.
#
# Clear these variables before invoking the first time:
# 
# PF_DEST  The destination of all filed mail.
# PF_FROM  The derived FROM address.
#
# Set these variables before invoking:
#
# ADDR  Address to which addressed mail will be filed
#       into the named folder.
#
# DEST  Destination into which addressed mail will be 
#       dropped.
#
# INCLUDERC=pf-check.rc

:0
* ADDR ?? .
* DEST ?? .
{
  # Figure out who this mail is from
  :0
  * ! PF_FROM ?? .
  { PF_FROM=`formail -rtzxTo:` }

  # is this mail from the given $ADDR?
  # if so, prefile it
  :0
  * $ PF_FROM ?? $ADDR
  { PF_DEST="$PF_DEST $DEST" }

  # if not directly from the address, see if it is from me,
  # and to the address.
  :0 E
  * $ PF_FROM ?? ${USER:-$LOGNAME}
  * $ ^TO$ADDR
  { PF_DEST="$PF_DEST $DEST" }
}