Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cixs #00

Cixs #00

永遠に滅びない古代兵器のお話

bokucurry

June 17, 2017
Tweet

More Decks by bokucurry

Other Decks in Technology

Transcript

  1. メールが届く仕組み 4 送信者 (Sender) 受信者 (Recipient) 送信側 メールサーバ (MTA) 送信側DNS

    キャッシュ サーバ ISP ISP 送信側 メールサーバ (MSA) 受信側 メールサーバ (MTA) 受信側DNS コンテンツ サーバ 受信側 メールサーバ (MDA) 受信側 メールサーバ (MRA) @example.com @company.com メーラ (MUA) メーラ (MUA) To:xxx From:xxx Subject:xxx (Reply-to:xxxx) ヘッダ(From,To) 基本的に受信者のメーラで の表⽰にしか使われない ※Reply-toは相⼿⽅からの 返信先アドレスとして、送 信側メーラが挿⼊。通常は ヘッダFromと同じ値 エンベロープ(From,To) MTA間での配送時にオジリ ナルの配送元・先を識別す る情報として使われる Envelope-from: [email protected] Envelope-to: [email protected] To:xxx From:xxx Subject:xxx (Reply-to:xxxx)
  2. ちなみにAmazon SESでは… バウンスレートがある程度⾼くなると、脅さ警告される それでも改善しないと、SESの送信が停められる 最悪の場合、アカウントが停⽌される 8 Hello, We are reaching

    out to inform you that the Amazon SES sending for AWS account XXXXXXXXXXXX, which lists you as a contact or owner, has been put on probation in AWS region US West (Oregon) because it has triggered alarms for excessive bounces. You may still send mail with the account, but if the problem is not fixed by the time you finish using your probation volume, your ability to send email with Amazon SES may be suspended. Your probation volume is the next 120,000 emails you send. We will be happy to work with you on this issue. Please reply to this email ([email protected]) or reach out to your Technical Account Manager. The details of the issue are as follows: Your current bounce rate is 35.18%. This is measured over the last 3,602 eligible emails you sent, spanning over approximately the last 32 days. We expect our senders' bounce rates to remain below 5%. Senders with a bounce rate exceeding 10% risk suspension. Note that the bounce rate includes only hard bounces, and excludes bounces to domains you have verified. At the end of the probation, if your bounce rate has not returned to acceptable levels, your ability to continue sending email with Amazon SES may be suspended. If your bounce rate improves to acceptable levels and maintains that status, you will be notified when the probation is lifted. For guidance on reducing your bounce rate, please see the Amazon SES Bounce FAQ: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/e-faq-bn.html Sincerely,
  3. VERPとは? Variable Envelope Return Path(可変エンベロープリターンパス) 送信MTAで、Envelope FromとEnvelope Toアドレスからなる拡張アドレ スを(必然的に宛先毎に変えて)Return-Pathヘッダに挿⼊ 受信側はReturn-Pathアドレスに対してバウンスを投げる

    送信側はバウンスを受け取ったエイリアスアドレスから、バウンスした宛先 アドレスを抽出できる みんな⼤好きqmailの拡張アドレスの仕組みを応⽤している 15
  4. VERPを利⽤したバウンスアドレス抽出 16 送信者 (Sender) 受信者 (Recipient) 送信側 メールサーバ (MTA) ISP

    ISP 送信側 メールサーバ (MSA/MRA) 受信側 メールサーバ (MTA) 受信側 メールサーバ (MRA) @example.com メーラ (MUA) メーラ (MUA) Envelope-from: [email protected] Envelope-to: [email protected] Envelope-from: [email protected] Envelope-to: [email protected] Return-path : [email protected] @company.com 受取不能 バウンス発⽣ Envelope-from: [email protected] Envelope-to: [email protected] 予め定義したデリミタを使 い、toからオリジナルの宛 先アドレスを抽出 ↓ 配達不能アドレスとして利 ⽤可能
  5. VERP対応なメールを送信しよう telnetで叩いたらこんな感じ 19 220 mail.hogehoge.com ESMTP Postfix EHLO hogehoge.com 250-mail.hogehoge.com

    250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-AUTH PLAIN LOGIN 250-XVERP 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN (SMTP-AUTH略) MAIL FROM:<[email protected]> XVERP 250 2.1.0 Ok RCPT TO:<[email protected]> 250 2.1.5 Ok
  6. VERP対応なメールを受信した ヘッダはこんな感じ(⼀部略) 20 Delivered-To: [email protected] Received: by 10.107.142.212 with SMTP

    id q203csp1498916iod; Fri, 16 Jun 2017 04:12:09 -0700 (PDT) X-Received: by 10.84.238.141 with SMTP id v13mr12418765plk.162.1497611529499; Fri, 16 Jun Return-Path: <[email protected]> Received: from mail.hogehoge.com (ec2-XX-XX-XX-XX.ap- northeast-1.compute.amazonaws.com. [XX.XX.XX.XX]) by mx.google.com with ESMTP id g12si1632377pla.295.2017.06.16.04.12.09 for <[email protected]>;