Skip to content

Commit

Permalink
fix: cleanup project
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderBabel committed Sep 13, 2023
1 parent 021a820 commit a425912
Show file tree
Hide file tree
Showing 11 changed files with 4,164 additions and 4,492 deletions.
103 changes: 36 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,53 @@
# mail-parser

A NestJS project, that can parse e-mails and send push notifications.
An extensible NestJS project, that can parse e-mails and send push notifications.

Implemented functionalities:
- `Deutsche Post Briefankündigung`: Sends a message to Matrix including an image of the mail envelope from the e-mail
- `DHL mTAN`: Sends a message to Matrix with the mTAN from the e-mail

---
## Deutsche Post Briefankündigung

This functionality takes advantages of the emails send by the Deutsche Post, when a letter is on its way to your mailbox. You need to setup this feature by getting an mail account at web.de or gmx.de. Deutsche Post will sent you a letter to verify your address.

<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>
Afterwards, you can setup an app specific password in your mail account. This password is used to connect to the mail server and parse the e-mails.

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
### Prerequisites
- A mail account at web.de or gmx.de
- Enable the `Deutsche Post Briefankündigung` feature in your mail account settings
- Setup an app specific password in your mail account settings
- Maubot with the (`hasswebhookbot`)[https://github.com/v411e/hasswebhookbot] plugin installed
- Exposed Maubot endpoint
- A Matrix room with the Maubot bot to sent the push notification to

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
### Setup

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Installation
Run this project with Docker!

```bash
$ npm install
docker pull alexbabel/mail-parser:latest
```

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod
docker-compose:
```yaml
services:
mail-parser:
image: alexbabel/mail-parser:latest
restart: unless-stopped
environment:
- MAIL_HOST=mail.example.com
- MAIL_PORT=993
- [email protected]
- MAIL_PASSWORD=
- PUSH_ENDPOINT=
- MAIL_ANNOUNCEMENT_PUSH_ROOM=
```
## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).
### Environment variables
| Variable | Description | Example |
| --- | --- | --- |
| `MAIL_HOST` | The IMAP mail server to connect to | `imap.example.com` |
| `MAIL_PORT` | The IMAP port of the mail server | `993` |
| `MAIL_USER` | The user to connect to the mail server | `[email protected]` |
| `MAIL_PASSWORD` | The password to connect to the mail server | `secure-password` |
| `PUSH_ENDPOINT` | The endpoint to send the push notification to | `https://matrix-bot.example.com/_matrix/maubot/plugin/mail/push/` |
| `MAIL_ANNOUNCEMENT_PUSH_ROOM` | The Matrix room to send the push notification to | `!LSsicedfgixpqFfsDz:example.com` |
60 changes: 29 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,58 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/axios": "0.1.1",
"@nestjs/common": "8.4.7",
"@nestjs/config": "2.3.4",
"@nestjs/core": "8.4.7",
"@nestjs/platform-express": "8.4.7",
"@nestjs/schedule": "2.2.3",
"@nestjs/terminus": "8.1.1",
"@prisma/client": "3.15.2",
"axios": "0.27.2",
"@nestjs/axios": "3.0.0",
"@nestjs/common": "10.2.5",
"@nestjs/config": "3.1.0",
"@nestjs/core": "10.2.5",
"@nestjs/platform-express": "10.2.5",
"@nestjs/schedule": "3.0.3",
"@nestjs/terminus": "10.0.1",
"axios": "1.5.0",
"body-parser": "1.20.2",
"cheerio": "1.0.0-rc.12",
"dotenv": "16.3.1",
"imap": "0.8.19",
"mailparser": "3.6.5",
"reflect-metadata": "0.1.13",
"rimraf": "3.0.2",
"rimraf": "5.0.1",
"rxjs": "7.8.1"
},
"devDependencies": {
"@alexbabel/semantic-release-docker": "2.9.0",
"@nestjs/cli": "8.2.8",
"@nestjs/schematics": "8.0.11",
"@nestjs/testing": "8.4.7",
"@nestjs/cli": "10.1.17",
"@nestjs/schematics": "10.0.2",
"@nestjs/testing": "10.2.5",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/commit-analyzer": "9.0.2",
"@semantic-release/commit-analyzer": "10.0.4",
"@semantic-release/git": "10.0.1",
"@types/cron": "1.7.3",
"@types/cron": "2.4.0",
"@types/express": "4.17.17",
"@types/imap": "0.8.37",
"@types/jest": "28.1.8",
"@types/jest": "29.5.4",
"@types/mailparser": "3.4.0",
"@types/node": "16.18.50",
"@types/node": "20.6.0",
"@types/supertest": "2.0.12",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.39.0",
"@typescript-eslint/eslint-plugin": "6.7.0",
"@typescript-eslint/parser": "6.7.0",
"eslint": "8.49.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.1.0",
"eslint-config-prettier": "8.10.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jest": "26.9.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-jest": "27.2.3",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-unicorn": "40.1.0",
"jest": "28.1.3",
"prettier": "2.8.8",
"prisma": "3.15.2",
"semantic-release": "19.0.5",
"eslint-plugin-unicorn": "48.0.1",
"jest": "29.7.0",
"prettier": "3.0.3",
"semantic-release": "21.1.1",
"supertest": "6.3.3",
"ts-jest": "28.0.8",
"ts-jest": "29.1.1",
"ts-loader": "9.4.4",
"ts-node": "10.9.1",
"tsconfig-paths": "3.14.2",
"typescript": "4.9.5"
"tsconfig-paths": "4.2.0",
"typescript": "5.2.2"
},
"jest": {
"moduleFileExtensions": [
Expand Down
18 changes: 0 additions & 18 deletions schema.prisma

This file was deleted.

72 changes: 0 additions & 72 deletions src/card-payments/card-payments.controller.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/card-payments/card-payments.module.ts

This file was deleted.

Loading

0 comments on commit a425912

Please sign in to comment.