fix: imap proxy do not support password && cleanup days translate (#356)

This commit is contained in:
Dream Hunter
2024-07-19 22:40:53 +08:00
committed by GitHub
parent 38816cbf0f
commit 384eb9b041
3 changed files with 11 additions and 8 deletions
+8 -8
View File
@@ -22,10 +22,10 @@ const cleanupModel = ref({
const { t } = useI18n({ const { t } = useI18n({
messages: { messages: {
en: { en: {
tip: 'Please input the cleanup days', tip: 'Please input the days',
mailBoxLabel: 'Clean up days for mailbox', mailBoxLabel: 'Cleanup the inbox before n days',
mailUnknowLabel: "Clean up days for unknow receiver", mailUnknowLabel: "Cleanup the unknow mail before n days",
sendBoxLabel: "Clean up days for sendbox", sendBoxLabel: "Cleanup the sendbox before n days",
cleanupNow: "Cleanup now", cleanupNow: "Cleanup now",
autoCleanup: "Auto cleanup", autoCleanup: "Auto cleanup",
cleanupSuccess: "Cleanup success", cleanupSuccess: "Cleanup success",
@@ -33,10 +33,10 @@ const { t } = useI18n({
cronTip: "Enable cron cleanup, need to configure [crons] in worker, please refer to the document", cronTip: "Enable cron cleanup, need to configure [crons] in worker, please refer to the document",
}, },
zh: { zh: {
tip: '请输入清理天数', tip: '请输入天数',
mailBoxLabel: '收件箱清理天数', mailBoxLabel: '清理 n 天前的收件箱',
mailUnknowLabel: "无收件人邮件清理天数", mailUnknowLabel: "清理 n 天前的无收件人邮件",
sendBoxLabel: "发件箱清理天数", sendBoxLabel: "清理 n 天前的发件箱",
autoCleanup: "自动清理", autoCleanup: "自动清理",
cleanupSuccess: "清理成功", cleanupSuccess: "清理成功",
cleanupNow: "立即清理", cleanupNow: "立即清理",
+1
View File
@@ -13,6 +13,7 @@ class Settings(BaseSettings):
proxy_url: str = "http://localhost:8787" proxy_url: str = "http://localhost:8787"
port: int = 8025 port: int = 8025
imap_port: int = 11143 imap_port: int = 11143
basic_password: str = ""
class Config: class Config:
env_file = ".env" env_file = ".env"
+2
View File
@@ -121,6 +121,7 @@ class SimpleMailbox:
f"{settings.proxy_url}/api/mails?limit={limit}&offset={start - 1}", f"{settings.proxy_url}/api/mails?limit={limit}&offset={start - 1}",
headers={ headers={
"Authorization": f"Bearer {self.password}", "Authorization": f"Bearer {self.password}",
"x-custom-auth": f"{settings.basic_password}",
"Content-Type": "application/json" "Content-Type": "application/json"
} }
) )
@@ -147,6 +148,7 @@ class SimpleMailbox:
f"{settings.proxy_url}/api/sendbox?limit={limit}&offset={start - 1}", f"{settings.proxy_url}/api/sendbox?limit={limit}&offset={start - 1}",
headers={ headers={
"Authorization": f"Bearer {self.password}", "Authorization": f"Bearer {self.password}",
"x-custom-auth": f"{settings.basic_password}",
"Content-Type": "application/json" "Content-Type": "application/json"
} }
) )