You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
4.1 KiB

<?php
ini_set('log_errors', 1);
ini_set('display_errors', 0);
require('thunderbird.conf.php');
if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERVER['QUERY_STRING'])) {
$temp = explode('@', $_SERVER['QUERY_STRING']);
$uid = $temp[0];
//Connexion a l'annuaire LDAP
$link = @ldap_connect(LDAP_SERVER) or die ('connexion echouee');
ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, 3);
@ldap_bind($link) or die ('identification echouee');
// Recherche de l'utilisateur demandé
$result = ldap_search($link, USER_BASE, "uid=" . $uid);
$user = ldap_get_entries($link, $result);
if($user['count'] == 0) {
// user not found
exit;
}
}
else {
exit;
}
?>
// Compte local
lockPref("mail.account.account1.server", "server1");
lockPref("mail.accountmanager.localfoldersserver", "server1");
lockPref("mail.server.server1.directory-rel", "[ProfD]Mail/Local Folders");
lockPref("mail.server.server1.hostname", "Local Folders");
lockPref("mail.server.server1.name", "Dossiers locaux");
lockPref("mail.server.server1.type", "none");
lockPref("mail.server.server1.userName", "nobody");
// SMTP
lockPref("mail.smtp.defaultserver", "smtp1");
lockPref("mail.smtpservers", "smtp1");
lockPref("mail.smtpserver.smtp1.try_ssl", 3);
lockPref("mail.smtpserver.smtp1.port", <?php echo SMTP_PORT; ?>);
lockPref("mail.smtpserver.smtp1.hostname", "<?php echo SMTP_SERVER; ?>");
lockPref("mail.smtpserver.smtp1.username", "<?php echo $uid; ?>");
// Compte par défaut
lockPref("mail.accountmanager.defaultaccount", "account2");
<?php
$mail = explode('@', $user[0]['mail'][0]);
$account = 2;
$id = 1;
$server = 2;
$accountlist = 'account1';
$identities = ''
?>
// Compte personnel
lockPref("mail.account.account2.server", "server<?php echo $server?>");
lockPref("mail.server.server2.hostname", "<?php echo IMAP_SERVER; ?>");
lockPref("mail.server.server2.name", "<?php echo $user[0]['mail'][0]; ?>");
lockPref("mail.server.server2.port", <?php echo IMAP_PORT; ?>);
lockPref("mail.server.server2.socketType", 3);
lockPref("mail.server.server2.type", "imap");
lockPref("mail.server.server2.userName", "<?php echo $uid; ?>");
<?php
for ($i=0; $i < count($user[0]['mail'])-1; $i++){
?>
lockPref("mail.identity.id<?php echo $id; ?>.fullName", "<?php echo $user[0]['cn'][0]; ?>");
lockPref("mail.identity.id<?php echo $id; ?>.organization", "<?php echo $user[0]['o'][0]; ?>");
lockPref("mail.identity.id<?php echo $id; ?>.smtpServer", "smtp1");
lockPref("mail.identity.id<?php echo $id; ?>.useremail", "<?php echo $user[0]['mail'][$i]; ?>");
lockPref("mail.identity.id<?php echo $id; ?>.valid", true);
defaultPref("mail.identity.id<?php echo $id; ?>.fcc_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Sent");
defaultPref("mail.identity.id<?php echo $id; ?>.draft_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Drafts");
defaultPref("mail.identity.id<?php echo $id; ?>.stationery_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Templates");
defaultPref("mail.identity.id<?php echo $id; ?>.attach_signature", true);
defaultPref("mail.identity.id<?php echo $id; ?>.sig_file-rel", "[ProfD]../../../../../signature/email.html");
<?php
//$accountlist .= ',account' . $account;
$identities .= ',id' . $id;
$account++;
$id++;
}
?>
lockPref("mail.account.account2.identities", "<?php echo $identities;?>");
lockPref("mail.accountmanager.accounts", "account1,account2");
// Mise a jour
lockPref("app.update.enabled", false);
lockPref("app.update.auto", false);
// Extension
lockPref("extensions.installDistroAddons", true);
lockPref("extensions.enabledScopes", 13);
lockPref("extensions.autoDisableScopes", 2);
// Spam
lockPref("mail.adaptivefilters.junk_threshold", 500);
// Checks
defaultPref("mail.check_all_imap_folders_for_new", true);
// Composition
defaultPref("mail.default_html_action", 3);
// Pièces jointes
defaultPref("mail.content_disposition_type ", 1);
// Expunge
defaultPref("mail.imap.expunge_option", 3);
defaultPref("mail.imap.expunge_threshold_number", 100);
<?php
if (is_array(glob("thunderbird.mod.*.php"))){
foreach (glob("thunderbird.mod.*.php") as $filename){
require($filename);
}
}
?>