2026/07/06
2026/02/10
最近google一直出現要停用pop3收信的通知
所以找個之後能處理信件的方法 找到了 imapsync
https://github.com/imapsync/imapsync
因為是用 perl 寫的 可以直接下載來執行或跑docker
如果要直接執行需要補很多perl的元件
所以選擇跑docker
mail server 打開 imaps
設定檔案如下 將所有監聽埠開啟
/etc/dovecot/conf.d/10-master.conf
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
設定 SSL 策略
為了讓 110 與 143 也能正常運作,你的 SSL 設定不能過於強硬。 編輯 /etc/dovecot/conf.d/10-ssl.conf:
ssl = yes
允許不加密的連線同時支援強制加密連線
重啟 dovecot
再來google 要使用 應用程式專用密碼 而不是登入密碼
所以要開啟二階段驗証並設定 應用程式專用密碼
以上都設定完成後 同步指令如下
測試先 dry run
docker run gilleslamiral/imapsync imapsync --host1 mail.abc.tw --port1 993 --user1 test --password1 your_passwd --host2 imap.gmail.com --user2 user@google.com --password2 your_app_password --ssl1 --ssl2 --dry
實際執行
docker run gilleslamiral/imapsync imapsync --host1 mail.abc.tw --port1 993 --user1 test --password1 your_passwd --host2 imap.gmail.com --user2 user@google.com --password2 your_app_password --ssl1 --ssl2
只同步收件夾
docker run gilleslamiral/imapsync imapsync --host1 mail.abc.tw --port1 993 --user1 test --password1 your_passwd --host2 imap.gmail.com --user2 user@google.com --password2 your_app_password --ssl1 --ssl2 --folder INBOX
同步後刪除來源端信件
docker run gilleslamiral/imapsync imapsync --host1 mail.abc.tw --port1 993 --user1 test --password1 your_passwd --host2 imap.gmail.com --user2 user@google.com --password2 your_app_password --ssl1 --ssl2 --delete1 --expunge1
執行後刪除container
docker run --rm gilleslamiral/imapsync imapsync --host1 mail.abc.tw --port1 993 --user1 test --password1 your_passwd --host2 imap.gmail.com --user2 user@google.com --password2 your_app_password --ssl1 --ssl2 --delete1 --expunge1
2024/02/29
2013/08/26
查了一下log
發現如下的情況
Aug 26 09:44:09 mail dovecot: master: Warning: service(imap): process_limit reached, client connections are being dropped
Aug 26 09:45:20 mail dovecot: master: Warning: service(imap): process_limit reached, client connections are being dropped
Aug 26 09:46:25 mail dovecot: master: Warning: service(imap): process_limit reached, client connections are being dropped
Aug 26 09:49:32 mail dovecot: master: Warning: service(imap): process_limit reached, client connections are being dropped
imap 超過預設值了
修改/etc/dovecot/conf.d/10-master.conf
#default_process_limit = 100
default_process_limit = 2000
#default_client_limit = 1000
default_client_limit = 4003
service auth {
加上
client_limit=6048
}
dovecot restart後再觀察看看
dovecot restart時如果預設值有問題
會顯示應該調整的參數
升到centos 6 後不管是postfix或是dovecot 預設值都滿低的
只能夠碰到問題再來慢慢調整了
2013/08/15
查了一下log發現新版本的dovecot 有限制user+IP的連線數量
預設為10
log如下
Aug 11 20:49:07 mail dovecot: imap-login: Maximum number of connections from user+IP exceeded (mail_max_userip_connections=10): user=<test>, method=PLAIN, rip=1.1.1.1, lip=2.2.2.2
查了一下文件
先在/etc/dovecot/dovecot.conf加上
mail_max_userip_connections = 200
後正常
再觀察看看