SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bounced Email Script

    I am looking to automate some tasks that are to be performed when an email sent by PHP is bounced. Here are some questions that come to mind.

    1) How do I set the return path to be a certain user other than nobody which php is running as? (Actually this is not necessary for this task as it would not matter that the mail is bounced into the "nobody" user mailbox. - but I would like to know )

    2) I know that sitepoint and webhostingtalk have both done member audits - so I am guessing that vbulletin has created a similar solution. Does anybody know of any scripts available that I could look at?

    3) Here is how I am planning to solve the problem. Let me know if there is an easier way

    Sendmail receives the bounced email. In my alias table I have an entry for user "nobody" which will pipe the email to a php script. (I have installed php as a stand alone binary because I have yet to learn another scripting language such as python ). The script receives the bounced email as a command line arguement and I can work out who the original recipient was and do my do-da from there.

    <<edit>>

    Just as a followup. I have created an alias in the aliases file for sendmail that pipes the email to a script. eg

    nobody: |/path/to/script/bouncedmail

    I've tested the script and it works, no bugs. It has permissions of 0755. However, sendmail reports these errors:
    smrsh: bouncedmail not available for sendmail programs
    554 5.0.0 |/path/to/script/bouncedmail... Service unavailable
    Arggg!

    <<edit>>

    OK, well I fixed the above problem by placing the script in the directory path /etc/smrsh

    Now my problem is that the only arguement being passed to the script is the script's name. I am trying to get sendmail to pipe the whole email. Any ideas?

    <<edit>>

    Well, I've now pretty much worked it out for myself. There goes my Sunday In php you have to open the stdin file like so "php://stdin". I don't know why I didn't post this in the PHP forum
    Last edited by freakysid; Jun 9, 2001 at 23:40.

  2. #2
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I've learnt loads just by reading your question

  3. #3
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Bounced Email Script

    Originally posted by freakysid
    2) I know that sitepoint and webhostingtalk have both done member audits - so I am guessing that vbulletin has created a similar solution. Does anybody know of any scripts available that I could look at?
    vBulletin gives you two ways to email members - you can email them directly through the Admin CP, or you can generate a mailing list of all your members that meet certain criteria (or just a list of the whole lot of them ). I don't know which way SPF and WHT did it, but I would guess the second one as it is probably less server-intensive to send email outside of PHP than within PHP.
    Kevin


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •