將傳入郵件轉寄到兩台伺服器

將傳入郵件轉寄到兩台伺服器

我們有幾個網域,其 MX 記錄指向位於網路邊緣的執行 Qmail 的網關,該網關將其轉送到基於 smtproutes 的多個內部郵件伺服器之一。

我的問題是,如果我想將來自特定網域的每封電子郵件轉發到兩個單獨的伺服器,在 Qmail 中是否有一種簡單的方法可以做到這一點? (我們希望在不同步 IMAP 帳戶的情況下從一台計算機遷移到另一台計算機,因此我們希望郵件能夠在兩台計算機上傳輸幾週,以便用戶可以在新伺服器上接收最近的郵件)。

謝謝。

PS,如果這是重複的,我很抱歉,我以為我提交了這個,但現在找不到它(也不在我的歷史記錄中),所以我認為它一定沒有通過。

答案1

您可能想看看這個:lifewithqmail.org/lwq.html#dot-forward
和這個:greens.org/about/software/qmail/man/man5/dot-qmail.html

QMAIL 檔案 若要變更 qmail-local 的行為,請在您的主目錄中設定 .qmail 檔案。

      .qmail contains one or more lines.  Each line is a delivery
      instruction.  qmail-local follows each instruction in turn.
      There are five types of delivery instructions:  (1) comment;
      (2) program; (3) forward; (4) mbox; (5) maildir.


      (3)  A forward line begins with an ampersand:

                &[email protected]

           qmail-local takes the rest of the line as a mail
           address; it uses qmail-queue to forward the message to
           that address.  The address must contain a fully
           qualified domain name; it must not contain extra
           spaces, angle brackets, or comments:

                # the following examples are WRONG
                &me@new
                &<[email protected]>
                & [email protected]
                &[email protected] (New Address)

           If the address begins with a letter or number, you may
           leave out the ampersand:

                [email protected]

           Note that qmail-local omits its new Return-Path line
           when forwarding messages.

希望這會有所幫助 - 我沒有方便的 qmail 伺服器來首先測試它。

編輯:
您可能需要使用腳本為每個使用者建立這些文件。

答案2

涉及多少用戶?是否可以讓他們向電子郵件用戶端添加另一個帳戶以開始從新伺服器提取郵件?如果配置正確,他們仍然可以存取舊郵件(如果兩個帳戶都使用 IMAP,甚至可以將其移至新伺服器)。

另外,為什麼不願意同步 IMAP 帳號?您是否正在切換到不同的 IMAP 伺服器?當我過去移動郵件時,我使用 rsync 將郵件複製到新伺服器。一次 rsync 後,停止舊伺服器上的 IMAP/SMTP,執行另一次 rsync 以取得第一次 rsync 期間所做的更改,然後在新伺服器上啟動 IMAP/SMTP。

更改設定文件,以便將郵件定向到新伺服器而不是舊伺服器。提前通知用戶,並在半夜進行。如果您控制 DNS,則可以提前一周降低主機記錄上的 TTL,這樣當您實際進行更改時,DNS 更新將快速傳播。

相關內容