メール転送

メール & セキュリティ
受信メッセージをあるアドレスから別のアドレスに転送するメール ルーティング設定。
← 用語集に戻る

メール転送とは?

メール転送はメールルーティングの設定で、1つのメールアドレスで受信したメッセージを別の宛先アドレスに自動的にリダイレクトします。 転送先アドレスにメールが届くと、メールサーバは、元のメールボックスに保管することなく、ターゲットアドレスにすぐに送信します。

メール転送の仕組み

1. Email sent to: sales@example.com

2. Mail server receives at MX: mail.example.com

3. Server checks forwarding rules

4. Email forwarded to: team@company.com

5. Team receives email (appears from original sender)

転送されたメールは、元の送信元情報を保持しているため、転送アドレスではなく、元の送信元に戻ります。

メール転送の種類

簡単な転送

1つのアドレスが1つの宛先に転送されます。

info@example.com → admin@example.com

多宛先転送

複数の受信者に1つのアドレスが転送されます。

support@example.com → {

tech-team@example.com,

support-lead@example.com,

ticket-system@helpdesk.com

}

条件付きフォワード

条件に基づくフォワード:

If subject contains "urgent" → priority@example.com

If from VIP domain → executive@example.com

Else → general@example.com

##ドメインレベルの転送

1つのドメインから別のドメインにすべての電子メールを転送します。

*@old-domain.com → *@new-domain.com

メール転送の設定

##cPanelの

1. Email → Forwarders

2. Add Forwarder

3. Address to Forward: sales@example.com

4. Forward to: destination@example.com

5. Add Forwarder

##Postfix (Linux)

# /etc/aliases

sales: destination@example.com

# Or for virtual domains

# /etc/postfix/virtual

sales@example.com destination@example.com

# Apply changes

newaliases # For /etc/aliases

# or

postmap /etc/postfix/virtual && systemctl reload postfix

##Gmail転送

1. Settings → Forwarding and POP/IMAP

2. Add a forwarding address

3. Verify forwarding address (click link in confirmation email)

4. Enable forwarding

5. Choose what to do with original (keep, archive, delete)

##マイクロソフト 365

1. Admin Center → Users → Active users

2. Select user → Mail tab

3. Email forwarding → Manage email forwarding

4. Forward all email to: destination@example.com

5. Save changes

Googleワークスペース(ドメインワイド)

1. Admin Console → Apps → Google Workspace → Gmail

2. Routing → Add Route

3. For recipient: Single recipient or All recipients

4. Forward to: destination@example.com

5. Options: Change route, Modify headers

電子メール転送対. エイリアス

特徴:フォワードアリアス
配達場所別のアドレス同じメールボックス
元のアドレス貯蔵いいえ。はい
メールボックスに表示されるいいえ。はい(別名)
認証SPF/DKIMを破壊できます認証を維持
最高の外部ルーティング複数のアドレス → 1 つの受信トレイ
:
Alias:

sales@example.com } → Same mailbox

contact@example.com } (both deliver to mailbox, different addresses)

Forwarding:

sales@example.com → john@gmail.com

(only delivers to john@gmail.com, nothing in sales mailbox)

SPFとメール転送

メール転送は、転送サーバーが元の送信者に代わって電子メールを送信しているため、SPFの課題を作成します。

問題

1. Sender: alice@sender.com sends to sales@forwarder.com

2. Forwarder: sales@forwarder.com forwards to bob@final.com

3. Final server checks SPF:

- Envelope From: alice@sender.com

- Sending IP: forwarder.com's IP

- SPF Check: Does sender.com authorize forwarder.com's IP?

