1 | |
---|
2 | /* |
---|
3 | * debathena.cfg |
---|
4 | * |
---|
5 | * Mozilla Thunderbird MIT/Athena Autoconfig Script |
---|
6 | * Copyright © 2006 Charles Dominguez |
---|
7 | * Copyright © 2009 Evan Broder |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License |
---|
11 | * as published by the Free Software Foundation; either version 2 |
---|
12 | * of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | * |
---|
23 | */ |
---|
24 | |
---|
25 | |
---|
26 | try |
---|
27 | { |
---|
28 | var username = getenv("ATHENA_USER"); |
---|
29 | if(username == "") |
---|
30 | { |
---|
31 | username = getenv("USER"); |
---|
32 | } |
---|
33 | // Check that username is sane |
---|
34 | if(username == null || username == '' || username == 'root') |
---|
35 | { |
---|
36 | throw "Failed to retrieve user name (environment corruption)"; |
---|
37 | } |
---|
38 | |
---|
39 | var fullname = getenv("NAME"); |
---|
40 | if(fullname == null || fullname == "") |
---|
41 | { |
---|
42 | throw "Failed to retrieve full name"; |
---|
43 | } |
---|
44 | |
---|
45 | var pobox = username+'.mail.mit.edu' |
---|
46 | |
---|
47 | // Construct additional user settings |
---|
48 | email = username+'@mit.edu'; |
---|
49 | imapURI='imap://'+username+'@mit.edu'; |
---|
50 | imapRoot='imap://'+username+'@'+pobox+'/INBOX'; |
---|
51 | |
---|
52 | // Register accounts |
---|
53 | defaultPref("mail.account.account1.identities", "id1"); |
---|
54 | defaultPref("mail.account.account1.server", "server1"); |
---|
55 | defaultPref("mail.account.account2.server", "server2"); |
---|
56 | defaultPref("mail.accountmanager.localfoldersserver", "server2"); |
---|
57 | defaultPref("mail.accountmanager.accounts", "account1,account2"); |
---|
58 | defaultPref("mail.accountmanager.defaultaccount", "account1"); |
---|
59 | defaultPref("mail.smtp.defaultserver", "smtp1"); |
---|
60 | defaultPref("mail.smtpservers", "smtp1"); |
---|
61 | |
---|
62 | // Setup MIT Mail Server |
---|
63 | defaultPref("mail.server.server1.hostname", pobox); |
---|
64 | defaultPref("mail.server.server1.name", email); |
---|
65 | defaultPref("mail.server.server1.port", 993); |
---|
66 | defaultPref("mail.server.server1.serverFilterName", "SpamAssassin"); |
---|
67 | defaultPref("mail.server.server1.socketType", 3); |
---|
68 | defaultPref("mail.server.server1.type", "imap"); |
---|
69 | defaultPref("mail.server.server1.userName", username); |
---|
70 | defaultPref("mail.server.server1.useSecAuth", true); |
---|
71 | |
---|
72 | defaultPref("mail.server.server1.manualMark", true); |
---|
73 | defaultPref("mail.server.server1.moveTargetMode", 1); |
---|
74 | defaultPref("mail.server.server1.spamActionTargetAccount", imapURI); |
---|
75 | defaultPref("mail.server.server1.spamActionTargetFolder", imapRoot+'/Spamscreen'); |
---|
76 | defaultPref("mail.server.server1.useServerFilter", true); |
---|
77 | |
---|
78 | // Setup Local Folders Server |
---|
79 | defaultPref("mail.server.server2.directory-rel", "[ProfD]Mail/Local Folders"); |
---|
80 | defaultPref("mail.server.server2.hostname", "Local Folders"); |
---|
81 | defaultPref("mail.server.server2.name", "Local Folders"); |
---|
82 | defaultPref("mail.server.server2.type", "none"); |
---|
83 | defaultPref("mail.server.server2.userName", "nobody"); |
---|
84 | |
---|
85 | // Setup Outgoing (SMTP) Server |
---|
86 | defaultPref("mail.smtpserver.smtp1.auth_method", 1); |
---|
87 | defaultPref("mail.smtpserver.smtp1.description", "MIT SMTP Server"); |
---|
88 | defaultPref("mail.smtpserver.smtp1.hostname", "outgoing.mit.edu"); |
---|
89 | defaultPref("mail.smtpserver.smtp1.port", 465); |
---|
90 | defaultPref("mail.smtpserver.smtp1.try_ssl", 3); |
---|
91 | defaultPref("mail.smtpserver.smtp1.username", username); |
---|
92 | |
---|
93 | // Setup MIT Email Identity |
---|
94 | defaultPref("mail.identity.id1.fullName", fullname); |
---|
95 | defaultPref("mail.identity.id1.useremail", email); |
---|
96 | defaultPref("mail.identity.id1.valid", true); |
---|
97 | defaultPref("mail.identity.id1.directoryServer", "ldap_2.servers.MITCampusDirectory"); |
---|
98 | defaultPref("mail.identity.id1.smtpServer", "smtp1"); |
---|
99 | |
---|
100 | defaultPref("mail.identity.id1.fcc", true); |
---|
101 | defaultPref("mail.identity.id1.fcc_folder_picker_mode", "0"); |
---|
102 | defaultPref("mail.identity.id1.fcc_folder", imapRoot+"/Sent"); |
---|
103 | defaultPref("mail.identity.id1.drafts_folder_picker_mode", "0"); |
---|
104 | defaultPref("mail.identity.id1.draft_folder", imapRoot+"/Drafts"); |
---|
105 | defaultPref("mail.identity.id1.tmpl_folder_picker_mode", "0"); |
---|
106 | defaultPref("mail.identity.id1.stationery_folder", imapRoot+"/Templates"); |
---|
107 | |
---|
108 | // Setup LDAP Servers & Addressbooks |
---|
109 | defaultPref("ldap_2.servers.MITCampusDirectory.auth.savePassword", false); |
---|
110 | defaultPref("ldap_2.servers.MITCampusDirectory.description", "MIT LDAP"); |
---|
111 | defaultPref("ldap_2.servers.MITCampusDirectory.filename", "MIT_LDAP.mab"); |
---|
112 | defaultPref("ldap_2.servers.MITCampusDirectory.uri", "ldaps://ldap.mit.edu:636/dc=mit,dc=edu??sub?(objectclass=*)"); |
---|
113 | } |
---|
114 | catch(e) |
---|
115 | { |
---|
116 | displayError("Error in Autoconfig", e); |
---|
117 | } |
---|