差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

下次修改
前次修改
tech:iredmail:upgrade [2025/04/28 18:07] – 建立 jonathantech:iredmail:upgrade [2025/04/28 21:54] (目前版本) – [from 1.2 to 1.2.1] jonathan
行 5: 行 5:
     - 將 CentOS 7 的資料移轉到 Ubuntu 22.04 環境上     - 將 CentOS 7 的資料移轉到 Ubuntu 22.04 環境上
  
-===== 0.9.9 1.0 =====+===== from 0.9.9 to 1.0 =====
   * https://docs.iredmail.org/upgrade.iredmail.0.9.9-1.0.html   * https://docs.iredmail.org/upgrade.iredmail.0.9.9-1.0.html
 +  - 更新 iRedMail 版本標記 <cli>
 +vi /etc/iredmail-release
 +</cli>將內容改成 1.0
 +  - 更新 Fail2ban 過濾器配置文件<cli>
 +cd /etc/fail2ban/filter.d/
 +mv postfix.iredmail.conf postfix.iredmail.conf.0.9.9
 +wget -O postfix.iredmail.conf https://github.com/iredmail/iRedMail/raw/1.0/samples/fail2ban/filter.d/postfix.iredmail.conf
 +mv dovecot.iredmail.conf dovecot.iredmail.conf.0.9.9
 +wget -O dovecot.iredmail.conf https://github.com/iredmail/iRedMail/raw/1.0/samples/fail2ban/filter.d/dovecot.iredmail.conf
 +</cli>重啟 Fail2ban 服務<cli>
 +systemctl restart fail2ban
 +</cli>
 +  - 配置 Postfix 查詢 Dovecot 郵箱配額狀態
 +    - 確保使用 Dovecot 2.2 或更高版本<cli>
 +dovecot --version
 +</cli>
 +    - 更新 Dovecot 配置文件<cli>
 +vi /etc/dovecot/dovecot.conf
 +</cli>找到 plugin {} 區塊,添加以下三個參數<file>
 +plugin {
 +    :
 +    # 1.0 Add
 +    quota_status_success = DUNNO
 +    quota_status_nouser = DUNNO
 +    quota_status_overquota = "552 5.2.2 Mailbox is full"
 +}
 +</file>再添加以下配置以啟用配額狀態服務,監聽在 127.0.0.1:12340<file>
 +:
 +# 1.0 Add
 +service quota-status {
 +    executable = quota-status -p postfix
 +    client_limit = 1
 +    inet_listener {
 +        address = 127.0.0.1
 +        port = 12340
 +    }
 +}
  
