目錄表

[Draft]iRedMail 升級紀錄(0.9.9 - 1.7.3)

from 0.9.9 to 1.0

  1. 更新 iRedMail 版本標記

    vi /etc/iredmail-release

    將內容改成 1.0

  2. 更新 Fail2ban 過濾器配置文件

    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

    重啟 Fail2ban 服務

    systemctl restart fail2ban

  3. 配置 Postfix 查詢 Dovecot 郵箱配額狀態
    1. 確保使用 Dovecot 2.2 或更高版本

      dovecot --version

    2. 更新 Dovecot 配置文件

      vi /etc/dovecot/dovecot.conf

      找到 plugin {} 區塊,添加以下三個參數

      plugin {
          :
          # 1.0 Add
          quota_status_success = DUNNO
          quota_status_nouser = DUNNO
          quota_status_overquota = "552 5.2.2 Mailbox is full"
      }

      再添加以下配置以啟用配額狀態服務,監聽在 127.0.0.1:12340

      :
      # 1.0 Add
      service quota-status {
          executable = quota-status -p postfix
          client_limit = 1
          inet_listener {
              address = 127.0.0.1
              port = 12340
          }
      }
      
      !include_try /etc/dovecot/iredmail/*.conf
    3. 重啟 Dovecot 服務

      systemctl restart dovecot

  4. 更新 Postfix 配置文件

    vi /etc/postfix/main.cf

    添加以下配置以啟用配額查詢

    :
    smtpd_recipient_restrictions =
        ...
        check_policy_service inet:127.0.0.1:12340

    重載 Postfix 服務

    postfix reload
  5. 更新 MySQL/MariaDB 數據庫

    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

  6. 檢查和重啟服務

    systemctl status postfix dovecot fail2ban slapd

  7. 測試寄送與收取新的信件來確認 E-Mail 服務

from 1.0 to 1.1

  1. 更新版本標記

    vi /etc/iredmail-release

    將版本號改為 1.1

  2. 更新備份腳本

    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

  3. 修復 CentOS 7 的 rsyslog 配置(僅 CentOS 7)

    vi /etc/rsyslog.d/1-iredmail-iredapd.conf

    if $syslogfacility-text == 'local5' and ($syslogtag startswith 'iredapd' or $msg startswith 'iredapd ') then -/var/log/iredapd/iredapd.log

    重啟 rsyslog

    systemctl restart rsyslog
  4. 修復 Postfix 的 Backup MX 配置

    perl -pi -e 's#%d#%s#g' /etc/postfix/mysql/relay_domains.cf
    postfix reload

  5. 檢查和重啟服務

    systemctl status postfix dovecot rsyslog

  6. 測試升級結果

from 1.1 to 1.2

  1. 更新版本標記

    vi /etc/iredmail-release

    將版本號改為 1.2

  2. 修復 Dovecot 配置文件

    vi /etc/dovecot/dovecot.conf

    禁用 mailbox_list_index

    :
    # 1.2 Add
    mailbox_list_index = no
    
    !include_try /etc/dovecot/iredmail/*.conf

    重啟 Dovecot

    systemctl restart dovecot
  3. 檢查和重啟服務

    systemctl status postfix dovecot

  4. 測試升級結果

from 1.2 to 1.2.1

  1. 更新版本標記

    vi /etc/iredmail-release

    將版本號改為 1.2.1

  2. 更新 iRedAPD

    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

  3. 修正 mlmmj-amime-receive

    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 

  4. 檢查和重啟服務

    systemctl status postfix dovecot

  5. 測試升級結果

參考網址