- Result: Usually FAIL (forwarder not in sender.com's SPF)

ソリューション

SRS (Sender Rewriting Scheme):
Forwarder rewrites envelope sender:

Original: MAIL FROM: <alice@sender.com>

Rewritten: MAIL FROM: <srs=hash=sender.com=alice@forwarder.com>

Now SPF checks forwarder.com's SPF (passes)

Postfix SRSの構成:
# Install postsrsd

apt-get install postsrsd

# /etc/postfix/main.cf

sender_canonical_maps = tcp:127.0.0.1:10001

recipient_canonical_maps = tcp:127.0.0.1:10002

systemctl restart postsrsd postfix

ARC(認証を受けたチェーン):

認証結果を転送して保存します。

ARC-Authentication-Results: forwarder.com;

spf=pass smtp.mailfrom=sender.com

dkim=pass header.d=sender.com

DKIMとフォワード

DKIM 署名は、フォワーダーがメッセージを変更した場合、転送中にブレイクできます。

##共通修正 そのブレイクDKIM

##DKIMの保存

変更の最小化:
# Postfix: Don't add disclaimers to forwarded mail

smtpd_discard_ehlo_keywords = silent-discard

フォワーダーによって署名するDKIM:
# Add forwarder's DKIM signature

# Original sender's signature may break, but forwarder's passes

電子メール転送のためのベストプラクティス

フォワードスパーリンガルの使用

可能な場合の優先順位または共有メールボックス:

Instead of: info@example.com → john@gmail.com

Use: John checks info@example.com directly via IMAP/webmail

外部転送のためのSRSを実装

あなたのドメインを外に転送する際に不可欠:

Internal forwarding:  sales@example.com → team@example.com (safe)

External forwarding: sales@example.com → team@gmail.com (use SRS)

##モニターフォワードループ

無限の運送を防いで下さい:

A forwards to B

B forwards to A

= Loop

Solution: Postfix max_hop_count limit (default 50)

配信通知の設定

転送が失敗したときに通知される:

# Postfix

notify_classes = bounce, resource, software

文書の転送ルール

在庫を維持する:

# forwarding-rules.md

| From | To | Purpose | Owner | Created |

|------|----|---------| ------|---------|

| sales@example.com | crm@example.com | CRM integration | IT | 2024-01 |

##正規監査

レビューとクリーンアップ:

# List all forwards (Postfix)

grep -v "^#" /etc/postfix/virtual | grep "@.*@"

# Check for outdated destinations

# Remove forwards for terminated employees

一般的なフォワードの問題

###無声失敗の転送

症状:転送アドレスに送信されたメールが消えます 原因: デバッグ:
# Check mail logs

tail -f /var/log/mail.log | grep "forwarding"

# Test forwarding

echo "Test" | mail -s "Test" forwarding-address@example.com

# Check if it arrives at destination

##SPF フォワードメールの失敗

症状: 転送された電子メールはスパムまたは拒否としてマーク ソリューション:SRSを実装する(上記参照)

転送遅延

症状: 転送された電子メールは、数分または時間遅れに到着します 原因: ソリューション:
# Check Postfix queue

mailq

# Process queue immediately

postqueue -f

宛先マークはスパムとしてメールを転送

症状: 正当な転送されたメールはスパムに行きます 原因: ソリューション:

特定のユースケースの転送

一時的な転送(Vacation)

# .forward file (user home directory)

\myuser, colleague@example.com

# Delivers to both user's mailbox and colleague

##ローカルコピーで転送する

# Keep copy in original mailbox while forwarding

# Postfix virtual:

user@example.com user@example.com, forward@destination.com

部署の配布

# /etc/aliases

sales: john@example.com, jane@example.com, crm-system@tools.com

##外部サービス統合

# Forward to ticket system

support@example.com → ticket-RANDOM@helpdesk.io

# Forward to Slack email

alerts@example.com → workspace.channel.ABC123@example.slack.com

セキュリティの考慮事項

##個人メールへの転送

リスク:

ポリシー:個人アカウントに企業メールを転送する禁止

##外部転送ディスクロージャー

GDPRの検討:転送はデータ共有を構成する可能性があります。

###攻撃ベクトルとして転送

妥協されたアカウントは、メールを配信するために転送を設定します。

# Detection

# Alert on new forwarding rules:

monitor /etc/postfix/virtual for changes

monitor Exchange/M365 forwarding rule creations

電子メール転送のテスト

テスト転送チェーン:
# Send test email

echo "Test forwarding" | mail -s "Forwarding Test" source@example.com

# Check logs on forwarding server

tail -f /var/log/mail.log

# Verify arrival at destination

# Check destination mailbox

SPF/DKIMの保存の確認:
Send email through forwarding chain

Check authentication headers at destination:

Authentication-Results: destination.com;

spf=pass (forwarder: domain of source.com designates <IP> as permitted sender)

dkim=pass header.d=source.com

電子メール転送は便利ですが、実行可能性とセキュリティを維持するための慎重な設定が必要です。

この知識を実践する

DomScan の API を使用してドメインの可用性、状態などを確認します。