Giter Club home page Giter Club logo

pmail's Introduction

PMail

A server, a domain, a line of code, a minute, and you'll be able to build a domain mailbox of your own.

I'm Chinese, and I'm not good at English, so I apologise for my translation.

Introduction

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 .

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!

Editor

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 score 10 points if correctly configured.
  • Implementing the ACME protocol, the program will automatically obtain and update Let's Encrypt certificates.

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)

  • Support pop3, smtp protocol, you can use any mail client you like.

How to run

0、Check You IP / Domain

First go to spamhaus and check your domain name and server IP for blocking records

1、Download

  • Click Here Download a program file that matches you.
  • Or use Docker docker pull ghcr.io/jinnrry/pmail:latest

2、Run

./pmail (Set the http port for the initialization interface with -p )

Or

docker run -p 25:25 -p 80:80 -p 443:443 -p 110:110 -p 465:465 -p 995:995 -v $(pwd)/config:/work/config ghcr.io/jinnrry/pmail:latest

Important

If your server has a firewall turned on, you need to open ports 25, 80, 110, 443, 465, 995

3、Configuration

Open http://127.0.0.1 in your browser or use your server's public IP to visit, then follow the instructions to configure.

4、Email Test

Check if your mailbox has completed all the security configuration. It is recommended to use https://www.mail-tester.com/ for checking.

Configuration file format description

{
  "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
  "isInit": true // If false, it will enter the bootstrap process.
}

Mail Client Configuration

POP3 Server Address : pop.[Your Domain]

POP3 Port: 110/995(SSL)

SMTP Server Address : smtp.[Your Domain]

SMTP Port: 25/465(SSL)

Plugin

WeChat Push

Telegram Push

Web Push

Plugin Install

Important

Plugins run on your server as independent processes, please review the security of third-party plugins on your own.PMail currently only maintains the three plugins mentioned above.

Copy plugin binary file to /plugins

For Developer

Project Framework

1、 FE: vue3+element-plus

The code is in fe folder.

2、Server: golang + MySQL/SQLite

The code is in server folder.

3、How to build

make build

4、Unit test

make test

Api Documentation

go to wiki

Plugin Development

go to wiki

pmail's People

Contributors

crrashh1542 avatar dreamhunter2333 avatar j3n5en avatar jeeklin avatar jinnrry avatar testwill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pmail's Issues

消息推送如何使用

"weChatPushAppId": "", // 微信推送appid
"weChatPushSecret": "", // 微信推送秘钥
"weChatPushTemplateId": "", // 微信推送模板id
"weChatPushUserId": "", // 微信推送用户id
"tgChatId": "", // telegram 推送chatid
"tgBotToken": "", // telegram 推送 token

这些怎么获取和使用

作者能否提供一个示例的docker-compose.yml文件或者使用docker运行容器的命令

我使用这条docker启动容器,出现了容器无法启动
sudo docker run -p 25:5 -p 5780:80 -p 4343:443 -v ./config:/config --name pmail2 ghcr.io/jinnrry/pmail

输出信息为创建一系列的表,最后的信息为
CREATE INDEX sessions_expiry_idx ON sessions (expiry);
[info][2023-09-04 11:56:11][/work/http_server/https_server.go:42]Http Server Start
[fatal][2023-09-04 11:56:11][/work/smtp_server/main.go:64]open config/ssl/public.crt: no such file or directory

接着我使用提供的程序直接运行,会提示80端口被占用,因为我已经安装了nginx 。

作者能理解这个我表达的意思吗

通过smtp发送的邮件到pmail自己的收件箱了

使用docker部署,邮件可从web页面正常收发
使用smtp没法发到目标邮箱中

[info][2023-12-06 14:02:45][ac11000265700e815ec80001b6c3ceb0][/work/utils/send/send.go:73]SMTP Send Success !
smtp/server 2023/12/06 14:03:55 handler error: read tcp 172.17.0.2:465->58.xx.xx.xx:59462: read: connection reset by peer
[info][2023-12-06 14:07:20][ac11000265700f98b1b20001f31973b0][/work/smtp_server/read_content.go:47]邮件原始内容: From: no-reply_EasyIMG <[email protected]>
To: [email protected]
Subject: Test
Message-ID: <[email protected]>
MIME-Version: 1.0
Date: Wed, 06 Dec 2023 14:07:20 +0800
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<p>
    =E6=82=A8=E5=A5=BD=EF=BC=8C=E8=BF=99=E6=98=AF=E4=B8=80=E5=B0=
