commit | author | age
|
9200ad
|
1 |
# |
T |
2 |
# Import variables |
|
3 |
# |
|
4 |
|
|
5 |
LOGNAME=tolower("$LOGNAME") |
|
6 |
EXTENSION="$1" |
|
7 |
RECIPIENT=tolower("$2") |
e82cdb
|
8 |
USER=tolower("$3") |
T |
9 |
HOST=tolower("$4") |
9200ad
|
10 |
SENDER="$5" |
T |
11 |
DEFAULT="{dist_postfix_vmail_mailbox_base}/$HOST/$USER/." |
|
12 |
|
b2b3b1
|
13 |
# Workaround for broken tolower function in some current fedora releases |
T |
14 |
|
|
15 |
if(!$USER) |
|
16 |
{ |
|
17 |
USER=$3 |
|
18 |
} |
|
19 |
if(!$HOST) |
|
20 |
{ |
|
21 |
HOST=$4 |
|
22 |
} |
|
23 |
|
9200ad
|
24 |
if ( "$EXTENSION" ne "" ) |
T |
25 |
{ |
|
26 |
DELIMITER="+" |
|
27 |
} |
|
28 |
|
|
29 |
if (!$SENDER) |
|
30 |
{ |
|
31 |
SENDER = "<>" |
|
32 |
} |
|
33 |
|
|
34 |
# |
|
35 |
# Autocreate maildir, if not existant |
|
36 |
# |
|
37 |
|
f2169a
|
38 |
#`test -e {dist_postfix_vmail_mailbox_base}/$HOST` |
T |
39 |
#if ( $RETURNCODE != 0 ) |
|
40 |
#{ |
|
41 |
# `mkdir {dist_postfix_vmail_mailbox_base}/$HOST` |
|
42 |
#} |
9200ad
|
43 |
|
f2169a
|
44 |
#`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER` |
T |
45 |
#if ( $RETURNCODE != 0 ) |
|
46 |
#{ |
|
47 |
# `maildirmake {dist_postfix_vmail_mailbox_base}/$HOST/$USER` |
|
48 |
# `chmod -R 0700 {dist_postfix_vmail_mailbox_base}/$HOST` |
|
49 |
#} |
9200ad
|
50 |
|
e32699
|
51 |
# Check if the user has a autoresponder enabled |
T |
52 |
|
|
53 |
`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder` |
|
54 |
if ( $RETURNCODE == 0 ) |
|
55 |
{ |
|
56 |
include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder" |
|
57 |
} |
|
58 |
|
2e1086
|
59 |
# Create a mailsize file |
6882ab
|
60 |
`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER` |
T |
61 |
if ( $RETURNCODE == 0 ) |
|
62 |
{ |
d1489c
|
63 |
`echo $SIZE >> {dist_postfix_vmail_mailbox_base}/$HOST/$USER/ispconfig_mailsize` |
6882ab
|
64 |
} |
2e1086
|
65 |
|
e32699
|
66 |
|
9200ad
|
67 |
# |
1b063e
|
68 |
# Test if the user has his own maildrop include, |
9200ad
|
69 |
# if not available, check if $DEFAULT is set |
T |
70 |
# (newer maildrop get's that from the DB and updates |
|
71 |
# it) and deliver or fail temporarily if not available |
|
72 |
# |
|
73 |
|
e32699
|
74 |
`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter` |
9200ad
|
75 |
if ( $RETURNCODE == 0 ) |
T |
76 |
{ |
e32699
|
77 |
include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter" |
9200ad
|
78 |
} |
T |
79 |
else |
|
80 |
{ |
|
81 |
if ( "$DEFAULT" ne "" ) |
|
82 |
{ |
|
83 |
to "$DEFAULT" |
|
84 |
} |
|
85 |
else |
|
86 |
{ |
|
87 |
EXITCODE=75 |
|
88 |
exit |
|
89 |
} |
|
90 |
} |