Skip to content

Commit

Permalink
Clean up files
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlgo11 committed Sep 26, 2024
1 parent 0daae21 commit 9cf3498
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 91 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
package-lock.json
aliases.json
.env
.idea
.idea
certs/
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Mail Room is a lightweight email handling system built with Node.js and Docker,
## Services

* __Controller__ - Account management API
* __Inbox__ - SMTP server for incoming emails
* __Outbox__ - SMTP server for outgoing emails
* __Inbox__ - SMTP server (MTA) for incoming emails
* __Outbox__ - SMTP server (MSA) for outgoing emails
* __Dovecot__ - IMAP server
* __Rspamd__ - Spam service
* __Redis__ - Account database
Expand Down Expand Up @@ -65,6 +65,19 @@ Start the services using Docker Compose:
docker compose up -d
```

### Managing users
To add or remove a user, use the mailadmin tool:
```text
Usage: ./mailadmin [command] [options]
Commands:
create-user <email> <password> Create a new email user
delete-user <email> Delete an existing email user
list-users List all email users
get-user <email> Get details of a specific user
generate-cert <email> Generate a client certificate for the user
```

## Project Structure
```text
.
Expand All @@ -75,6 +88,7 @@ Start the services using Docker Compose:
├── conf/ # Configuration files
│ ├── dovecot/
│ └── rspamd/
├── controller/ # Controller server source
├── inbox/ # Inbox (MX) server source
├── outbox/ # Outbox (Submission) server source
└── rspamd/ # Rspamd service Docker build instructions
Expand Down
1 change: 0 additions & 1 deletion conf/rspamd/dmarc.conf

This file was deleted.

1 change: 0 additions & 1 deletion conf/rspamd/milter_headers.conf

This file was deleted.

2 changes: 1 addition & 1 deletion controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:alpine
FROM node:slim
WORKDIR /usr/src/controller

ENV REDIS_HOST="redis_mail"
Expand Down
6 changes: 3 additions & 3 deletions controller/src/routes/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import {generateCertificate} from '../services/clientCertService.js';
const router = Router();

router.post('/users/register', async (req, res) => {
console.log(req.body.username, req.body.password);
try {
const status = await register(req.body.username, req.body.password);
return res.status(201).
send(JSON.stringify(status));
} catch (err) {
console.log(err);
res.status(500).send(err.message);
console.error(err);
return res.status(500).send(err.message);
}
});

Expand All @@ -24,6 +23,7 @@ router.get('/users/', async (req, res) => {
const users = await listUsers();
return res.send(JSON.stringify(users));
})

router.get('/users/:user/certificate', async (req, res) => {
try {
const cert = generateCertificate(req.params['user']);
Expand Down
1 change: 0 additions & 1 deletion controller/src/services/userService.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {createClient} from 'redis';
import bcrypt from 'bcrypt';
import {get} from 'node:http';

// Create a Redis client
const client = await createClient({
Expand Down
24 changes: 0 additions & 24 deletions outbox/test/pgp.test.js

This file was deleted.

57 changes: 0 additions & 57 deletions outbox/users.sh

This file was deleted.

1 change: 1 addition & 0 deletions rspamd/conf/mx_check.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enabled = true;

0 comments on commit 9cf3498

Please sign in to comment.