=81=E6=9D=A5=E8=87=AA Easy IMG =E7=9A=84=E6=B5=8B=E8=AF=95=E9=82=AE=
=E4=BB=B6=EF=BC=8C=E5=BD=93=E6=82=A8=E7=9C=8B=E5=88=B0=E8=BF=99=E5=B0=81=
=E9=82=AE=E4=BB=B6=E5=90=8E=EF=BC=8C=E8=AF=B4=E6=98=8E=E9=82=AE=E4=BB=B6=
=E9=85=8D=E7=BD=AE=E6=AD=A3=E7=A1=AE=E3=80=82=E5=A6=82=E6=9E=9C=E4=B8=8D=
=E6=98=AF=E6=82=A8=E6=9C=AC=E4=BA=BA=E6=93=8D=E4=BD=9C=EF=BC=8C=E8=AF=B7=
=E5=BF=BD=E7=95=A5=E3=80=82
</p>

image

It ignores the "httpPort:" in config.json

I want to run it on any port other than the 80th - I don't want to use sudo

./build

then

vim output/config/config.json 
    "httpPort": 80 ===> "httpPort": 8080,

then

./output/pmail_linux_amd64

error:

panic: listen tcp :80: bind: permission denied
    goroutine 21 [running]:
    pmail/http_server.SetupStart()
            /<...>/PMail/server/http_server/setup_server.go:41 +0x298
    created by pmail/res_init.Init in goroutine 1
            /<...>/PMail/server/res_init/init.go:23 +0x57

能提供一下前端代码吗?

我在你的系统中添加了一些功能(地址薄,用户权限管理,dashboard等),然后自己弄了一个弄了一个前端,我想到时候直接整合到你这,所以需要你的前端代码,这样可以尽量符合你的设计

Emails cannot be sent out through port 25, can the port be changed to 465

Oracle has blocked outbound connections over SMTP port 25, but allows SMTP over SSL connections on port 465.

I noticed in the source code that the port can be changed, but I have very limited knowledge about this.

I'm not sure if this project supports sending emails via SMTPS. It would be great if someone could advise if it's possible to configure the application to send emails through port 465 instead of 25. This would allow emails to be delivered successfully.

Any help or pointers are much appreciated!

No "create user" wizard screen

I run it locally, for testing. Without docker.
I've compiled everything using the build.sh file.

  • it'll always ingore httpPort in the config.json in output. I'll change it to 8080 but it'll ignore it. It'll use the 80 or 443 always, therefore so sudo will have to be used to run ./pmail binary

  • there'll be no "create user" wizard screen. Instead, the login-password screen will appear. So I can't log in because I haven't created any user yet.
    Screenshot_20230909_235551

Sudo and https

Even if I specify 8080 for the http port, it'll still sudo to be able to the 25th port. Does it then require sudo no matter what?

Also, I want to run it on a server where there'll be other ordinary websites. So I can't allow PMail to use 443 port Can PMail be put behind reverse proxy such as nginx, with http only?

How to disable https then? Remove https from the config?

求并集是不是写错了

// Merge 求并集
func Merge[T any](slice1, slice2 []T) []T {
s1Len := len(slice1)

slice3 := make([]T, s1Len+len(slice2))
for i, t := range slice1 {
	slice3[i] = t
}

for i, t := range slice2 {
	slice3[s1Len+i] = t
}

return slice3

}
这个感觉不是并集呢, 并集是要将两个集合中相同的部分 只保留一份的

HELO标识问题

为什么发出的邮件会带有helo标识“jinnrry.com”,这样会造成误以为邮件是从"jinnrry.com"发出的

发送给 gmail.com的时候,会失败!

,QQ接收是正常的,
但是gmail会有如下错误:

Messages missing a valid Message-ID header are not
5.7.1 accepted. Please visit
5.7.1  https://support.google.com/mail/?p=RfcMessageNonCompliant and review
5.7.1 RFC 5322 specifications for more information. j10-20020a63550a000000b005bd6784a9fasi11866943pgb.676 - gsmtp

所有浏览器都出现 ”此页面不能正确地重定向“

版本:v2.2.6

使用不同的浏览器打开都出现了如下页面
图片

