forked from bhuisgen/rc-vacation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.inc.php.dist
293 lines (223 loc) · 9.9 KB
/
config.inc.php.dist
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<?php
/*
+-----------------------------------------------------------------------+
| Configuration file for vacation module |
| |
| Copyright (C) 2009 Boris HUISGEN <[email protected]> |
| Licensed under the GNU GPL |
+-----------------------------------------------------------------------+
*/
$rcmail_config = array();
// allow vacation start/end dates
$rcmail_config['vacation_gui_vacationdate'] = FALSE;
// allow vacation subject
$rcmail_config['vacation_gui_vacationsubject'] = TRUE;
// allow HTML for vacation message
$rcmail_config['vacation_gui_vacationmessage_html'] = FALSE;
// allow sending message to be keep in inbox
$rcmail_config['vacation_gui_vacationkeepcopyininbox'] = FALSE;
// allow vacation forwarder
$rcmail_config['vacation_gui_vacationforwarder'] = FALSE;
// default vacation subject
$rcmail_config['vacation_subject_default'] = 'Out of office';
// default vacation message
$rcmail_config['vacation_message_default'] = 'I\'m currently out of office.';
// vacation start/end date format
$rcmail_config['vacation_dateformat'] = 'm/d/Y';
// jquery calendar (jqueryui plugin must be enabled)
$rcmail_config['vacation_jquery_calendar'] = FALSE;
$rcmail_config['vacation_jquery_dateformat'] = 'mm/dd/yy';
// add MIME header before the message
$rcmail_config['vacation_message_mime'] = '';
// allow multiple forwarders
$rcmail_config['vacation_forwarder_multiple'] = FALSE;
$rcmail_config['vacation_forwarder_separator'] = ',';
// driver used for backend storage
$rcmail_config['vacation_driver'] = 'sql';
/*
* SQL driver
*/
// database DSN
$rcmail_config['vacation_sql_dsn'] =
'mysql://user:password@localhost/postfix';
// read data queries
$rcmail_config['vacation_sql_read'] =
// MySQL
/**
array(
"SELECT
subject AS vacation_subject,
body AS vacation_message,
active AS vacation_enable,
activefrom AS vacation_start,
activeuntil AS vacation_end
FROM vacation
WHERE email=%username AND domain=%email_domain;"
);
**/
// PostgreSQL
array(
"SELECT
subject AS vacation_subject,
body AS vacation_message,
active AS vacation_enable,
to_char(activefrom, 'DD/MM/YYYY') AS vacation_start,
to_char(activeuntil, 'DD/MM/YYYY') AS vacation_end
FROM vacation
WHERE email=%username AND domain=%email_domain;"
);
// write data queries
$rcmail_config['vacation_sql_write'] =
// MySQL
/**
array(
"DELETE FROM vacation WHERE email=%email AND domain=%email_domain;",
"INSERT INTO vacation (email,domain,subject,body,created,active,activefrom,activeuntil)
VALUES (%email,%email_domain,%vacation_subject,%vacation_message,NOW(),%vacation_enable,%vacation_start,%vacation_end);",
"DELETE from vacation_notification WHERE on_vacation=%email;",
//remove auto, but keep custom aliases
"UPDATE alias SET goto = replace(goto, CONCAT(',',%email_local,'#',%email_domain,'@','autoreply.my.domain'),''), modified = NOW()
WHERE address=%email AND domain=%email_domain;",
//add auto
"UPDATE alias SET goto = CONCAT(goto,',',%email_local,'#',%email_domain,'@','autoreply.my.domain'), modified = NOW()
WHERE address=%email AND domain=%email_domain AND %vacation_enable=1;",
//remove fwd, but keep the other stuff -- good would be some variable with the old forwarder!..
"UPDATE alias SET goto = replace(goto, CONCAT(',',%vacation_forwarder),''), modified = NOW()
WHERE address=%email AND domain=%email_domain AND %vacation_forwarder!='';",
//add fwd
"UPDATE alias SET goto = CONCAT(goto,',',%vacation_forwarder), modified = NOW()
WHERE address=%email AND domain=%email_domain AND %vacation_forwarder!='' AND %vacation_enable=1;",
);
**/
// PostgreSQL
array(
"DELETE FROM vacation WHERE email=%email AND domain=%email_domain;",
"INSERT INTO vacation (email,domain,subject,body,created,active,activefrom,activeuntil)
VALUES (%email,%email_domain,%vacation_subject,%vacation_message,NOW(),%vacation_enable,to_timestamp(%vacation_start),to_timestamp(%vacation_end));",
"DELETE from vacation_notification WHERE on_vacation=%email;",
//remove auto, but keep custom aliases
"UPDATE alias SET goto = replace(goto, ','||%email_local||'#'||%email_domain||'@'||'autoreply.my.domain',''), modified = NOW()
WHERE address=%email AND domain=%email_domain;",
//add auto
"UPDATE alias SET goto = goto||','||%email_local||'#'||%email_domain||'@'||'autoreply.my.domain', modified = NOW()
WHERE address=%email AND domain=%email_domain AND %vacation_enable=true;",
//remove fwd, but keep the other stuff -- good would be some variable with the old forwarder!..
"UPDATE alias SET goto = replace(goto, ','||%vacation_forwarder,''), modified = NOW()
WHERE address=%email AND domain=%email_domain AND %vacation_forwarder!=''",
//add fwd
"UPDATE alias SET goto = goto||','||%vacation_forwarder, modified = NOW()
WHERE address=%email AND domain=%email_domain AND %vacation_forwarder!='' AND %vacation_enable=true;"
);
/*
* LDAP driver
*/
// Server hostname
$rcmail_config['vacation_ldap_host'] = '127.0.0.1';
// Server port
$rcmail_config['vacation_ldap_port'] = 389;
// Use TLS flag
$rcmail_config['vacation_ldap_starttls'] = false;
// Protocol version
$rcmail_config['vacation_ldap_version'] = 3;
// Base DN
$rcmail_config['vacation_ldap_basedn'] = 'dc=ldap,dc=my,dc=domain';
// Bind DN
$rcmail_config['vacation_ldap_binddn'] = 'cn=user,dc=ldap,dc=my,dc=domain';
// Bind password
$rcmail_config['vacation_ldap_bindpw'] = 'pa$$w0rd';
// Attribute name to map email address
$rcmail_config['vacation_ldap_attr_email'] = null;
// Attribute name to map email local part
$rcmail_config['vacation_ldap_attr_emaillocal'] = null;
// Attribute name to map email domain
$rcmail_config['vacation_ldap_attr_emaildomain'] = null;
// Attribute name to map vacation flag
$rcmail_config['vacation_ldap_attr_vacationenable'] = 'vacationActive';
// Attribute value for enabled vacation flag
$rcmail_config['vacation_ldap_attr_vacationenable_value_enabled'] = 'TRUE';
// Attribute value for disabled vacation flag
$rcmail_config['vacation_ldap_attr_vacationenable_value_disabled'] = 'FALSE';
// Attribute name to map vacation start
$rcmail_config['vacation_ldap_attr_vacationstart'] = null;
// Attribute name to map vacation end
$rcmail_config['vacation_ldap_attr_vacationend'] = null;
// Attribute name to map vacation subject
$rcmail_config['vacation_ldap_attr_vacationsubject'] = null;
// Attribute name to map vacation message
$rcmail_config['vacation_ldap_attr_vacationmessage'] =
'vacationInfo';
// Attribute name to map vacation keep copy in inbox flag
$rcmail_config['vacation_ldap_attr_vacationkeepcopyininbox'] = 'vacationKeepCopyInInbox';
// Attribute value for enabled vacation keep copy in inbox flag
$rcmail_config['vacation_ldap_attr_vacationkeepcopyininbox_value_enabled'] = 'TRUE';
// Attribute value for disabled vacation keep copy in inbox flag
$rcmail_config['vacation_ldap_attr_vacationkeepcopyininbox_value_disabled'] = 'FALSE';
// Attribute name to map vacation forwarder
$rcmail_config['vacation_ldap_attr_vacationforwarder'] =
'vacationForward';
// Search base to read data
$rcmail_config['vacation_ldap_search_base'] =
'cn=%email_local,ou=Mailboxes,dc=%email_domain,ou=MailServer,dc=ldap,' .
'dc=my,dc=domain';
// Search filter to read data
$rcmail_config['vacation_ldap_search_filter'] = '(objectClass=mailAccount)';
// Search attributes to read data
$rcmail_config['vacation_ldap_search_attrs'] = array (
'vacationActive',
'vacationInfo');
// array of DN to use for modify operations required to write data.
$rcmail_config['vacation_ldap_modify_dns'] = array (
'cn=%email_local,ou=Mailboxes,dc=%email_domain,ou=MailServer,dc=ldap,dc=my,dc=domain'
);
// array of operations required to write data.
$rcmail_config['vacation_ldap_modify_ops'] = array(
array ('replace' => array(
$rcmail_config['vacation_ldap_attr_vacationenable'] => '%vacation_enable',
$rcmail_config['vacation_ldap_attr_vacationmessage'] => '%vacation_message',
$rcmail_config['vacation_ldap_attr_vacationforwarder'] => '%vacation_forwarder'
)
)
);
/*
* Maildrop driver
*/
// path of the maildir folder
$rcmail_config['vacation_maildrop_maildirpath'] = '/var/vmail/%email_domain/%email_local';
// filename of the vacation message when enabled
$rcmail_config['vacation_maildrop_enabled'] = 'vacation.enabled';
// filename of the vacation message when disabled
$rcmail_config['vacation_maildrop_disabled'] = 'vacation.disabled';
// value for enabled vacation flag
$rcmail_config['vacation_maildrop_vactionenable_value_enabled'] = 'enabled';
// value for disabled vacation flag
$rcmail_config['vacation_maildrop_vacationenable_value_disabled'] = 'disabled';
/*
* Forward vacation driver
*/
// path of the user's forward file readed by the MTA
$rcmail_config['vacation_forward_path'] = '/var/spool/forward/%email_local';
// forward filename
$rcmail_config['vacation_forward_file'] = '.forward';
// create forward path if not exists
$rcmail_config['vacation_forward_create_dir'] = FALSE;
// create forward path with this rights
$rcmail_config['vacation_forward_create_dir_mode'] = 0755;
// vacation message file
$rcmail_config['vacation_forward_message_file'] = '.vacation.msg';
// vacation database file
$rcmail_config['vacation_forward_database_file'] = '.vacation.db';
// vacation database file rights
$rcmail_config['vacation_forward_database_file_mode'] = 0666;
// vacation binary command
$rcmail_config['vacation_forward_vacation_command'] = '/usr/bin/vacation';
// vacation reply interval in days
$rcmail_config['vacation_forward_vacation_reply_interval'] = 0;
// vacation message template
$rcmail_config['vacation_forward_message_template'] =
"From: %email\r\n" .
"Subject: %vacation_subject\r\n" .
"Delivered-By-The-Graces-Of: Vacation\r\n" .
"Precedence: bulk\r\n" .
"\r\n" .
"%vacation_message";
// end vacation config file