diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-15 15:26:15 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-24 16:25:52 +0200 |
commit | 94565d52bb2883e09f16d1363170ac9c0dccb7a1 (patch) | |
tree | 3dcd20cd7b5a5cca80bce32b655cdbfaddf7aa59 /shared/utils/miscs/email-child-process.js | |
parent | 4ee7a4c9ac9280cda930a281c2d5a9a4c409cc14 (diff) | |
download | PeerTube-94565d52bb2883e09f16d1363170ac9c0dccb7a1.tar.gz PeerTube-94565d52bb2883e09f16d1363170ac9c0dccb7a1.tar.zst PeerTube-94565d52bb2883e09f16d1363170ac9c0dccb7a1.zip |
Shared utils -> extra-utils
Because they need dev dependencies
Diffstat (limited to 'shared/utils/miscs/email-child-process.js')
-rw-r--r-- | shared/utils/miscs/email-child-process.js | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/shared/utils/miscs/email-child-process.js b/shared/utils/miscs/email-child-process.js deleted file mode 100644 index 40ae37d70..000000000 --- a/shared/utils/miscs/email-child-process.js +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | const MailDev = require('maildev') | ||
2 | |||
3 | // must run maildev as forked ChildProcess | ||
4 | // failed instantiation stops main process with exit code 0 | ||
5 | process.on('message', (msg) => { | ||
6 | if (msg.start) { | ||
7 | const maildev = new MailDev({ | ||
8 | ip: '127.0.0.1', | ||
9 | smtp: 1025, | ||
10 | disableWeb: true, | ||
11 | silent: true | ||
12 | }) | ||
13 | |||
14 | maildev.on('new', email => { | ||
15 | process.send({ email }) | ||
16 | }) | ||
17 | |||
18 | maildev.listen(err => { | ||
19 | if (err) { | ||
20 | // cannot send as Error object | ||
21 | return process.send({ err: err.message }) | ||
22 | } | ||
23 | |||
24 | return process.send({ err: null }) | ||
25 | }) | ||
26 | } | ||
27 | }) | ||