使用docker搭建,docker日志输出没有报错,日志如下
pmail | [info][2023-10-07 15:19:46][/work/main.go:76]***************************************************
pmail | [info][2023-10-07 15:19:46][/work/main.go:77]*** Server Start Success Version:2.2.6
pmail |
pmail |
pmail | [info][2023-10-07 15:19:46][/work/main.go:78]*** Git Commit Hash:
pmail | [info][2023-10-07 15:19:46][/work/main.go:79]*** Build TimeStamp: 2023-09-28 10:24:29
pmail | [info][2023-10-07 15:19:46][/work/main.go:80]*** Build GoLang Version: go version go1.21.1 linux/amd64
pmail | [info][2023-10-07 15:19:46][/work/main.go:81]***************************************************
pmail | [info][2023-10-07 15:19:46][/work/res_init/init.go:22]Please click http://127.0.0.1 to continue.
pmail |
pmail |
pmail | [info][2023-10-07 15:40:31][/work/db/init.go:73]Create Table: CREATE table email
pmail | (
pmail | id INTEGER PRIMARY KEY AUTOINCREMENT,
pmail | type tinyint(4) NOT NULL DEFAULT 0,
pmail | group_id INTEGER NOT NULL DEFAULT 0,
pmail | subject varchar(1000) NOT NULL DEFAULT '',
pmail | reply_to json,
pmail | from_name varchar(50) NOT NULL DEFAULT '',
pmail | from_address varchar(150) NOT NULL DEFAULT '',
pmail | to json,
pmail | bcc json,
pmail | cc json,
pmail | text text,
pmail | html text,
pmail | sender json,
pmail | attachments json ,
pmail | spf_check tinyint(1) DEFAULT 0 ,
pmail | dkim_check tinyint(1) DEFAULT 0 ,
pmail | status tinyint(4) NOT NULL DEFAULT 0 ,
pmail | send_user_id int unsigned NOT NULL DEFAULT 0 ,
pmail | is_read tinyint(1) NOT NULL DEFAULT 0 ,
pmail | error text ,
pmail | cron_send_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
pmail | send_date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
pmail | create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
pmail | update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
pmail | )
pmail | [info][2023-10-07 15:40:31][/work/db/init.go:73]Create Table: CREATE TABLE group
pmail | (
pmail | id INTEGER PRIMARY KEY AUTOINCREMENT,
pmail | name varchar(10) NOT NULL DEFAULT '',
pmail | parent_id INTEGER NOT NULL DEFAULT 0,
pmail | user_id INTEGER NOT NULL DEFAULT 0
pmail | )
pmail | [info][2023-10-07 15:40:31][/work/db/init.go:73]Create Table: create table rule
pmail | (
pmail | id INTEGER PRIMARY KEY AUTOINCREMENT,
pmail | user_id int,
pmail | name varchar(255) default '' not null,
pmail | value json not null,
pmail | action int default 0 not null,
pmail | params varchar(255) default '' not null,
pmail | sort int default 0 not null
pmail | )
pmail | [info][2023-10-07 15:40:31][/work/db/init.go:73]Create Table: CREATE TABLE sessions
pmail | (
pmail | token TEXT PRIMARY KEY,
pmail | data BLOB NOT NULL,
pmail | expiry REAL NOT NULL
pmail | );
pmail |
pmail |
pmail | CREATE INDEX sessions_expiry_idx ON sessions (expiry);
pmail | [info][2023-10-07 15:40:31][/work/db/init.go:73]Create Table: CREATE TABLE user
pmail | (
pmail | id INTEGER PRIMARY KEY AUTOINCREMENT,
pmail | account varchar(20),
pmail | name varchar(10),
pmail | password char(32)
pmail | );
pmail | CREATE UNIQUE INDEX udx_account on user (account);
pmail | [info][2023-10-07 15:40:31][/work/db/init.go:80]Init Table:
pmail | [info][2023-10-07 15:40:31][/work/db/init.go:73]Create Table: CREATE TABLE user_auth
pmail | (
pmail | id INTEGER PRIMARY KEY AUTOINCREMENT,
pmail | user_id int ,
pmail | email_account varchar(30)
pmail | );
pmail |
pmail |
pmail | CREATE UNIQUE INDEX udx_uid_ename on user_auth ( user_id, email_account);
pmail | CREATE UNIQUE INDEX udx_ename_uid on user_auth ( email_account,user_id );
pmail | [info][2023-10-07 15:40:31][/work/db/init.go:80]Init Table:
pmail | [info][2023-10-07 16:04:01][/work/smtp_server/smtp.go:70]Starting server at :25
pmail | [info][2023-10-07 16:04:01][/work/http_server/https_server.go:37]Http Server Start
pmail | [info][2023-10-07 16:14:44][/work/main.go:76]***************************************************
pmail | [info][2023-10-07 16:14:44][/work/main.go:77]*** Server Start Success Version:2.2.6
pmail |
pmail |
pmail | [info][2023-10-07 16:14:44][/work/main.go:78]*** Git Commit Hash:
pmail | [info][2023-10-07 16:14:44][/work/main.go:79]*** Build TimeStamp: 2023-09-28 10:24:29
pmail | [info][2023-10-07 16:14:44][/work/main.go:80]*** Build GoLang Version: go version go1.21.1 linux/amd64
pmail | [info][2023-10-07 16:14:44][/work/main.go:81]***************************************************
pmail | [info][2023-10-07 16:14:44][/work/smtp_server/smtp.go:70]Starting server at :25
pmail | [info][2023-10-07 16:14:44][/work/http_server/https_server.go:37]Http Server Start

