Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

A Question about Email

Options
  • 12-08-2009 11:21pm
    #1
    Closed Accounts Posts: 48


    Not sure if this is the best place for this, mods feel free to move.

    My younger brother was working on a web interface and teaching himself some PHP. One of the scripts he wrote can send emails to a target address (his own). On the website he simply captures the senders Name, Email Address (for reply), Subject, Body, etc. Then sends this info to the script and it bangs off an email with the provided info as the sender. Essentially the script is spoofing the senders email and sending mail to my bro's email account. This sort of script is used up and down the web on many many websites as you know as a contact form. Now he's new to all this stuff, but he got this script working.

    Here comes the problem. He was showing it to one of his mates, and his mate filled in the form with fictitious information and submitted. My younger bro didn't think anything of it at the time, until one of the email's didn't arrive in his account. So he gave me a call and asked me why.

    The email address that his mate entered may or may not be legitimate, but what he did say was that it was something like [email]username@word1_word2.ie[/email]. First thing I spotted was that the underscore character made the domain name invalid so it couldn't have existed, but the domain word1word2.ie does exist. Anyway I told him to stop messing about, because I'm not sure if [email]username@word1_word2.ie[/email] could default to username@word1word2.ie and end up in a catch all environment for the email @ that domain. Alternatively would SMTP simply bomb out and the message just disappear in to oblivion.

    I never really thought about what happens to mail when the sender address is invalid, and I'd be curious to know what happens in this case as the message never arrived at his email account.

    As you can see this isn't so much a question about programming but rather a general question about email and what it would do in the case of the above scenario.


Comments

  • Moderators, Science, Health & Environment Moderators Posts: 10,076 Mod ✭✭✭✭marco_polo


    ontheway wrote: »
    Not sure if this is the best place for this, mods feel free to move.

    My younger brother was working on a web interface and teaching himself some PHP. One of the scripts he wrote can send emails to a target address (his own). On the website he simply captures the senders Name, Email Address (for reply), Subject, Body, etc. Then sends this info to the script and it bangs off an email with the provided info as the sender. Essentially the script is spoofing the senders email and sending mail to my bro's email account. This sort of script is used up and down the web on many many websites as you know as a contact form. Now he's new to all this stuff, but he got this script working.

    Here comes the problem. He was showing it to one of his mates, and his mate filled in the form with fictitious information and submitted. My younger bro didn't think anything of it at the time, until one of the email's didn't arrive in his account. So he gave me a call and asked me why.

    The email address that his mate entered may or may not be legitimate, but what he did say was that it was something like [email]username@word1_word2.ie[/email]. First thing I spotted was that the underscore character made the domain name invalid so it couldn't have existed, but the domain word1word2.ie does exist. Anyway I told him to stop messing about, because I'm not sure if [email]username@word1_word2.ie[/email] could default to username@word1word2.ie and end up in a catch all environment for the email @ that domain. Alternatively would SMTP simply bomb out and the message just disappear in to oblivion.

    I never really thought about what happens to mail when the sender address is invalid, and I'd be curious to know what happens in this case as the message never arrived at his email account.

    As you can see this isn't so much a question about programming but rather a general question about email and what it would do in the case of the above scenario.

    I see two posibilities, more likely It is could be that the Spam filter of his email provider discarded it. BTW nothing goes to the actual sender address just to your brothers email address. Alternatively since _ is an invalid domain name charachter perhaps it was indeed discared by SMTP server.

    It is hard to say without knowing the email provider and smtp server setups, there are a fair number of possibilities.


  • Registered Users Posts: 647 ✭✭✭ArseBurger


    In the communication with the SMTP server, the server will have presented back codes in it's response to the SMTP 'conversation'.

    He should capture these responses somewhere. He should use this as an example of why it is important to log the output of code.

    http://www.greenend.org.uk/rjk/2000/05/21/smtp-replies.html

    He should also make sure his script conforms to the SMTP protocol standards defined by IETF RFC's.


Advertisement