Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Mar 20, 2010 5:42 am 
Offline
Newbie

Joined: Sat Jul 18, 2009 8:02 am
Posts: 4
Website: http://hisamudd.in
Location: kerala,India
i'm trying to parse all the incoming mails on postfix using a php script. After a lot of research on the irc linode, postfix channels and Google, i came to know that i will have to play with the /etc/aliases file.

I added the line-- his: "| /var/www/his/goompare/ml.php" --(ml.php inserts value into my mysql database and his@gotranz.com being the email id) , but nothing happened. After some more research i found out that it could be because i was using a virtual mail box as i was creating accounts by entering values into my MySql database. So i replaced "his" with "vmail" which is the user i created for postfix. Still it doesnt work.

I think i'm almost there, but is getting it wrong somewhere. Please help! :(

_________________
<3 hisam

i would love to change the world, but they wont gimme the source code. ;)


Top
   
 Post subject:
PostPosted: Sat Mar 20, 2010 9:27 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Anything interesting in postfix's mail log?


Top
   
 Post subject:
PostPosted: Sat Mar 20, 2010 9:34 am 
Offline
Newbie

Joined: Sat Jul 18, 2009 8:02 am
Posts: 4
Website: http://hisamudd.in
Location: kerala,India
nothing regarding this in the mail log, no errors, nothing.

_________________
<3 hisam



i would love to change the world, but they wont gimme the source code. ;)


Top
   
 Post subject:
PostPosted: Sat Mar 20, 2010 11:48 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Hmmm, nothing at all appears in the mail log when you e-mail his@gotranz.com? That probably means your Postfix isn't getting the e-mail at all (or that logging is broken). That's weird.

In your setup, how would you add a "normal" e-mail address under the gotranz.com domain? There's a couple different ways to handle that, and /etc/aliases might not be where it's looking for gotranz.com stuff. (Also, you have run "newaliases", right?)


Top
   
 Post subject:
PostPosted: Sat Mar 20, 2010 2:36 pm 
Offline
Junior Member

Joined: Mon Nov 21, 2005 4:23 pm
Posts: 46
This worked for me when I had a similar situation.

Create an alias on the virtual domain, in your case it could be something like:

his@gotranz.com hisgotranzcom

The name is not important and you don't even have to create a real mailbox for the user. Then on /etc/aliases create another alias, mapping the "local" hisgotranzcom user to the script:

hisgotranzcom: |/var/www/his/goompare/ml.php

I don't recall if it was absolutely necessary to remove the space between the pipe and the script path.


Top
   
 Post subject:
PostPosted: Sat Mar 20, 2010 3:12 pm 
Offline
Newbie

Joined: Sat Jul 18, 2009 8:02 am
Posts: 4
Website: http://hisamudd.in
Location: kerala,India
@hoopycat i add a new user by inserting values into the 'users' table in the Database 'Mail' in my mysql. Ya i did 'newaliases'.


@GrunkaLunka creating a new alias means adding hisgotranzcom to the table users in the Mail DB ??

_________________
<3 hisam



i would love to change the world, but they wont gimme the source code. ;)


Top
   
 Post subject:
PostPosted: Sat Mar 20, 2010 4:21 pm 
Offline
Junior Member

Joined: Mon Nov 21, 2005 4:23 pm
Posts: 46
I'm not entirely sure on how your setup with the database works, since I went the easy way and just went with regular files.

In theory, there must be a way to add two types of email addresses to the database, regular ones with an actual mailbox and others that just forward email to another address. You want to set up one of the latter ones, which will receive mail and forward it to the local user hisgotrazcom.

Hope that helps.


Top
   
 Post subject:
PostPosted: Sat Mar 20, 2010 6:32 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
The database method ends up pretty much like a /etc/postfix/virtual file, but in a database instead of a text file, so I think GrunkaLunka's idea will probably work out. :-)


Top
   
 Post subject:
PostPosted: Mon Mar 22, 2010 5:58 pm 
Offline
Newbie

Joined: Sat Jul 18, 2009 8:02 am
Posts: 4
Website: http://hisamudd.in
Location: kerala,India
still nt working. i added the alias hisam@gotranz.com hisamgotranzcom to my Forwardings table in my DB. changed /etc/aliases accordingly.

What is bothering me is that nothing ever has appeared in the mail log about /etc/aliases. i seriously doubt that /etc/aliases is nt being checked by postfix wen i recieve mails.

Also i get a failed deliver report, seems the forwarding isnt working..

" This is the mail system at host gotranz.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<hisgotranzcom@mail.gotranz.com> (expanded from <his@gotranz.com>): mail for
mail.gotranz.com loops back to myself "

_________________
<3 hisam



i would love to change the world, but they wont gimme the source code. ;)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group