-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathimap.js
51 lines (42 loc) · 1.31 KB
/
imap.js
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
'use strict';
// Usage:
// node imap.js > account.mobileconfig
const mobileconfig = require('../index');
const fs = require('fs');
mobileconfig.getSignedEmailConfig(
{
emailAddress: 'my-email-address@gmail.com',
organization: 'My Company',
identifier: 'com.my.company',
displayName: 'My Gmail Account',
displayDescription: 'Install this profile to auto configure your Gmail account',
accountName: 'IMAP Config',
accountDescription: 'Configure your Gmail account',
imap: {
hostname: 'imap.gmail.com',
port: 993,
secure: true,
username: 'my-email-address@gmail.com',
password: 'mypass'
},
smtp: {
hostname: 'smtp.gmail.com',
port: 587,
secure: false,
username: 'my-email-address@gmail.com',
password: false // use the same password as for IMAP
},
keys: {
key: fs.readFileSync(__dirname + '/../test/fixtures/key.pem'),
cert: fs.readFileSync(__dirname + '/../test/fixtures/cert.pem'),
ca: []
}
},
(err, data) => {
if (err) {
process.stderr.write(err.stack);
return process.exit(1);
}
process.stdout.write(data);
}
);