adding error checking in deliver_sendmail class.
[squirrelmail.git] / plugins / administrator / defines.php
1 <?php
2
3 /**
4 * Administrator plugin - Option definitions
5 *
6 * @author Philippe Mingo
7 * @copyright &copy; 1999-2005 The SquirrelMail Project Team
8 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
9 * @version $Id$
10 * @package plugins
11 * @subpackage administrator
12 */
13
14 /** @ignore */
15 if (!defined('SM_PATH')) define('SM_PATH','../../');
16
17 /**
18 * Load SquirrelMail SMPREF constants for default_unseen_notify and
19 * default_unseen_type variables.
20 */
21 require_once( SM_PATH . 'functions/constants.php' );
22
23 /* Define constants for the various option types. */
24 define('SMOPT_TYPE_UNDEFINED', -1);
25 define('SMOPT_TYPE_STRING', 0);
26 define('SMOPT_TYPE_STRLIST', 1);
27 define('SMOPT_TYPE_TEXTAREA', 2);
28 define('SMOPT_TYPE_INTEGER', 3);
29 define('SMOPT_TYPE_FLOAT', 4);
30 define('SMOPT_TYPE_BOOLEAN', 5);
31 define('SMOPT_TYPE_HIDDEN', 6);
32 define('SMOPT_TYPE_COMMENT', 7);
33 define('SMOPT_TYPE_NUMLIST', 8);
34 define('SMOPT_TYPE_TITLE', 9);
35 define('SMOPT_TYPE_THEME', 10);
36 define('SMOPT_TYPE_PLUGINS', 11);
37 define('SMOPT_TYPE_LDAP', 12);
38 define('SMOPT_TYPE_EXTERNAL', 32);
39 define('SMOPT_TYPE_PATH',33);
40
41 global $languages, $version;
42
43 $language_values = array( );
44 foreach ($languages as $lang_key => $lang_attributes) {
45 if (isset($lang_attributes['NAME'])) {
46 $language_values[$lang_key] = $lang_attributes['NAME'];
47 }
48 }
49 asort( $language_values );
50 $language_values = array_merge(array('' => _("Default")), $language_values);
51 $left_size_values = array();
52 for ($lsv = 100; $lsv <= 300; $lsv += 10) {
53 $left_size_values[$lsv] = "$lsv " . _("pixels");
54 }
55
56 $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
57 'type' => SMOPT_TYPE_COMMENT,
58 'size' => 7 ),
59 'SM_ver' => array( 'name' => _("SquirrelMail Version"),
60 'type' => SMOPT_TYPE_EXTERNAL,
61 'value' => "$version" ),
62 'PHP_ver' => array( 'name' => _("PHP Version"),
63 'type' => SMOPT_TYPE_EXTERNAL,
64 'value' => phpversion() ),
65 /* --------------------------------------------------------*/
66 'Group1' => array( 'name' => _("Organization Preferences"),
67 'type' => SMOPT_TYPE_TITLE ),
68 '$org_name' => array( 'name' => _("Organization Name"),
69 'type' => SMOPT_TYPE_STRING,
70 'size' => 40 ),
71 '$org_logo' => array( 'name' => _("Organization Logo"),
72 'type' => SMOPT_TYPE_PATH,
73 'size' => 40,
74 'default' => '../images/sm_logo.png'),
75 '$org_logo_width' => array( 'name' => _("Organization Logo Width"),
76 'type' => SMOPT_TYPE_STRING,
77 'size' => 5,
78 'default' => 0),
79 '$org_logo_height' => array( 'name' => _("Organization Logo Height"),
80 'type' => SMOPT_TYPE_STRING,
81 'size' => 5,
82 'default' => 0),
83 '$org_title' => array( 'name' => _("Organization Title"),
84 'type' => SMOPT_TYPE_STRING,
85 'size' => 40 ),
86 '$signout_page' => array( 'name' => _("Signout Page"),
87 'type' => SMOPT_TYPE_PATH,
88 'size' => 40 ),
89 '$provider_uri' => array( 'name' => _("Provider Link URI"),
90 'type' => SMOPT_TYPE_STRING ),
91 '$provider_name' => array( 'name' => _("Provider Name"),
92 'type' => SMOPT_TYPE_STRING ),
93 '$frame_top' => array( 'name' => _("Top Frame"),
94 'type' => SMOPT_TYPE_STRING,
95 'size' => 40,
96 'default' => '_top' ),
97 /* --------------------------------------------------------*/
98 'Group2' => array( 'name' => _("Server Settings"),
99 'type' => SMOPT_TYPE_TITLE ),
100 '$domain' => array( 'name' => _("Mail Domain"),
101 'type' => SMOPT_TYPE_STRING,
102 'size' => 40 ),
103 '$imapServerAddress' => array( 'name' => _("IMAP Server Address"),
104 'type' => SMOPT_TYPE_STRING,
105 'size' => 40 ),
106 '$imapPort' => array( 'name' => _("IMAP Server Port"),
107 'type' => SMOPT_TYPE_INTEGER ),
108 '$imap_server_type' => array( 'name' => _("IMAP Server Type"),
109 'type' => SMOPT_TYPE_STRLIST,
110 'posvals' => array( 'cyrus' => _("Cyrus IMAP server"),
111 'uw' => _("University of Washington's IMAP server"),
112 'exchange' => _("Microsoft Exchange IMAP server"),
113 'courier' => _("Courier IMAP server"),
114 'macosx' => _("Mac OS X Mailserver"),
115 'hmailserver' => _("hMailServer IMAP server"),
116 'mercury32' => _("Mercury/32 IMAP server"),
117 'bincimap' => _("Binc IMAP server"),
118 'other' => _("Not one of the above servers") ) ),
119 '$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"),
120 'type' => SMOPT_TYPE_STRING,
121 'comment' => _("Use &quot;detect&quot; to auto-detect."),
122 'size' => 10,
123 'default' => 'detect' ),
124 '$use_imap_tls' => array( 'name' => _("Use TLS for IMAP Connections"),
125 'type' => SMOPT_TYPE_BOOLEAN,
126 'comment' => _("Requires PHP 4.3.x! Experimental."),
127 'default' => false ),
128 '$imap_auth_mech' => array( 'name' => _("IMAP Authentication Type"),
129 'type' => SMOPT_TYPE_STRLIST,
130 'posvals' => array('login' => _("IMAP login"),
131 'cram-md5' => 'CRAM-MD5',
132 'digest-md5' => 'DIGEST-MD5'),
133 'default' => 'login' ),
134 '$useSendmail' => array( 'name' => _("Use Sendmail Binary"),
135 'type' => SMOPT_TYPE_BOOLEAN,
136 'comment' => _("Choose &quot;no&quot; for SMTP") ),
137 '$sendmail_path' => array( 'name' => _("Sendmail Path"),
138 'type' => SMOPT_TYPE_STRING,
139 'size' => 40 ),
140 '$sendmail_args' => array( 'name' => _("Sendmail Arguments"),
141 'type' => SMOPT_TYPE_STRING,
142 'size' => 40 ),
143 '$smtpServerAddress' => array( 'name' => _("SMTP Server Address"),
144 'type' => SMOPT_TYPE_STRING,
145 'size' => 40 ),
146 '$smtpPort' => array( 'name' => _("SMTP Server Port"),
147 'type' => SMOPT_TYPE_INTEGER ),
148 '$use_smtp_tls' => array( 'name' => _("Use TLS for SMTP Connections"),
149 'type' => SMOPT_TYPE_BOOLEAN,
150 'comment' => _("Requires PHP 4.3.x! Experimental."),
151 'default' => false ),
152 '$smtp_auth_mech' => array( 'name' => _("SMTP Authentication Type"),
153 'type' => SMOPT_TYPE_STRLIST,
154 'posvals' => array('none' => _("No SMTP auth"),
155 'login' => _("Login (plain text)"),
156 'cram-md5' => 'CRAM-MD5',
157 'digest-md5' => 'DIGEST-MD5'),
158 'default' => 'none'),
159 '$pop_before_smtp' => array( 'name' => _("POP3 Before SMTP?"),
160 'type' => SMOPT_TYPE_BOOLEAN,
161 'default' => false ),
162 '$encode_header_key' => array( 'name' => _("Header Encryption Key"),
163 'type' => SMOPT_TYPE_STRING ),
164 '$invert_time' => array( 'name' => _("Invert Time"),
165 'type' => SMOPT_TYPE_BOOLEAN ),
166 /* --------------------------------------------------------*/
167 'Group3' => array( 'name' => _("Folders Defaults"),
168 'type' => SMOPT_TYPE_TITLE ),
169 '$default_folder_prefix' => array( 'name' => _("Default Folder Prefix"),
170 'type' => SMOPT_TYPE_STRING,
171 'size' => 40 ),
172 '$show_prefix_option' => array( 'name' => _("Show Folder Prefix Option"),
173 'type' => SMOPT_TYPE_BOOLEAN ),
174 '$trash_folder' => array( 'name' => _("Trash Folder"),
175 'type' => SMOPT_TYPE_STRING,
176 'size' => 40 ),
177 '$sent_folder' => array( 'name' => _("Sent Folder"),
178 'type' => SMOPT_TYPE_STRING,
179 'size' => 40 ),
180 '$draft_folder' => array( 'name' => _("Draft Folder"),
181 'type' => SMOPT_TYPE_STRING,
182 'size' => 40 ),
183 '$default_move_to_trash' => array( 'name' => _("By default, move to trash"),
184 'type' => SMOPT_TYPE_BOOLEAN ),
185 '$default_move_to_sent' => array( 'name' => _("By default, move to sent"),
186 'type' => SMOPT_TYPE_BOOLEAN ),
187 '$default_save_as_draft' => array( 'name' => _("By default, save as draft"),
188 'type' => SMOPT_TYPE_BOOLEAN ),
189 '$list_special_folders_first' => array( 'name' => _("List Special Folders First"),
190 'type' => SMOPT_TYPE_BOOLEAN ),
191 '$use_special_folder_color' => array( 'name' => _("Show Special Folders Color"),
192 'type' => SMOPT_TYPE_BOOLEAN ),
193 '$auto_expunge' => array( 'name' => _("Auto Expunge"),
194 'type' => SMOPT_TYPE_BOOLEAN ),
195 '$default_sub_of_inbox' => array( 'name' => _("Default Sub. of INBOX"),
196 'type' => SMOPT_TYPE_BOOLEAN ),
197 '$show_contain_subfolders_option' => array( 'name' => _("Show 'Contain Sub.' Option"),
198 'type' => SMOPT_TYPE_BOOLEAN ),
199 '$default_unseen_notify' => array( 'name' => _("Default Unseen Notify"),
200 'type' => SMOPT_TYPE_NUMLIST,
201 'posvals' => array( SMPREF_UNSEEN_NONE => _("No Notification"),
202 SMPREF_UNSEEN_INBOX => _("Only INBOX"),
203 SMPREF_UNSEEN_ALL => _("All Folders")) ),
204 '$default_unseen_type' => array( 'name' => _("Default Unseen Type"),
205 'type' => SMOPT_TYPE_NUMLIST ,
206 'posvals' => array( SMPREF_UNSEEN_ONLY => _("Only Unseen"),
207 SMPREF_UNSEEN_TOTAL => _("Unseen and Total") ) ),
208 '$auto_create_special' => array( 'name' => _("Auto Create Special Folders"),
209 'type' => SMOPT_TYPE_BOOLEAN ),
210 '$delete_folder' => array( 'name' => _("Auto delete folders"),
211 'type' => SMOPT_TYPE_BOOLEAN ),
212 '$noselect_fix_enable' => array( 'name' => _("Enable /NoSelect folder fix"),
213 'type' => SMOPT_TYPE_BOOLEAN,
214 'default' => false),
215 /* --------------------------------------------------------*/
216 'Group4' => array( 'name' => _("General Options"),
217 'type' => SMOPT_TYPE_TITLE ),
218 '$data_dir' => array( 'name' => _("Data Directory"),
219 'type' => SMOPT_TYPE_PATH,
220 'size' => 40 ),
221 '$attachment_dir' => array( 'name' => _("Temp Directory"),
222 'type' => SMOPT_TYPE_PATH,
223 'size' => 40 ),
224 '$dir_hash_level' => array( 'name' => _("Hash Level"),
225 'type' => SMOPT_TYPE_NUMLIST,
226 'posvals' => array( 0 => _("Hash Disabled"),
227 1 => _("Low"),
228 2 => _("Moderate"),
229 3 => _("Medium"),
230 4 => _("High") ) ),
231 '$default_left_size' => array( 'name' => _("Default Left Size"),
232 'type' => SMOPT_TYPE_NUMLIST,
233 'posvals' => $left_size_values ),
234 '$force_username_lowercase' => array( 'name' => _("Usernames in Lowercase"),
235 'type' => SMOPT_TYPE_BOOLEAN ),
236 '$default_use_priority' => array( 'name' => _("Allow use of priority"),
237 'type' => SMOPT_TYPE_BOOLEAN ),
238 '$hide_sm_attributions' => array( 'name' => _("Hide SM attributions"),
239 'type' => SMOPT_TYPE_BOOLEAN ),
240 '$default_use_mdn' => array( 'name' => _("Enable use of delivery receipts"),
241 'type' => SMOPT_TYPE_BOOLEAN ),
242 '$edit_identity' => array( 'name' => _("Allow editing of identities"),
243 'type' => SMOPT_TYPE_BOOLEAN ),
244 '$edit_name' => array( 'name' => _("Allow editing of full name"),
245 'type' => SMOPT_TYPE_BOOLEAN ),
246 '$hide_auth_header' => array( 'name' => _("Remove username from headers"),
247 'comment' => _("Used only when identities can't be modified"),
248 'type' => SMOPT_TYPE_BOOLEAN ),
249 '$allow_server_sort' => array( 'name' => _("Use server-side sorting"),
250 'type' => SMOPT_TYPE_BOOLEAN,
251 'default' => false ),
252 '$allow_thread_sort' => array( 'name' => _("Use server-side thread sorting"),
253 'type' => SMOPT_TYPE_BOOLEAN,
254 'default' => false ),
255 '$allow_charset_search' => array( 'name' => _("Allow server charset search"),
256 'type' => SMOPT_TYPE_BOOLEAN,
257 'default' => false ),
258 '$allow_advanced_search' => array( 'name' => _("Search functions"),
259 'type' => SMOPT_TYPE_NUMLIST,
260 'posvals' => array( 0 => _("Only basic search"),
261 1 => _("Only advanced search"),
262 2 => _("Both search functions") ),
263 'default' => 0 ),
264 '$session_name' => array( 'name' => _("PHP session name"),
265 'type' => SMOPT_TYPE_HIDDEN ),
266 '$time_zone_type' => array( 'name' => _("Time Zone Configuration"),
267 'type' => SMOPT_TYPE_NUMLIST,
268 'posvals' => array( 0 => _("Standard GNU C time zones"),
269 1 => _("Strict time zones"),
270 2 => _("Custom GNU C time zones"),
271 3 => _("Custom strict time zones")),
272 'default' => 0 ),
273 /* --------------------------------------------------------*/
274 'Group5' => array( 'name' => _("Message of the Day"),
275 'type' => SMOPT_TYPE_TITLE ),
276 '$motd' => array( 'name' => _("Message of the Day"),
277 'type' => SMOPT_TYPE_TEXTAREA,
278 'size' => 40 ),
279 /* ---- Database settings ---- */
280 'Group6' => array( 'name' => _("Database"),
281 'type' => SMOPT_TYPE_TITLE ),
282 '$addrbook_dsn' => array( 'name' => _("Address book DSN"),
283 'type' => SMOPT_TYPE_STRING,
284 'size' => 40 ),
285 '$addrbook_table' => array( 'name' => _("Address book table"),
286 'type' => SMOPT_TYPE_STRING,
287 'size' => 40,
288 'default' => 'address' ),
289 '$prefs_dsn' => array( 'name' => _("Preferences DSN"),
290 'type' => SMOPT_TYPE_STRING,
291 'size' => 40 ),
292 '$prefs_table' => array( 'name' => _("Preferences table"),
293 'type' => SMOPT_TYPE_STRING,
294 'size' => 40,
295 'default' => 'userprefs' ),
296 '$prefs_user_field' => array('name' => _("Preferences username field"),
297 'type' => SMOPT_TYPE_STRING,
298 'size' => 40,
299 'default' => 'user' ),
300 '$prefs_user_size' => array( 'name' => _("Size of username field"),
301 'type' => SMOPT_TYPE_INTEGER ),
302 '$prefs_key_field' => array('name' => _("Preferences key field"),
303 'type' => SMOPT_TYPE_STRING,
304 'size' => 40,
305 'default' => 'prefkey' ),
306 '$prefs_key_size' => array( 'name' => _("Size of key field"),
307 'type' => SMOPT_TYPE_INTEGER ),
308 '$prefs_val_field' => array('name' => _("Preferences value field"),
309 'type' => SMOPT_TYPE_STRING,
310 'size' => 40,
311 'default' => 'prefval' ),
312 '$prefs_val_size' => array( 'name' => _("Size of value field"),
313 'type' => SMOPT_TYPE_INTEGER ),
314 '$addrbook_global_dsn' => array( 'name' => _("Global address book DSN"),
315 'type' => SMOPT_TYPE_STRING,
316 'size' => 40 ),
317 '$addrbook_global_table' => array( 'name' => _("Global address book table"),
318 'type' => SMOPT_TYPE_STRING,
319 'size' => 40,
320 'default' => 'global_abook' ),
321 '$addrbook_global_writeable' => array( 'name' => _("Allow writing into global address book"),
322 'type' => SMOPT_TYPE_BOOLEAN ),
323 '$addrbook_global_listing' => array( 'name' => _("Allow listing of global address book"),
324 'type' => SMOPT_TYPE_BOOLEAN ),
325 /* ---- Language settings ---- */
326 'Group9' => array( 'name' => _("Language settings"),
327 'type' => SMOPT_TYPE_TITLE ),
328 '$squirrelmail_default_language' => array( 'name' => _("Default Language"),
329 'type' => SMOPT_TYPE_STRLIST,
330 'size' => 7,
331 'posvals' => $language_values ),
332 '$default_charset' => array( 'name' => _("Default Charset"),
333 'type' => SMOPT_TYPE_STRLIST,
334 'posvals' => array( 'iso-8859-1' => 'iso-8859-1',
335 'iso-8859-2' => 'iso-8859-2',
336 'iso-8859-7' => 'iso-8859-7',
337 'iso-8859-9' => 'iso-8859-9',
338 'iso-8859-15' => 'iso-8859-15',
339 'utf-8' => 'utf-8',
340 'koi8-r' => 'koi8-r',
341 'euc-kr' => 'euc-kr',
342 'big5' => 'big5',
343 'gb2312' => 'gb2312',
344 'tis-620' => 'tis-620',
345 'windows-1251' => 'windows-1251',
346 'windows-1255' => 'windows-1255',
347 'windows-1256' => 'windows-1256',
348 'iso-2022-jp' => 'iso-2022-jp' ) ),
349 '$show_alternative_names' => array( 'name' => _("Show alternative language names"),
350 'type' => SMOPT_TYPE_BOOLEAN ),
351 '$aggressive_decoding' => array( 'name' => _("Enable aggressive decoding"),
352 'type' => SMOPT_TYPE_BOOLEAN ),
353 '$lossy_encoding' => array( 'name' => _("Enable lossy encoding"),
354 'type' => SMOPT_TYPE_BOOLEAN ),
355 /* ---- Tweaks ---- */
356 'Group10' => array( 'name' => _("Tweaks"),
357 'type' => SMOPT_TYPE_TITLE ),
358 '$advanced_tree' => array( 'name' => _("Use advanced tree folder listing"),
359 'type' => SMOPT_TYPE_BOOLEAN ),
360 '$use_icons' => array( 'name' => _("Use icons"),
361 'type' => SMOPT_TYPE_BOOLEAN ),
362 '$use_iframe' => array( 'name' => _("Use inline frames with HTML mails"),
363 'type' => SMOPT_TYPE_BOOLEAN ),
364 '$use_php_recode' => array( 'name' => _("Use PHP recode functions"),
365 'type' => SMOPT_TYPE_BOOLEAN ),
366 '$use_php_iconv' => array( 'name' => _("Use PHP iconv functions"),
367 'type' => SMOPT_TYPE_BOOLEAN ),
368 '$allow_remote_configtest' => array( 'name' => _("Allow remote configuration test"),
369 'type' => SMOPT_TYPE_BOOLEAN ),
370 /* ---- Settings of address books ---- */
371 'Group11' => array( 'name' => _("Address Books"),
372 'type' => SMOPT_TYPE_TITLE ),
373 '$default_use_javascript_addr_book' => array( 'name' => _("Default Javascript Addressbook"),
374 'type' => SMOPT_TYPE_BOOLEAN ),
375 '$abook_global_file' => array( 'name' => _("Global address book file"),
376 'type' => SMOPT_TYPE_STRING ),
377 '$abook_global_file_writeable' => array( 'name' => _("Allow writing into global address book file"),
378 'type' => SMOPT_TYPE_BOOLEAN ),
379 '$abook_global_file_listing' => array( 'name' => _("Allow listing of global address book"),
380 'type' => SMOPT_TYPE_BOOLEAN ),
381 /* --------------------------------------------------------*/
382 'Group7' => array( 'name' => _("Themes"),
383 'type' => SMOPT_TYPE_TITLE ),
384 '$theme_css' => array( 'name' => _("Style Sheet URL (css)"),
385 'type' => SMOPT_TYPE_PATH,
386 'size' => 40 ),
387 '$theme_default' => array( 'name' => _("Default theme"),
388 'type' => SMOPT_TYPE_INTEGER,
389 'default' => 0,
390 'comment' => _("Use index number of theme") ),
391 /* --------------------------------------------------------*/
392 '$config_use_color' => array( 'name' => '',
393 'type' => SMOPT_TYPE_HIDDEN ),
394 '$no_list_for_subscribe' => array( 'name' => '',
395 'type' => SMOPT_TYPE_HIDDEN ),
396 /* --------------------------------------------------------*/
397
398 );
399
400 ?>