docker时,可以修改443的端口吗?

另外一个VPN应用占用了443端口。

root@v930260445:~# docker run -p 25:25 -p 8011:80 -p 8443:443 -p 465:465 -v $(pwd)/config:/work/config ghcr.io/jinnrry/pmail:latest
[info][2023-09-14 13:03:35][/work/main.go:76]***************************************************
[info][2023-09-14 13:03:35][/work/main.go:77]*** Server Start Success Version:2.2.5

[info][2023-09-14 13:03:35][/work/main.go:78]*** Git Commit Hash:
[info][2023-09-14 13:03:35][/work/main.go:79]*** Build TimeStamp: 2023-09-12 18:46:31
[info][2023-09-14 13:03:35][/work/main.go:80]*** Build GoLang Version: go version go1.21.1 linux/amd64
[info][2023-09-14 13:03:35][/work/main.go:81]***************************************************
[fatal][2023-09-14 13:03:35][/work/smtp_server/smtp.go:64]tls: failed to find any PEM data in certificate input
root@v930260445:~# docker run -p 25:25 -p 8011:80 -p 8443:444 -p 465:465 -v $(pwd)/config:/work/config ghcr.io/jinnrry/pmail:latest
[info][2023-09-14 13:05:42][/work/main.go:76]***************************************************
[info][2023-09-14 13:05:42][/work/main.go:77]*** Server Start Success Version:2.2.5

[info][2023-09-14 13:05:42][/work/main.go:78]*** Git Commit Hash:
[info][2023-09-14 13:05:42][/work/main.go:79]*** Build TimeStamp: 2023-09-12 18:46:31
[info][2023-09-14 13:05:42][/work/main.go:80]*** Build GoLang Version: go version go1.21.1 linux/amd64
[info][2023-09-14 13:05:42][/work/main.go:81]***************************************************
[error][2023-09-14 13:05:42][/work/cron_server/ssl_update.go:17]SSL Check Error, Update SSL Certificate. Error Info :at /work/services/setup/ssl/ssl.go:155
tls: failed to find any PEM data in certificate input
[fatal][2023-09-14 13:05:42][/work/smtp_server/smtp.go:64]tls: failed to find any PEM data in certificate input

求助解决!

服务器端口和dns记录

1.希望可以在readme里面加上服务器需要开的端口,分为必须开的端口和自选开的端口,比如必须开的端口smtp对应的端口25,http端口80.
2.界面上显示的dns记录在godaddy上不能添加,两个hostname是-的不能添加,hostname不能填写-。

手机客户端收发邮件问题

就是初始化时候添加的账号和密码,通过这个账号密码在QQ邮箱客户端上配置,POP收件可以正常接收,但是SMTP发件提示账号密码错误。

服务器上都是这样的日志:

