Skip to content

Commit

Permalink
Merge pull request #6 from wahlflo/refactoring
Browse files Browse the repository at this point in the history
Refactoring of the Complete Codebase + New Features
  • Loading branch information
wahlflo authored Dec 31, 2022
2 parents bde6d89 + bc2d769 commit 7cebf0d
Show file tree
Hide file tree
Showing 24 changed files with 1,201 additions and 276 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
install:
pip3 install .

install-dependencies:
pip3 install -r requirements.txt

build:
pip3 install --upgrade build
python3 -m build .

test:
python -m unittest discover .
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install the package with pip
Type ```emlAnalyzer --help``` to view the help.

```
usage: emlAnalyzer [-h] [-i [INPUT]] [--header] [-x] [-a] [--text] [--html] [-s] [-u] [-ea EXTRACT] [--extract-all] [-o OUTPUT]
usage: emlAnalyzer [-h] [-i [INPUT]] [--header] [-x] [-a] [--text] [--html] [-s] [-u] [-ea EXTRACT] [--extract-all] [-o OUTPUT] [--format [{json}]]
A CLI script to analyze an email in the EML format for viewing headers, extracting attachments, etc.
Expand All @@ -25,12 +25,13 @@ optional arguments:
--text Shows plaintext
--html Shows HTML
-s, --structure Shows structure of the E-Mail
-u, --url Shows embedded links and urls in the html part
-u, --url Shows embedded links and urls in the HTML and text part
-ea EXTRACT, --extract EXTRACT
Extracts the x-th attachment
--extract-all Extracts all attachments
Extracts the x-th attachment. Can not be used together with the '--format' parameter.
--extract-all Extracts all attachments. If a output format is specified the content of the attachments will be included in the structural output as a base64 encoded blob
-o OUTPUT, --output OUTPUT
Path for the extracted attachment (default is filename in working directory)
--format [{json}] Specifies a structured output format, the default format is not machine-readable
```

## Examples
Expand Down Expand Up @@ -120,4 +121,36 @@ x-rmx-source..................................123.123.123.123
Content-Type..................................text/html; charset="iso-8859-1"
Content-Transfer-Encoding.....................quoted-printable
MIME-Version..................................1.0
```

### Example 4
```json
$ emlAnalyzer -i email_4.eml --format json
{
"structure": {
"type": "multipart/mixed",
"children": [
{
"type": "text/plain"
},
{
"type": "application/pdf",
"name": "attachment_123.pdf",
"disposition": "attachment"
}
]
},
"urls": [
"https://www.facebook.de/abc123",
"https://www.google.com/demo"
],
"reloaded_content": [],
"attachments": [
{
"type": "application/pdf",
"name": "attachment_123.pdf",
"disposition": "attachment"
}
]
}
```
Loading

0 comments on commit 7cebf0d

Please sign in to comment.