新增无人收件和支持一些字符邮箱
This commit is contained in:
@@ -91,6 +91,14 @@
|
|||||||
height="20"/>
|
height="20"/>
|
||||||
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
<el-tooltip v-if="item.status === 7"
|
||||||
|
effect="dark"
|
||||||
|
content="无人收件"
|
||||||
|
>
|
||||||
|
<Icon icon="ic:round-mark-email-read" style="color:#FBBD08" width="20"
|
||||||
|
height="20"/>
|
||||||
|
|
||||||
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div v-else></div>
|
<div v-else></div>
|
||||||
<span class="name">
|
<span class="name">
|
||||||
|
|||||||
@@ -76,9 +76,6 @@ function updateContent() {
|
|||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
|
||||||
color: #409EFF !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<div class="shadow-content">
|
<div class="shadow-content">
|
||||||
${cleanedHtml}
|
${cleanedHtml}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export function isEmail(email) {
|
export function isEmail(email) {
|
||||||
const reg = /^[a-zA-Z0-9]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+$/;
|
const reg = /^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/;
|
||||||
return reg.test(email);
|
return reg.test(email);
|
||||||
}
|
}
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
class="select"
|
class="select"
|
||||||
>
|
>
|
||||||
<el-option key="1" label="用户" :value="'user'"/>
|
|
||||||
<el-option key="2" label="邮箱" :value="'account'"/>
|
|
||||||
<el-option key="3" label="发件人" :value="'name'"/>
|
<el-option key="3" label="发件人" :value="'name'"/>
|
||||||
<el-option key="4" label="主题" :value="'subject'"/>
|
<el-option key="4" label="主题" :value="'subject'"/>
|
||||||
|
<el-option key="1" label="用户" :value="'user'"/>
|
||||||
|
<el-option key="2" label="邮箱" :value="'account'"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<div style="color: #333;display: flex;">
|
<div style="color: #333;display: flex;">
|
||||||
<span>{{ selectTitle }}</span>
|
<span>{{ selectTitle }}</span>
|
||||||
@@ -41,9 +41,10 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
<el-select v-model="params.type" placeholder="Select" class="status-select">
|
<el-select v-model="params.type" placeholder="Select" class="status-select">
|
||||||
<el-option key="1" label="全部" value="all"/>
|
<el-option key="1" label="全部" value="all"/>
|
||||||
<el-option key="2" label="发件" value="send"/>
|
<el-option key="3" label="已接收" value="receive"/>
|
||||||
<el-option key="3" label="收件" value="receive"/>
|
<el-option key="2" label="已发送" value="send"/>
|
||||||
<el-option key="4" label="删除" value="delete"/>
|
<el-option key="4" label="已删除" value="delete"/>
|
||||||
|
<el-option key="4" label="无人收件" value="noone"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<Icon class="icon" icon="iconoir:search" @click="search" width="20" height="20"/>
|
<Icon class="icon" icon="iconoir:search" @click="search" width="20" height="20"/>
|
||||||
<Icon class="icon" @click="changeTimeSort" icon="material-symbols-light:timer-arrow-down-outline"
|
<Icon class="icon" @click="changeTimeSort" icon="material-symbols-light:timer-arrow-down-outline"
|
||||||
@@ -191,7 +192,7 @@ function getEmailList(emailId, size) {
|
|||||||
|
|
||||||
.status-select {
|
.status-select {
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
width: 80px;
|
width: 100px;
|
||||||
:deep(.el-select__wrapper) {
|
:deep(.el-select__wrapper) {
|
||||||
min-height: 28px;
|
min-height: 28px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@
|
|||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="concerning-item">
|
<div class="concerning-item">
|
||||||
<span>版本:</span>
|
<span>版本:</span>
|
||||||
<span>v1.2.0</span>
|
<span>v1.2.1</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="concerning-item">
|
<div class="concerning-item">
|
||||||
<span>交流:</span>
|
<span>交流:</span>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
mail-worker/dist/index.html
vendored
4
mail-worker/dist/index.html
vendored
@@ -6,8 +6,8 @@
|
|||||||
<title></title>
|
<title></title>
|
||||||
<link rel="icon" href="/assets/favicon-C5dAZutX.svg" type="image/svg+xml">
|
<link rel="icon" href="/assets/favicon-C5dAZutX.svg" type="image/svg+xml">
|
||||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
||||||
<script type="module" crossorigin src="/assets/index-DrpZkhSk.js"></script>
|
<script type="module" crossorigin src="/assets/index-BgK8IB2e.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-C0H8Chfa.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-BJW3-Q2l.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="loading-first">
|
<div id="loading-first">
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const permConst = {
|
|||||||
export const emailConst = {
|
export const emailConst = {
|
||||||
type: {
|
type: {
|
||||||
SEND: 1,
|
SEND: 1,
|
||||||
RECEIVE: 0,
|
RECEIVE: 0
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
RECEIVE: 0,
|
RECEIVE: 0,
|
||||||
@@ -34,7 +34,8 @@ export const emailConst = {
|
|||||||
BOUNCED: 3,
|
BOUNCED: 3,
|
||||||
COMPLAINED: 4,
|
COMPLAINED: 4,
|
||||||
DELAYED: 5,
|
DELAYED: 5,
|
||||||
SAVING: 6
|
SAVING: 6,
|
||||||
|
NOONE: 7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ export async function email(message, env, ctx) {
|
|||||||
|
|
||||||
const email = await PostalMime.parse(content);
|
const email = await PostalMime.parse(content);
|
||||||
|
|
||||||
console.warn(email)
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
sendEmail: email.from.address,
|
sendEmail: email.from.address,
|
||||||
name: email.from.name,
|
name: email.from.name,
|
||||||
@@ -42,8 +40,8 @@ export async function email(message, env, ctx) {
|
|||||||
inReplyTo: email.inReplyTo,
|
inReplyTo: email.inReplyTo,
|
||||||
relation: email.references,
|
relation: email.references,
|
||||||
messageId: email.messageId,
|
messageId: email.messageId,
|
||||||
userId: account.userId,
|
userId: account ? account.userId : 0,
|
||||||
accountId: account.accountId,
|
accountId: account ? account.accountId : 0,
|
||||||
isDel: isDel.DELETE,
|
isDel: isDel.DELETE,
|
||||||
status: emailConst.status.SAVING
|
status: emailConst.status.SAVING
|
||||||
};
|
};
|
||||||
@@ -74,7 +72,7 @@ export async function email(message, env, ctx) {
|
|||||||
await attService.addAtt({ env }, attachments);
|
await attService.addAtt({ env }, attachments);
|
||||||
}
|
}
|
||||||
|
|
||||||
await emailService.completeReceive({ env }, emailRow.emailId);
|
await emailService.completeReceive({ env },account ? emailConst.status.RECEIVE : emailConst.status.NOONE, emailRow.emailId);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('邮件接收异常: ', e);
|
console.error('邮件接收异常: ', e);
|
||||||
|
|||||||
@@ -505,6 +505,10 @@ const emailService = {
|
|||||||
conditions.push(eq(email.isDel, isDel.DELETE));
|
conditions.push(eq(email.isDel, isDel.DELETE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === 'noone') {
|
||||||
|
conditions.push(eq(email.status, emailConst.status.NOONE));
|
||||||
|
}
|
||||||
|
|
||||||
if (userEmail) {
|
if (userEmail) {
|
||||||
conditions.push(like(user.email, `${userEmail}%`));
|
conditions.push(like(user.email, `${userEmail}%`));
|
||||||
}
|
}
|
||||||
@@ -569,10 +573,10 @@ const emailService = {
|
|||||||
await orm(c).update(email).set({ isDel: isDel.NORMAL }).where(eq(email.userId, userId)).run();
|
await orm(c).update(email).set({ isDel: isDel.NORMAL }).where(eq(email.userId, userId)).run();
|
||||||
},
|
},
|
||||||
|
|
||||||
async completeReceive(c, emailId) {
|
async completeReceive(c, status, emailId) {
|
||||||
await orm(c).update(email).set({
|
await orm(c).update(email).set({
|
||||||
isDel: isDel.NORMAL,
|
isDel: isDel.NORMAL,
|
||||||
status: emailConst.status.RECEIVE
|
status: status
|
||||||
}).where(eq(email.emailId, emailId)).run();
|
}).where(eq(email.emailId, emailId)).run();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const verifyUtils = {
|
const verifyUtils = {
|
||||||
isEmail(str) {
|
isEmail(str) {
|
||||||
return /^[a-zA-Z0-9]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+$/.test(str);
|
return /^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user