views:

39

answers:

2

Hi,

sometime due to wrong input from user side, mail bounce and did not reach the recipient. ( sent from google app engine.)

How to detect such email ?

edit: may be i was not clear in my question :

I want to know to which mail i have sent the mail which was return ( so that i may alert the user or delete the email id ). this is more related to how email bounce works. normally the bounce mail does not come exactly same as sent but with different information, is there any particular header or something there to know which email id was that ? ... i think i have figure out while writing these, i am keeping this question so it might help somebody.

i will simply mail from [email protected] and create a mail receive handler. :)

so one more question : what is the maximum length does app-engine ( or any mail server ) allows for email address ?

+1  A: 

Use one of your app's addresses as the from address ([email protected]) and register a handler for that address. Then, you can intercept and interpret any responses (automated or otherwise).

Nick Johnson
may be i was not clear in my question , i have modified it , thanks for your answer.
iamgopal
A: 

easiest is to encode an email address via base64 or simiar encoding and prefixed it to from address.

all address from [email protected] are valid email address for from in gae.

simply create a mail receive handler. decode the from string and get the email address to whom you send the email originally.

sad thing is maximum 64 character length allowed for local part. in that case storing email address in datastore and using its key as a local part to email can be a option.

iamgopal