pilif.ch - a cuwps

[home]
stuff
some worldwide unique stuff
  • Daily Strips
  • PersistentHandler
  • Denis' Birthday
  • DVD-Region (1)
  • DVD-Region (2)
  • Defeating Miguel
  • Neuronal Interface ;-)
  • Swiss ADSL Check
  • Autodestructing Email
  • Fun with bounces

  • Introduction
  • Theory
  • Solution
  • The MTA
  • Code
  • Conclusion
  • backstage
    backstage-reports of some of my paid projects
  • bookexchange.ch
  • info
    valuable information for my visitors
  • RasInTask
  •  
    a possible way
    Now that you have leraned about envelopes and headers, it's time to put it together: Wenn we want to be notified on bounce-messages, we'll have to do something with the message envelope since the MTA will never look at the header itself.

    On the other hand: You may do whatever you want with the envelope, and can still have usable information in the message-header. This is the idea behind the tutorial here: We will create some sort of a special Envelope-From that is used when sending the bounce, but we will still have the normal From-Header for our uses that recieved the mail and are hitting the "Reply"-Button of their mailclient.

    With this, the theoretical part of the tutorial is finished. That's all the magic. All I'm doing now is to explain you, how I solved the problem in my particular enviroment. If you don't like the tools used here, follow the steps below with the tools of your choice.

    sending a mail and receiving the bounce
    My webapplication did the following steps:
    1. The Email with the statistics for the user was generated (another interesting topic for another tutorial; sending customized mass-mailings with PHP isn't that simple)
    2. The Mails was passed to the exim-MTA with a faked envelope-From-Header. It's user-Part of the address was something that could
      • be determined as bouncing mail
      • be used to read the address of the receiver from it
    3. Whenever one of the messages bounced, my local Exim would detect the mail to be a bounce by reading the style of the user-part of the address. It then would pass the whole message to some script.
    4. The script read the mail (without the encoded To-Address in the faked Envelope-From it would have to parse the bounce-Message generated, but with my solution it just has to decode the Email-Address that was used when sending the message in the first place) to get the failed address and flagged it in the database.
    5. The web-application read that flag from the database and notified the user on the bounce on her next logon to the system.
    If you can follow theese steps, you will not need to follow this tutorial any furhter since it will only describe the particular solution I used at my site (that is possibly and hopefully going open-source some time)


    © 2003 by pilif. cuwps stands for completely useless webpage and is a non-registered non-trademark by pilif - Last Modification: 04/03/01 at 14:05:00