forked from ahochsteger/gmail-processor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.gs
58 lines (58 loc) · 2.56 KB
/
Config.gs
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
52
53
54
55
56
57
58
/**
* Configuration for Gmail2GDrive
* See https://github.com/ahochsteger/gmail2gdrive/blob/master/README.md for a config reference
*/
function getGmail2GDriveConfig() {
return {
// Global filter
"globalFilter": "-in:trash -in:drafts -in:spam",
// Gmail label for processed threads (will be created, if not existing):
"processedLabel": "to-gdrive/processed",
// Sleep time in milli seconds between processed messages:
"sleepTime": 100,
// Maximum script runtime in seconds (google scripts will be killed after 5 minutes):
"maxRuntime": 280,
// Only process message newer than (leave empty for no restriction; use d, m and y for day, month and year):
"newerThan": "1m",
// Timezone for date/time operations:
"timezone": "GMT",
// Processing rules:
"rules": [
{ // Store all attachments sent to [email protected] to the folder "Scans"
"filter": "has:attachment to:[email protected]",
"driveFolder": "'Scans'-yyyy-MM-dd"
},
{ // Store all attachments from [email protected] to the folder "Examples/example1"
"filter": "has:attachment from:[email protected]",
"driveFolder": "'Examples/example1'"
},
{ // Store all pdf attachments from [email protected] to the folder "Examples/example2"
"filter": "has:attachment from:[email protected]",
"driveFolder": "'Examples/example2'",
"filenameFilterRegexp": ".*\.pdf$"
},
{ // Store all attachments from [email protected] OR from:[email protected]
// to the folder "Examples/example3ab" while renaming all attachments to the pattern
// defined in 'driveFilename' and archive the thread.
"filter": "has:attachment (from:[email protected] OR from:[email protected])",
"driveFolder": "'Examples/example3ab'",
"driveFilename": "'file-'yyyy-MM-dd-'%s.txt'",
"archive": true
},
{
// Store threads marked with label "PDF" in the folder "PDF Emails" als PDF document.
"filter": "label:PDF",
"saveThreadPDF": true,
"driveFolder": "PDF Emails"
},
{ // Store all attachments named "file.txt" from [email protected] to the
// folder "Examples/example4" and rename the attachment to the pattern
// defined in 'driveFilename' and archive the thread.
"filter": "has:attachment from:[email protected]",
"driveFolder": "'Examples/example4'",
"filenameFilter": "file.txt",
"driveFilename": "'file-'yyyy-MM-dd-'%s.txt'"
}
]
};
}