spam - How can the Return-Path header be different than the actual email bounce recipient? -


i moved transactional email sending mailgun

it works far wondering return-path header.

consider email (i removed irrelevant header , replaced email/domain privacy purposes)

delivered-to: reciever@gmail.com received: 10.76.154.104 smtp id vn8csp478308oab;         wed, 4 sep 2013 05:04:44 -0700 (pdt) x-received: 10.50.22.105 smtp id c9mr1537992igf.36.1378296283817;         wed, 04 sep 2013 05:04:43 -0700 (pdt) return-path: <bounce+a801a1.c2b37-reciever=gmail.com@my-website.com> received: so254-63.mailgun.net (so254-63.mailgun.net. [198.61.254.63])         mx.google.com esmtp id k5si1620852igx.55.1969.12.31.16.00.00;         wed, 04 sep 2013 05:04:43 -0700 (pdt) received-spf: ...stripped... authentication-results: ...stripped... dkim-signature: ...stripped... domainkey-signature: ...stripped... received: luna.mailgun.net http; wed, 04 sep 2013 12:04:42 +0000 mime-version: 1.0 content-type: text/plain; charset="utf-8" subject: ...stripped... from: my-website <support@my-website.com> to: reciever@gmail.com message-id: <20130904120442.1488.88532@my-website.com> x-mailgun-sid: wyi5ymi1osisicjqb2vob3bmk2vlz2vpn2lkmm9pbw9vym9vzmfpqgdtywlslmnvbsisicjjmmiznyjd date: wed, 04 sep 2013 12:04:43 +0000 sender: support@my-website.com content-transfer-encoding: base64  ...email body... 

this raw email displayed actual mail in gmail inbox. can see return-path header contains email adress ends in @my-website.com

but have set dns records outgoing email (spf, domainkey, etc). not incoming email. meaning, mx records still point mailservers somewhere else (in case google apps).

how possible bounce email arrives @ mailgun servers?

i have expected see email adress ending in @some-mailgun-server.com in return-path header!

i have been using amazon ses before, , there had return-path header ending in amazonses.com

i asked mailgun support , got response:

nick: setup correct, mailgun still automatically handle bounces though mx records pointing elsewhere

they assured me fine gave me no explanation (which okay since job not teach me things dont know deliver reliable email service...)

so hope can explain me.

i hope point clear, if not please ask , try clearify question.

edit:

one theory of me bounce email indeed sent google mail servers discareded. redundant since error response sent sending mailserver during process (when opens tcp conneciton target mail server).

to test theory , since return-path email in form of bounce+something@my-website.com, , google delivers email, regardless of comes after + character, user in front of it, went ahead , created account bounce@my-domain.com on google apps.

i tried send email bounce+a801a1.c2b37-reciever=gmail.com@my-website.com.

it made through inbox.

now expected recieve bounce traffic in inbox. sent email inexistent hotmail address. did not recieve email on google apps inbox, , mailgun sucessfully tracked bounce.

so... appears indeed work. dont understand why.

one more theory have mailserver bounce email delivered never resolved using mx records. rather delivering server, in case luna.mailgun.net chosen. domain ending in return-path address name of mailbox on server, domain has nothing server mail delivered.

then make sense make since might improve deliverability if domains of from , return-path adress match.

however theory. , mean mailbox wich able recieve bounces, must on same server used sending.

in other words impossible have mailbox recieve bounce email adresses hosted somewhere else actual server sending mail. sounds strange me well...

i hope can enlighten me.

turns out there different kinds of bounces.

when bounces occur returned server sending email, , not follow mx records.

thats why sent mailgun servers , arrive there.

however there called "delayed bounces" sent server declared mailserver using mx records in domain.

those delayed bounces difficult handle , there opinions out there violate rfc.

those bounces very, rare. thats why mailgun not handle them. reason use clients domain in return-path address can assign right account. encode way...

in fact, setting mailbox bounces on google apps mail, recieved 1 such delayed bounce.

it email made proper debugging possible lead understanding of issue.

so sum up:

yes, address incorrect. no problem bounces since server not use mx records send them, sends them directly server has initated conneciton.

however in case of delayed bounces, times happen, bounce indeed go server behind mx records of domain specified in return path address.

those emails not recognised bounces @ mailgun servers.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -