File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,18 @@ const logger = require('tracer').colorConsole({ format: '[{{timestamp}} {{title}
5
5
const usernames = process . env . IMAP_USERNAMES . split ( "," ) ;
6
6
const passwords = process . env . IMAP_PASSWORDS . split ( "," ) ;
7
7
const githubURL = process . env . DISCORD_WH_URL ;
8
+ const imapMarkSeen = process . env . IMAP_MARK_SEEN === "false" ? false : true ;
9
+
10
+ const startTime = new Date ( ) ;
8
11
9
12
const triggerWebhook = ( username , mail ) => {
10
13
logger . debug ( mail )
11
14
const description = mail . text === undefined ? "" : mail . text . substring ( 0 , 1000 ) ;
12
15
16
+ if ( ! imapMarkSeen && mail . date < startTime ) {
17
+ return ;
18
+ }
19
+
13
20
require ( "axios" ) . post ( githubURL , {
14
21
content : "" ,
15
22
username : username ,
@@ -42,7 +49,7 @@ usernames.forEach((username, index) => {
42
49
port : process . env . IMAP_PORT || 143 ,
43
50
tls : process . env . IMAP_TLS === "true" ? true : false ,
44
51
autotls : 'always' ,
45
- markSeen : process . env . IMAP_MARK_SEEN === "false" ? false : true
52
+ markSeen : imapMarkSeen
46
53
} ;
47
54
48
55
notifier ( imap )
You can’t perform that action at this time.
0 commit comments