2023-08-12 10:09:22 +08:00
|
|
|
|
# PMail
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-13 16:06:16 +08:00
|
|
|
|
> A server, a domain, a line of code, a minute, and you'll be able to build a domain mailbox of your own.
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
|
|
|
|
## [中文文档](./README_CN.md)
|
|
|
|
|
|
2023-11-18 13:07:21 +08:00
|
|
|
|
I'm Chinese, and I'm not good at English, so I apologise for my translation.
|
2023-11-01 10:37:39 +08:00
|
|
|
|
|
2023-07-30 17:59:25 +08:00
|
|
|
|
## Introduction
|
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
PMail is a personal email server that pursues a minimal deployment process and extreme resource consumption. It runs on
|
|
|
|
|
a single file and contains complete send/receive mail service and web-side mail management functions. Just a server , a
|
|
|
|
|
domain name , a line of code , a minute of deployment time , you will be able to build a domain name mailbox of your
|
|
|
|
|
own .
|
|
|
|
|
|
2023-08-13 15:36:17 +08:00
|
|
|
|
All kinds of PR are welcome, whether you are fixing bugs, adding features, or optimizing translations. Also, call for a
|
|
|
|
|
beautiful and cute Logo for this project!
|
2023-08-12 10:09:22 +08:00
|
|
|
|
|
|
|
|
|
<img src="./docs/en.gif" alt="Editor" width="800px">
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
|
|
* Single file operation and easy deployment.
|
|
|
|
|
|
|
|
|
|
* The binary file is only 15MB and takes up less than 10M of memory during the run.
|
|
|
|
|
|
|
|
|
|
* Support dkim, spf checksum, [Email Test](https://www.mail-tester.com/) score 10 points if correctly configured.
|
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
* Implementing the ACME protocol, the program will automatically obtain and update Let's Encrypt certificates.
|
|
|
|
|
|
2023-08-13 15:36:17 +08:00
|
|
|
|
> By default, a ssl certificate is generated for the web service, allowing pages to use the https protocol.
|
|
|
|
|
> If you have your own gateway or don't need https, set `httpsEnabled` to `2` in the configuration file so that the web
|
|
|
|
|
> service will not use https.
|
|
|
|
|
(Note: Even if you don't need https, please make sure the path to the ssl certificate file is correct, although the web
|
|
|
|
|
> service doesn't use the certificate anymore, the smtp protocol still needs the certificate)
|
|
|
|
|
|
2023-11-18 13:07:21 +08:00
|
|
|
|
* Support pop3, smtp protocol, you can use any mail client you like.
|
|
|
|
|
|
2023-07-30 17:59:25 +08:00
|
|
|
|
## Disadvantages
|
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
* At present, only the core function of sending and receiving emails has been completed. Basically, it can only be used
|
|
|
|
|
by a single person, and does not deal with issues related to permission management in the process of multiple users.
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
|
|
|
|
* The UI is ugly
|
|
|
|
|
|
|
|
|
|
# How to run
|
|
|
|
|
|
2023-11-18 13:07:21 +08:00
|
|
|
|
## 0、Check You IP / Domain
|
|
|
|
|
|
|
|
|
|
First go to [spamhaus](https://check.spamhaus.org/) and check your domain name and server IP for blocking records
|
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
## 1、Download
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-14 20:43:08 +08:00
|
|
|
|
* [Click Here](https://github.com/Jinnrry/PMail/releases) Download a program file that matches you.
|
|
|
|
|
|
|
|
|
|
* Or use Docker `docker pull ghcr.io/jinnrry/pmail:latest`
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
## 2、Run
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-09-08 02:11:00 +08:00
|
|
|
|
`./pmail`
|
|
|
|
|
|
|
|
|
|
Or
|
|
|
|
|
|
2023-11-18 13:07:21 +08:00
|
|
|
|
`docker run -p 25:25 -p 80:80 -p 443:443 -p 110:110 -p 465:465 -v $(pwd)/config:/work/config ghcr.io/jinnrry/pmail:latest`
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-09-12 17:37:20 +08:00
|
|
|
|
> [!IMPORTANT]
|
2023-11-18 13:07:21 +08:00
|
|
|
|
> If your server has a firewall turned on, you need to open ports 25, 80, 110, 443, 465
|
2023-09-12 17:37:20 +08:00
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
## 3、Configuration
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
Open `http://127.0.0.1` in your browser or use your server's public IP to visit, then follow the instructions to
|
|
|
|
|
configure.
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-12 13:15:55 +08:00
|
|
|
|
## 4、Email Test
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
Check if your mailbox has completed all the security configuration. It is recommended to
|
|
|
|
|
use [https://www.mail-tester.com/](https://www.mail-tester.com/) for checking.
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-12 13:15:55 +08:00
|
|
|
|
## 5、 WeChat Message Push
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-12 10:09:22 +08:00
|
|
|
|
Open the `config/config.json` file in the run directory, edit a few configuration items at the beginning of `weChatPush`
|
|
|
|
|
and restart the service.
|
2023-07-30 17:59:25 +08:00
|
|
|
|
|
2023-08-28 14:46:08 +08:00
|
|
|
|
## 6、Telegram Message Push
|
|
|
|
|
Create bot and get token from [BotFather](https://t.me/BotFather)
|
|
|
|
|
Open the `config/config.json` file in the run directory, edit a few configuration items at the beginning of `tg`and restart the service.
|
|
|
|
|
|
2023-09-08 02:11:00 +08:00
|
|
|
|
# Configuration file format description
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"logLevel": "info", //log output level
|
|
|
|
|
"domain": "domain.com", // Your domain
|
|
|
|
|
"webDomain": "mail.domain.com", // web domain
|
|
|
|
|
"dkimPrivateKeyPath": "config/dkim/dkim.priv", // dkim key path
|
|
|
|
|
"sslType": "0", // ssl certificate update mode, 0 automatic, 1 manual
|
|
|
|
|
"SSLPrivateKeyPath": "config/ssl/private.key", // ssl certificate path
|
|
|
|
|
"SSLPublicKeyPath": "config/ssl/public.crt", // ssl certificate path
|
|
|
|
|
"dbDSN": "./config/pmail.db", // database connect DSN
|
|
|
|
|
"dbType": "sqlite", //database type ,`sqlite` or `mysql`
|
|
|
|
|
"httpsEnabled": 0, // enabled https , 0:enabled 1:enablde 2:disenabled
|
|
|
|
|
"httpPort": 80, // http port . default 80
|
|
|
|
|
"httpsPort": 443, // https port . default 443
|
|
|
|
|
"spamFilterLevel": 0,// Spam filter level, 0: no filter, 1: filtering when `spf` and `dkim` don't pass, 2: filtering when `spf` don't pass
|
|
|
|
|
"weChatPushAppId": "", // wechat appid
|
|
|
|
|
"weChatPushSecret": "", // weChat Secret
|
|
|
|
|
"weChatPushTemplateId": "", // weChat TemplateId
|
|
|
|
|
"weChatPushUserId": "", // weChat UserId
|
|
|
|
|
"tgChatId": "", // telegram chatid
|
|
|
|
|
"tgBotToken": "", // telegram token
|
|
|
|
|
"isInit": true // If false, it will enter the bootstrap process.
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-11-18 13:07:21 +08:00
|
|
|
|
# Mail Client Configuration
|
|
|
|
|
|
|
|
|
|
POP3 Server Address : [Your Domain]
|
|
|
|
|
|
|
|
|
|
POP3 Port: 110/995(SSL)
|
2023-09-08 02:11:00 +08:00
|
|
|
|
|
2023-11-18 13:07:21 +08:00
|
|
|
|
SMTP Server Address : smtp.[Your Domain]
|
2023-09-08 02:11:00 +08:00
|
|
|
|
|
2023-11-18 13:07:21 +08:00
|
|
|
|
SMTP Port: 25/465(SSL)
|
2023-09-08 02:11:00 +08:00
|
|
|
|
|
2023-07-30 17:59:25 +08:00
|
|
|
|
# For Developer
|
|
|
|
|
|
|
|
|
|
## Project Framework
|
|
|
|
|
|
|
|
|
|
1、 FE: vue3+element-plus
|
|
|
|
|
|
|
|
|
|
The code is in `fe` folder.
|
|
|
|
|
|
|
|
|
|
2、Server: golang + mysql
|
|
|
|
|
|
|
|
|
|
The code is in `server` folder.
|
|
|
|
|
|
2023-08-15 15:40:22 +08:00
|
|
|
|
## Api Documentation
|
|
|
|
|
|
|
|
|
|
[go to wiki](https://github.com/Jinnrry/PMail/wiki)
|
|
|
|
|
|
2023-07-30 17:59:25 +08:00
|
|
|
|
## Plugin Development
|
|
|
|
|
|
|
|
|
|
Reference this file. `server/hooks/wechat_push/wechat_push.go`
|