GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Help - piping email to PHP program. (https://gfy.com/showthread.php?t=1016299)

camperjohn64 03-29-2011 07:04 PM

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?

http://img151.imageshack.us/img151/1892/postfix2.jpg

- 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..
http://img25.imageshack.us/img25/1584/procmail.jpg

I have one day to figure this out, it's a small detail and I'm sure I'm missing something.

Babaganoosh 03-30-2011 07:25 AM

Are you actually receiving emails at [email protected]?

camperjohn64 03-30-2011 11:09 AM

Quote:

Originally Posted by Babaganoosh (Post 18014114)
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.

Babaganoosh 04-01-2011 09:40 AM

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.

k0nr4d 04-01-2011 10:45 AM

alternatively you can have php check a pop3 email account with a catchall configured. There are classes available that do this for you.

camperjohn64 04-01-2011 07:32 PM

Quote:

Originally Posted by Babaganoosh (Post 18020377)
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.


All times are GMT -7. The time now is 02:33 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123