アプリが添付ファイル付きの電子メールをどのように処理するかをテストする自動化された方法が必要です。
まず、受信したメッセージ (appspotmail 経由で送信) のリクエスト本文の内容をログに記録するように (App Engine 上で) アプリを変更しました。これらの内容を test_mail.txt というファイルにコピーしました
このファイルを投稿して、インバウンド メール テスターを模倣できると考えました。
curl --header "Content-Type:message/rfc822" -X POST -d @test_mail.txt http://localhost:8080/_ah/mail/test@example.com
これを行うたびに、メッセージが適切にインスタンス化されず、標準属性のいずれかを参照すると例外が発生します。
curl の使用方法に何か欠けていますか?
_ah/admin/inboundmail によって投稿されたように、より単純な電子メールを使用して同じ問題に遭遇しました
MIME-Version: 1.0
Date: Wed, 25 Apr 2012 15:50:06 +1000
From: test@example.com
To: test@example.com
Subject: Hello
Content-Type: multipart/alternative; boundary=cRtRRiD-6434410
--cRtRRiD-6434410
Content-Type: text/plain; charset=UTF-8
There
--cRtRRiD-6434410
Content-Type: text/html; charset=UTF-8
There
--cRtRRiD-6434410--