[debug][2023-11-23 23:38:26][ac120009655f71f2c5d1000bc32c4cb0][D:/GO_Project/eMailServer/server/pop3_server/action.go:93]POP3 PASS 123123 , User:admin888
[debug][2023-11-23 23:38:27][ac120009655f71f2c5d1000bc32c4cb0][D:/GO_Project/eMailServer/server/pop3_server/action.go:217]POP3 CMD: LIST ,Args:
[debug][2023-11-23 23:38:27][ac120009655f71f2c5d1000bc32c4cb0][D:/GO_Project/eMailServer/server/pop3_server/action.go:176]POP3 CMD: UIDL ,Args:
[debug][2023-11-23 23:39:21][ac120009655f7229e590000b9b4217b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:41]POP3 CMD: CAPA With Tls
[debug][2023-11-23 23:39:21][ac120009655f7229e590000b9b4217b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:73]POP3 CMD: USER, Args:admin888
[debug][2023-11-23 23:39:21][ac120009655f7229e590000b9b4217b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:80]POP3 User admin888
[debug][2023-11-23 23:39:22][ac120009655f7229e590000b9b4217b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:93]POP3 PASS 123123 , User:admin888
[debug][2023-11-23 23:39:22][ac120009655f7229e590000b9b4217b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:217]POP3 CMD: LIST ,Args:
[debug][2023-11-23 23:39:22][ac120009655f7229e590000b9b4217b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:176]POP3 CMD: UIDL ,Args:
[debug][2023-11-23 23:39:25][ac120009655f722de4c3000b192bd4b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:41]POP3 CMD: CAPA With Tls
[debug][2023-11-23 23:39:26][ac120009655f722de4c3000b192bd4b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:73]POP3 CMD: USER, Args:admin888
[debug][2023-11-23 23:39:26][ac120009655f722de4c3000b192bd4b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:80]POP3 User admin888
[debug][2023-11-23 23:39:26][ac120009655f722de4c3000b192bd4b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:93]POP3 PASS 123123 , User:admin888
[debug][2023-11-23 23:39:26][ac120009655f722e0618000b04c8c6b0][D:/GO_Project/eMailServer/server/smtp_server/smtp.go:28]新SMTP连接
[debug][2023-11-23 23:41:15][ac120009655f729beaae000b272228b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:41]POP3 CMD: CAPA With Tls
[debug][2023-11-23 23:41:15][ac120009655f729beaae000b272228b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:73]POP3 CMD: USER, Args:admin888
[debug][2023-11-23 23:41:15][ac120009655f729beaae000b272228b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:80]POP3 User admin888
[debug][2023-11-23 23:41:15][ac120009655f729beaae000b272228b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:93]POP3 PASS 123123 , User:admin888
[debug][2023-11-23 23:41:15][ac120009655f729beaae000b272228b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:217]POP3 CMD: LIST ,Args:
[debug][2023-11-23 23:41:15][ac120009655f729beaae000b272228b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:176]POP3 CMD: UIDL ,Args:
[debug][2023-11-23 23:41:33][ac120009655f72adf947000bb148bdb0][D:/GO_Project/eMailServer/server/pop3_server/action.go:41]POP3 CMD: CAPA With Tls
[debug][2023-11-23 23:41:33][ac120009655f72adf947000bb148bdb0][D:/GO_Project/eMailServer/server/pop3_server/action.go:73]POP3 CMD: USER, Args:admin888
[debug][2023-11-23 23:41:33][ac120009655f72adf947000bb148bdb0][D:/GO_Project/eMailServer/server/pop3_server/action.go:80]POP3 User admin888
[debug][2023-11-23 23:41:33][ac120009655f72adf947000bb148bdb0][D:/GO_Project/eMailServer/server/pop3_server/action.go:93]POP3 PASS 123123 , User:admin888
[debug][2023-11-23 23:41:35][ac120009655f72af3d7a000b2ae306b0][D:/GO_Project/eMailServer/server/smtp_server/smtp.go:28]新SMTP连接
[debug][2023-11-23 23:48:19][ac120009655f744361bd000b68e7d1b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:41]POP3 CMD: CAPA With Tls
[debug][2023-11-23 23:48:19][ac120009655f744361bd000b68e7d1b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:73]POP3 CMD: USER, Args:admin888
[debug][2023-11-23 23:48:19][ac120009655f744361bd000b68e7d1b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:80]POP3 User admin888
[debug][2023-11-23 23:48:19][ac120009655f744361bd000b68e7d1b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:93]POP3 PASS 123123 , User:admin888
[debug][2023-11-23 23:48:19][ac120009655f744361bd000b68e7d1b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:217]POP3 CMD: LIST ,Args:
[debug][2023-11-23 23:48:19][ac120009655f744361bd000b68e7d1b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:176]POP3 CMD: UIDL ,Args:
[debug][2023-11-23 23:48:20][ac120009655f7444f2a1000bc30850b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:41]POP3 CMD: CAPA With Tls
[debug][2023-11-23 23:48:20][ac120009655f7444f2a1000bc30850b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:73]POP3 CMD: USER, Args:admin888
[debug][2023-11-23 23:48:20][ac120009655f7444f2a1000bc30850b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:80]POP3 User admin888
[debug][2023-11-23 23:48:20][ac120009655f7444f2a1000bc30850b0][D:/GO_Project/eMailServer/server/pop3_server/action.go:93]POP3 PASS 123123 , User:admin888
[debug][2023-11-23 23:48:21][ac120009655f744578cb000b5939c4b0][D:/GO_Project/eMailServer/server/smtp_server/smtp.go:28]新SMTP连接