-===== 1.0 1.1 ===== +!include_try /etc/dovecot/iredmail/*.conf 
-  * https://docs.iredmail.org/upgrade.iredmail.0.9.9-1.0.html+</file> 
 +    - 重啟 Dovecot 服務<cli> 
 +systemctl restart dovecot 
 +</cli> 
 +  - 更新 Postfix 配置文件<cli> 
 +vi /etc/postfix/main.cf 
 +</cli>添加以下配置以啟用配額查詢<file> 
 +
 +smtpd_recipient_restrictions = 
 +    ... 
 +    check_policy_service inet:127.0.0.1:12340 
 +</file>重載 Postfix 服務<cli> 
 +postfix reload 
 +</cli> 
 +  - 更新 MySQL/MariaDB 數據庫<cli> 
 +cd 
 +mkdir 1.0 
 +cd 1.0 
 +wget -O iredmail.mysql https://github.com/iredmail/iRedMail/raw/1.0/update/1.0/iredmail.mysql 
 +mysql vmail < ./iredmail.mysql 
 +</cli> 
 +  - 檢查和重啟服務<cli> 
 +systemctl status postfix dovecot fail2ban slapd 
 +</cli> 
 +  - 測試寄送與收取新的信件來確認 E-Mail 服務 
 + 
 +===== from 1.0 to 1.1 ===== 
 +  * https://docs.iredmail.org/upgrade.iredmail.1.0-1.1.html 
 +  更新版本標記<cli> 
 +vi /etc/iredmail-release 
 +</cli> 將版本號改為 1.1 
 +  - 更新備份腳本<cli> 
 +cd /maildata/backup/ 
 +mv backup_mysql.sh backup_mysql.sh.1.0 
 +wget -O backup_mysql.sh https://github.com/iredmail/iRedMail/raw/1.1/tools/backup_mysql.sh 
 +chown root backup_mysql.sh 
 +chmod 0500 backup_mysql.sh 
 +mv backup_sogo.sh backup_sogo.sh.1.0 
 +wget -O backup_sogo.sh https://github.com/iredmail/iRedMail/raw/1.1/tools/backup_sogo.sh 
 +chown root backup_sogo.sh 
 +chmod 0500 backup_sogo.sh 
 +</cli> 
 +  - 修復 CentOS 7 的 rsyslog 配置(僅 CentOS 7)<cli> 
 +vi /etc/rsyslog.d/1-iredmail-iredapd.conf 
 +</cli><file> 
 +if $syslogfacility-text == 'local5' and ($syslogtag startswith 'iredapd' or $msg startswith 'iredapd ') then -/var/log/iredapd/iredapd.log 
 +</file>重啟 rsyslog<cli> 
 +systemctl restart rsyslog 
 +</cli> 
 +  - 修復 Postfix 的 Backup MX 配置<cli> 
 +perl -pi -e 's#%d#%s#g' /etc/postfix/mysql/relay_domains.cf 
 +postfix reload 
 +</cli> 
 +  - 檢查和重啟服務<cli> 
 +systemctl status postfix dovecot rsyslog 
 +</cli> 
 +  - 測試升級結果 
 + 
 +===== from 1.1 to 1.2 ===== 
 +  * https://docs.iredmail.org/upgrade.iredmail.1.1-1.2.html 
 +  - 更新版本標記<cli> 
 +vi /etc/iredmail-release 
 +</cli> 將版本號改為 1.2 
 +  - 修復 Dovecot 配置文件<cli> 
 +vi /etc/dovecot/dovecot.conf 
 +</cli>禁用 mailbox_list_index<file> 
 +
 +# 1.2 Add 
 +mailbox_list_index = no 
 + 
 +!include_try /etc/dovecot/iredmail/*.conf 
 +</file>重啟 Dovecot<cli> 
 +systemctl restart dovecot 
 +</cli> 
 +  - 檢查和重啟服務<cli> 
 +systemctl status postfix dovecot 
 +</cli> 
 +  - 測試升級結果
  
 +===== from 1.2 to 1.2.1 =====
 +  * https://docs.iredmail.org/upgrade.iredmail.1.2-1.2.1.html
 +  - 更新版本標記<cli>
 +vi /etc/iredmail-release
 +</cli> 將版本號改為 1.2.1
 +  - 更新 iRedAPD<cli>
 +cd 
 +mkdir 1.2.1
 +cd 1.2.1
 +wget -O iRedAPD-5.9.0.tar.gz https://github.com/iredmail/iRedAPD/archive/5.9.0.tar.gz
 +tar zxf iRedAPD-5.9.0.tar.gz
 +cd iRedAPD-5.9.0/tools/
 +bash upgrade_iredapd.sh
 +</cli>
 +  - 修正 mlmmj-amime-receive <cli>
 +cd /usr/bin/
 +mv mlmmj-amime-receive mlmmj-amime-receive.1.2
 +wget -O mlmmj-amime-receive https://github.com/iredmail/iRedMail/raw/1.2/samples/mlmmj/mlmmj-amime-receive
 +chown mlmmj:mlmmj mlmmj-amime-receive
 +chmod 0550 mlmmj-amime-receive 
 +</cli>
 +  - 檢查和重啟服務<cli>
 +systemctl status postfix dovecot
 +</cli>
 +  - 測試升級結果
  
 ===== 參考網址 ===== ===== 參考網址 =====
  • tech/iredmail/upgrade.1745834852.txt.gz
  • 上一次變更: 2025/04/28 18:07
  • jonathan