Help - piping email to PHP program.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • camperjohn64
    Confirmed User
    • Feb 2005
    • 1531

    #1

    Help - piping email to PHP program.

    I need someone's help setting up a way to pipe incoming emails from *@uploads.mydomain.com to a php program

    The problem is, I don't know how to set up emails and subdomains in postfix through webmin. I don't know how to tell postfix to handle emails from a subdomain and the documentation is not doing as I expect.

    Once the uploads.mydomain.com subdomain is setup, I can handle getting it to the PHP script, I just don't know how to tell postfix to handle the domain, and the subdomain.

    Does anyone have experience with Webmin and postfix? Or even just postfix?



    - I am using procmail and postfix
    - I have set up the DNS to handle the subdomain uploads.mydomain.com
    - I have successfully gotton ALL emails to go to my php script (yay)

    - I am UNABLE to get emails from the SUBDOMAINS to go to my php script.

    Here is the successful "redirect to PHP script", but I don't know how to tell postfix to handle the main domain and subdomain. What is a postfix virtual domain? What is transport mapping? Are users considered to be aliases? Hmmm..


    I have one day to figure this out, it's a small detail and I'm sure I'm missing something.
    www.gimmiegirlproductions.com
  • Babaganoosh
    ♥♥♥ Likes Hugs ♥♥♥
    • Nov 2001
    • 15841

    #2
    Are you actually receiving emails at [email protected]?
    I like pie.

    Comment

    • camperjohn64
      Confirmed User
      • Feb 2005
      • 1531

      #3
      Originally posted by Babaganoosh
      Are you actually receiving emails at [email protected]?
      Yes. It will be something like [email protected]

      This will be for uploading from the iPhone/mobile.

      My old server had CPanel on it, and it was a point and click deal and it was working fine, but I didn't want to shell out $2000+ for Cpanel on the new server.

      You know something, I have all the configuration files from the old server. Where would I look to find out how to configure it? I'm a good programmer, and a lousy admin.
      www.gimmiegirlproductions.com

      Comment

      • Babaganoosh
        ♥♥♥ Likes Hugs ♥♥♥
        • Nov 2001
        • 15841

        #4
        Forgot all about this thread. Hope you got it going. If not try this

        check postfix main.cf and make sure your subdomain is listed. I think it needs to be defined in virtal_alias_domains. never tried it with a subdomain so not too sure on this

        /etc/postfix/virtual
        [email protected] babaganoosh

        then edit your /etc/aliases
        babaganoosh: "|/usr/bin/php -q /path/to/your/script"

        Then run the following commands
        postmap /etc/postfix/virtual
        /etc/init.d/postfix restart
        newaliases

        This works on Ubuntu 10.04

        Edit: You do not need to set up a system user for your alias.
        Last edited by Babaganoosh; 04-01-2011, 08:42 AM.
        I like pie.

        Comment

        • k0nr4d
          Confirmed User
          • Aug 2006
          • 9231

          #5
          alternatively you can have php check a pop3 email account with a catchall configured. There are classes available that do this for you.
          Mechanical Bunny Media
          Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

          Comment

          • camperjohn64
            Confirmed User
            • Feb 2005
            • 1531

            #6
            Originally posted by Babaganoosh
            Forgot all about this thread. Hope you got it going. If not try this

            check postfix main.cf and make sure your subdomain is listed. I think it needs to be defined in virtal_alias_domains. never tried it with a subdomain so not too sure on this

            /etc/postfix/virtual
            [email protected] babaganoosh

            then edit your /etc/aliases
            babaganoosh: "|/usr/bin/php -q /path/to/your/script"

            Then run the following commands
            postmap /etc/postfix/virtual
            /etc/init.d/postfix restart
            newaliases

            This works on Ubuntu 10.04

            Edit: You do not need to set up a system user for your alias.
            I am going to try this on the weekend and let you know how it goes. It's the last thing that is holding me back from my iPhone version of my website.
            www.gimmiegirlproductions.com

            Comment

            Working...