Skip to content

Commit d7a9dcf

Browse files
committed
Small changes in readme. Fixed module name
1 parent 790c16f commit d7a9dcf

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Disclaimer: This tool was just a quick implementation for our CI needs, which mi
1010

1111

1212
## Usage:
13+
To install the program use:
14+
```
15+
go install github.com/mobiuscode-de/imap-extractor@latest
16+
```
17+
18+
1319
To call the program use:
1420
```
1521
imap-extractor <path to config json>
@@ -29,19 +35,24 @@ The following configurations are to be included in the configuration:
2935
* from-filter: Name filter for email origin
3036
* regexp: Regex for which the emails will be scanned, including a group for the result
3137

38+
Any value might be preceded by a $ Symbol to indicate that its value shall be fetched by an environment variable.
3239

3340
On execution this program will go through the inbox of given email address from newest to oldest.
3441
Once any match with the given regex is found, the content of the first capturing group in the regex will be returned.
3542

3643

3744
## Config Example:
45+
Basic example of a configuration to extract a line of content that is preceded by the text "please see:" and surrounded by arbitrary whitespace.
46+
3847
```json
3948
{
4049
"imap-host": "mobiuscode.de/",
4150
"imap-port": 993,
4251
"username": "user@mobiuscode.de",
43-
"password": "tryOutPanicMode",
52+
"password": "$EMAIL_PW",
4453
"from-filter": "boss@mobiuscode.de",
45-
"regexp": "please see important thing below:(?:[\\s]+)([\\S]+)(?:[\\s]+)"
54+
"regexp": "please see:(?:[\\s]+)([\\S]+)(?:[\\s]+)"
4655
}
47-
```
56+
```
57+
58+
Note: Password is extracted from environment variable in this case, which is also recommended for usage of the tool in a CI environment.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module imap-extractor
1+
module github.com/mobiuscode-de/imap-extractor
22

33
go 1.16
44

0 commit comments

Comments
 (0)