能否增加功能:主机映射到docker端口的修改

经过几次docker搭建的测试,发现80,443端口不能修改主机其他端口的映射,否则会发生不能生成证书,访问web界面失败,

我先使用80:80 443:443 端口,docker搭建生成了证书,后修改了主机映射的端口,在生成证书那一步通过,复制之前生成的证书,最后web界面却无法访问

我的主机因为需要nginx来实现反向代理,所以主机的80,443端口就被占用了,这个测试还是我把nginx服务停掉之后测试的。

能把主机端口修改为自定义的吗

listen tcp :25: bind: address already in use

我现在是windows下使用goland, 程序再 wsl2中调试. 老是监听不起25端口

再 wsl2 里面执行 netstat -tunlop 返回下面

root@maxbad-801:~# netstat -tunlop
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     Timer
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      181/systemd-resolve  off (0.00/0/0)
tcp        0      0 127.0.0.1:49000         0.0.0.0:*               LISTEN      -                    off (0.00/0/0)
tcp        0      0 127.0.0.1:49443         0.0.0.0:*               LISTEN      -                    off (0.00/0/0)
tcp6       0      0 :::8070                 :::*                    LISTEN      -                    off (0.00/0/0)
tcp6       0      0 :::8443                 :::*                    LISTEN      -                    off (0.00/0/0)
tcp6       0      0 :::9443                 :::*                    LISTEN      -                    off (0.00/0/0)
tcp6       0      0 :::12002                :::*                    LISTEN      -                    off (0.00/0/0)
tcp6       0      0 :::12003                :::*                    LISTEN      -                    off (0.00/0/0)
tcp6       0      0 :::12000                :::*                    LISTEN      -                    off (0.00/0/0)
tcp6       0      0 :::12001                :::*                    LISTEN      -                    off (0.00/0/0)
udp        0      0 127.0.0.53:53           0.0.0.0:*                           181/systemd-resolve  off (0.00/0/0)
udp        0      0 127.0.0.1:323           0.0.0.0:*                           -                    off (0.00/0/0)
udp6       0      0 ::1:323                 :::*                                -                    off (0.00/0/0)
root@maxbad-801:~#

init了两个hook的话会触发两次重复的

async.New(nil).Process(func() {
    hook.ReceiveParseAfter(email)
})

看起来会导致触发最后的一个hook x次,而跳过前面的hook,不清楚要怎么处理,有空麻烦处理一下,谢谢。

配置转发规则后panic

[info][2023-09-08 23:50:08][/mnt/d/PMail/server/dto/parsemail/dkim.go:90]Valid signature for: gmail.com
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9d76c9]

goroutine 20 [running]:
main.(*logFormatter).Format(0x0?, 0xc00014ba40)
        /mnt/d/PMail/server/main.go:25 +0x169
github.com/sirupsen/logrus.(*Entry).write(0xc00014ba40)
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:289 +0xa5
github.com/sirupsen/logrus.(*Entry).log(0xc00014b9d0, 0x2, {0xc000341500, 0x6f0})
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:252 +0x474
github.com/sirupsen/logrus.(*Entry).Log(0xc00014b9d0, 0x2, {0xc0004d37f0?, 0x2?, 0x2?})
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:304 +0x4f
github.com/sirupsen/logrus.(*Entry).Logf(0xc00014b9d0, 0x2, {0xabdcc6?, 0xc00019d158?}, {0xc000077878?, 0xc000077860?, 0x462499?})
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:349 +0x85
github.com/sirupsen/logrus.(*Entry).Errorf(...)
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:378
pmail/utils/async.(*Async).HandleErrRecover(0xc000243d60, {0xa28f20?, 0x1334a00})
        /mnt/d/PMail/server/utils/async/async.go:68 +0x187
