-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmailfilter.master
More file actions
90 lines (76 loc) · 1.69 KB
/
mailfilter.master
File metadata and controls
90 lines (76 loc) · 1.69 KB
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
#
# Import variables
#
LOGNAME=tolower("$LOGNAME")
EXTENSION="$1"
RECIPIENT=tolower("$2")
USER=tolower("$3")
HOST=tolower("$4")
SENDER="$5"
DEFAULT="{dist_postfix_vmail_mailbox_base}/$HOST/$USER/."
# Workaround for broken tolower function in some current fedora releases
if(!$USER)
{
USER=$3
}
if(!$HOST)
{
HOST=$4
}
if ( "$EXTENSION" ne "" )
{
DELIMITER="+"
}
if (!$SENDER)
{
SENDER = "<>"
}
#
# Autocreate maildir, if not existant
#
#`test -e {dist_postfix_vmail_mailbox_base}/$HOST`
#if ( $RETURNCODE != 0 )
#{
# `mkdir {dist_postfix_vmail_mailbox_base}/$HOST`
#}
#`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
#if ( $RETURNCODE != 0 )
#{
# `maildirmake {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
# `chmod -R 0700 {dist_postfix_vmail_mailbox_base}/$HOST`
#}
# Check if the user has a autoresponder enabled
`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder`
if ( $RETURNCODE == 0 )
{
include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder"
}
# Create a mailsize file
`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
if ( $RETURNCODE == 0 )
{
`echo $SIZE >> {dist_postfix_vmail_mailbox_base}/$HOST/$USER/ispconfig_mailsize`
}
#
# Test if the user has his own maildrop include,
# if not available, check if $DEFAULT is set
# (newer maildrop get's that from the DB and updates
# it) and deliver or fail temporarily if not available
#
`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter`
if ( $RETURNCODE == 0 )
{
include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter"
}
else
{
if ( "$DEFAULT" ne "" )
{
to "$DEFAULT"
}
else
{
EXITCODE=75
exit
}
}