This commit is contained in:
木木的木头 authored and jinnrry committed 2023-09-08 02:11:00 +08:00
1 parent 5603f26ed6
commit f4689d073c
72 files changed
+1914 -2860

No files matched your search

+4 -1
View File
@@ -6,8 +6,11 @@
"sslType": "0",
"SSLPrivateKeyPath": "config/ssl/private.key",
"SSLPublicKeyPath": "config/ssl/public.crt",
"dbDSN": "./pmail.db",
"dbDSN": "./config/pmail.db",
"dbType": "sqlite",
"spamFilterLevel": 2,
"httpPort": 80,
"httpsPort": 443,
"weChatPushAppId": "",
"weChatPushSecret": "",
"weChatPushTemplateId": "",
+5 -2
View File
@@ -20,6 +20,10 @@ type Config struct {
SSLPublicKeyPath string `json:"SSLPublicKeyPath"`
DbDSN string `json:"dbDSN"`
DbType string `json:"dbType"`
HttpsEnabled int `json:"httpsEnabled"` //后台页面是否启用https,0默认(启用),1启用,2不启用
SpamFilterLevel int `json:"spamFilterLevel"` //垃圾邮件过滤级别,0不过滤、1 spf dkim 校验均失败时过滤,2 spf校验不通过时过滤
HttpPort int `json:"httpPort"` //http服务端口设置,默认80
HttpsPort int `json:"httpsPort"` //https服务端口,默认443
WeChatPushAppId string `json:"weChatPushAppId"`
WeChatPushSecret string `json:"weChatPushSecret"`
WeChatPushTemplateId string `json:"weChatPushTemplateId"`
@@ -27,7 +31,6 @@ type Config struct {
TgBotToken string `json:"tgBotToken"`
TgChatId string `json:"tgChatId"`
IsInit bool `json:"isInit"`
HttpsEnabled int `json:"httpsEnabled"` //后台页面是否启用https,0默认(启用),1启用,2不启用
Tables map[string]string `json:"-"`
TablesInitData map[string]string `json:"-"`
}
@@ -35,7 +38,7 @@ type Config struct {
//go:embed tables/*
var tableConfig embed.FS
const Version = "2.1.2"
const Version = "2.2.0"
const DBTypeMySQL = "mysql"
const DBTypeSQLite = "sqlite"
+5 -2
View File
@@ -6,8 +6,11 @@
"sslType": "0",
"SSLPrivateKeyPath": "config/ssl/private.key",
"SSLPublicKeyPath": "config/ssl/public.crt",
"dbDSN": "./pmail.db",
"dbDSN": "./config/pmail.db",
"dbType": "sqlite",
"spamFilterLevel": 2,
"httpPort": 80,
"httpsPort": 443,
"weChatPushAppId": "",
"weChatPushSecret": "",
"weChatPushTemplateId": "",
@@ -15,5 +18,5 @@
"tgChatId": "",
"tgBotToken": "",
"isInit": true,
"httpsEnabled": 2
"httpsEnabled": 1
}
+3
View File
@@ -8,6 +8,9 @@
"SSLPublicKeyPath": "config/ssl/public.crt",
"dbDSN": "root:root@tcp(127.0.0.1:3306)/pmail?parseTime=True&loc=Local",
"dbType": "mysql",
"spamFilterLevel": 2,
"httpPort": 80,
"httpsPort": 443,
"weChatPushAppId": "",
"weChatPushSecret": "",
"weChatPushTemplateId": "",
+1 -1
View File
@@ -16,7 +16,7 @@ CREATE table email
attachments json COMMENT '附件内容',
spf_check tinyint(1) DEFAULT 0 COMMENT '0未校验,1校验通过,2校验未通过',
dkim_check tinyint(1) DEFAULT 0 COMMENT '0未校验,1校验通过,2校验未通过',
status tinyint(4) NOT NULL DEFAULT 0 COMMENT '0未发送,1已发送,2发送失败',
status tinyint(4) NOT NULL DEFAULT 0 COMMENT '0未发送,1已发送,2发送失败,3删除',
send_user_id int unsigned NOT NULL DEFAULT 0 COMMENT '发件人用户id',
is_read tinyint(1) NOT NULL DEFAULT 0 COMMENT '未读0,已读1',
error text COMMENT '错误信息记录',
+10
View File
@@ -0,0 +1,10 @@
CREATE TABLE `rule`
(
id INT unsigned AUTO_INCREMENT PRIMARY KEY COMMENT '自增id',
user_id int NOT NULL DEFAULT 0 COMMENT '用户id',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '规则名称',
`value` json NOT NULL COMMENT '规则内容',
action int not null default 0 comment '执行动作,1已读,2转发,3删除',
params varchar(255) not null default '' comment '执行参数',
sort int not null default 0 COMMENT '排序,越大约优先'
) COMMENT '收信规则表'
+10
View File
@@ -0,0 +1,10 @@
create table rule
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id int,
name varchar(255) default '' not null,
value json not null,
action int default 0 not null,
params varchar(255) default '' not null,
sort int default 0 not null
)