pmail/utils/async.(*Async).Process.func1.1()
        /mnt/d/PMail/server/utils/async/async.go:45 +0x3c
panic({0xa28f20, 0x1334a00})
        /usr/local/go/src/runtime/panic.go:884 +0x213
main.(*logFormatter).Format(0xc0003c3280?, 0xc00014b960)
        /mnt/d/PMail/server/main.go:25 +0x169
github.com/sirupsen/logrus.(*Entry).write(0xc00014b960)
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:289 +0xa5
github.com/sirupsen/logrus.(*Entry).log(0xc00014b8f0, 0x2, {0xc0003b18c0, 0x5c})
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:252 +0x474
github.com/sirupsen/logrus.(*Entry).Log(0xc00014b8f0, 0x2, {0xc000077d08?, 0x1?, 0x1?})
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:304 +0x4f
github.com/sirupsen/logrus.(*Entry).Logf(0xc00014b8f0, 0x2, {0xac0df3?, 0xc00017f800?}, {0xc000077f20?, 0x700?, 0x0?})
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:349 +0x85
github.com/sirupsen/logrus.(*Entry).Errorf(...)
        /home/jiangwei/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:378
pmail/utils/send.Forward.func1({0xa59620?, 0x9b4f67?})
        /mnt/d/PMail/server/utils/send/send.go:72 +0x39f
pmail/utils/async.(*Async).WaitProcess.func1({0x0?, 0x0?})
        /mnt/d/PMail/server/utils/async/async.go:37 +0x69
pmail/utils/async.(*Async).Process.func1()
        /mnt/d/PMail/server/utils/async/async.go:48 +0x67
created by pmail/utils/async.(*Async).Process
        /mnt/d/PMail/server/utils/async/async.go:42 +0xb5

配置的规则是:收件人地址 - 包含 - xxx 转发到 [email protected]

删掉规则后,发送相同邮件能进信箱

Does it support multiple mailboxes?

Does it support only single mailbox which is created during the installation?

Or does it support multiple mailboxes too? And catch-all address?

建议增加命令行参数启动方式

您好,
1、建议增加命令行参数启动方式。目前看配置文件内的内容其实并不很多,配置文件和令行参数也并不冲突。首次启动时,可以通过命令行参数创建配置文件。
2、80口是否可以通过参数的形式指定。

谢谢您,很好的项目,已经拉下来学习了。

Can multiple copies of PMail be run on the same VPS with no issue?

I want to use PMail for multiple domains.

If I run multiple installations, let's say, from "/opt/Pmail-1", "/opt/Pmail-2", "/opt/Pmail-3"... won't they mess up with other? Will everything work well?

Some email-project such as Mail-in-the-Box, and others I don't remember which, require that it be installed on an empty server and only one copy. Otherwise, it won't work properly.

更新邮件协议后配置需要修改的地方

版本:2.3.1(截止最新)

问题类型:疑问解答

问题描述:作者你好~,看到项目最新版本支持pop3和imtp协议,使用客户端连接了,我对于项目的配置只是初始引导界面的内容,最新版本对于配置文件,比如域名和端口需要做哪些修改吗

Some bugs about group deletion

Looking at your logic about group deletion, you first find out all the child ids in a recursive way and delete them together. If there is a loop, it will SOF. you also didn't check when you added the group.A good approach is to remove the parent group before querying the child id

runtime error when try to run PMail in docker environment

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

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x9507f5]

goroutine 1 [running]:
pmail/cron_server.Start()
/work/cron_server/ssl_update.go:14 +0x15
main.main()
/work/main.go:84 +0x351
[info][2023-11-23 17:29:12][/work/main.go:76]***************************************************
[info][2023-11-23 17:29:12][/work/main.go:77]*** Server Start Success Version:2.3.4

[info][2023-11-23 17:29:12][/work/main.go:78]*** Git Commit Hash:
[info][2023-11-23 17:29:12][/work/main.go:79]*** Build TimeStamp: 2023-11-23 14:23:53
[info][2023-11-23 17:29:12][/work/main.go:80]*** Build GoLang Version: go version go1.21.4 linux/amd64
[info][2023-11-23 17:29:12][/work/main.go:81]***************************************************

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.