質問
🕓 事例公開日 : 2025-09-09
【背景】
従来正常に届いていたIMBoxの通知メールが2025年7月2日を最後に届かなくなった。複数のユーザーで同様の問題が発生している状況。1. 事象
エラーメッセージ・スタックトレース:
メール送信ログ(maillog)抜粋Jul 8 08:09:42 ap01-123456789012 postfix/smtp[62624]: CF65C9000083: to=, relay=example-mail-server.com[192.168.1.xxx]:25, delay=1.3, delays=0.01/0.07/0.09/1.1, dsn=2.6.0, status=sent (250 2.6.0 <1816578480.11.1751929780823@ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com> [InternalId=119348551226451, Hostname=EXAMPLE-SERVER.apcprd02.prod.outlook.com] 13310 bytes in 0.218, 59.502 KB/sec Queued mail for delivery) Jul 8 17:03:25 ap01-123456789012 postfix/smtp[122231]: BAD11900AB82: to=, relay=gmail-smtp-in.l.google.com[xx.xx.xx.xx]:25, delay=1.4, delays=0.01/0.06/0.77/0.55, dsn=5.7.26, status=bounced (host gmail-smtp-in.l.google.com[xx.xx.xx.xx] said: 550-5.7.26 Your email has been blocked because the sender is unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM. 550-5.7.26 550-5.7.26 Authentication results: 550-5.7.26 DKIM = did not pass 550-5.7.26 SPF [ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com] with 550-5.7.26 ip: [13.113.6.42] = did not pass 550-5.7.26 550-5.7.26 For instructions on setting up authentication, go to 550 5.7.26 https://support.google.com/mail/answer/81126#authentication d9443c01a7336-23c84530d9fsi127728825ad.297 - gsmtp (in reply to end of DATA command))
症状の説明:
・IMBoxの通知メールが受信トレイに届かない・迷惑メールフォルダにも振り分けられていない
・送信元アドレスがテナント登録のメールアドレスではなく、accelmart@ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com形式になっている
・Gmailへの送信時は認証エラーでブロックされる
2. 発生条件
・2020年6月10日より前に新規開通された環境・メール信頼性対応が未実施の状態
・rewriting-mail-address-config.xmlの設定が適切でない
・javamail-config.xmlにRewritingMailAddressListenerの設定が不足している
回答
1. 原因
技術的な原因:
・2020年6月10日より前に新規開通された環境のため、メール信頼性対応の実施が必要であった。サポート窓口にお問い合わせいただき、対応を実施する流れになっている。
https://aws.accel-mart.com/service_manual/texts/09_limitations/index.html#accel-mart-com
・javamail-config.xmlにRewritingMailAddressListenerの設定が不足していたため、rewriting-mail-address-config.xmlで設定した送信元メールアドレスの書き換えが機能していなかった。
技術的要因の分析:
・要因1:2020年6月10日以前の環境 → 標準でメール信頼性対応が適用されていない・要因2:メール信頼性対応が未実施 → SPF/DKIM認証が設定されていない状態
・要因3:RewritingMailAddressListenerの設定不足 → 送信元アドレス書き換え機能が動作しない
・要因4:rewriting-mail-address-config.xmlの設定のみでは不十分 → リスナー設定がないと書き換え処理が実行されない
根本的な要因:
メール信頼性対応が行われた後も期待する動作にならなかったのは、intra-mart Accel Platform 2023 Spring以降でメールアドレス書き換え機能を利用するために必要なRewritingMailAddressListenerの設定が不足していたことが根本原因です。
2. 対応方法
根本解決方法:
1. javamail-config.xmlにRewritingMailAddressListenerを追加- conf/javamail-config/javamail-config.xmlを編集
- <listener>タグ内に以下を追加:
<listener-class>jp.co.intra_mart.foundation.mail.javamail.listener.impl.RewritingMailAddressListener</listener-class>
2. rewriting-mail-address-config.xmlの設定確認
- 送信元アドレスの書き換えルールが正しく設定されていることを確認
- コメントアウトされている箇所がないかチェック
3. モジュール反映の実施
- WARファイルと静的ファイルの出力
- 運用管理サイトからモジュール反映を実行
暫定対処方法:
各機能の個別設定でテナントメールアドレスを使用する設定を有効化することで、一時的に送信元アドレスを統一できます。3. 原因究明に至るまでの調査方法
1. メール送信ログ(maillog)を確認。Outlook は OK、Gmail は NG。2. 受信側(Gmail)での認証エラーの詳細を分析
3. 送信元アドレスがAWSのEC2インスタンス名になっている現象を確認
4. rewriting-mail-address-config.xmlの設定内容を検証
5. 検証環境と本番環境の設定差分を比較調査
6. intra-mart Accel Platformのドキュメントでメールアドレス書き換え機能の要件を確認
7. javamail-config.xmlの設定不足を特定し、RewritingMailAddressListenerの追加が必要であることを判明