Connecting Tech Pros Worldwide Forums | Help | Site Map

Using Php to receive - read email

Chuck Anderson
Guest
 
Posts: n/a
#1: Jul 17 '05
Can anyone point me in the right direction? I want to use Php to
automate confirmation of someone joining an email list by them replying
to an email (so they don't have to have a browser?).

I will probably use a hyperlink with a unique ID, but I also want to
know how to go about reading from a mailbox with Php so I can use an
email reply method, too.

I'm having trouble finding any kind of tutorial. From the bit of
searching I've done, it appears I need to use an IMAP client and the
IMAP functions (I've no experience with using IMAP, but could learn).

Can I use Php functions to read email from a POP3 mailbox?

Does anyone know of any tutorials or helpful web sites that might
explain what I need to do?

Thanks in Advance.

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************

R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Using Php to receive - read email


Chuck Anderson <websiteaddress@seemy.sig> wrote in message news:<cnn3c.529026$na.1267192@attbi_s04>...[color=blue]
> Can anyone point me in the right direction? I want to use Php to
> automate confirmation of someone joining an email list by them replying
> to an email (so they don't have to have a browser?).
>
> I will probably use a hyperlink with a unique ID, but I also want to
> know how to go about reading from a mailbox with Php so I can use an
> email reply method, too.
>
> I'm having trouble finding any kind of tutorial. From the bit of
> searching I've done, it appears I need to use an IMAP client and the
> IMAP functions (I've no experience with using IMAP, but could learn).
>
> Can I use Php functions to read email from a POP3 mailbox?
>
> Does anyone know of any tutorials or helpful web sites that might
> explain what I need to do?[/color]

1. forward file <http://groups.google.com/groups?selm=vppnnssuq4p394%40corp.supernews.com>
2. <http://in2.php.net/imap> Manual & user notes

--
"I don't believe in the God who doesn't give me food, but shows me
heaven!"--Swami Vivekanandha
Email: rrjanbiah-at-Y!com
Chuck Anderson
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Using Php to receive - read email


R. Rajesh Jeba Anbiah wrote:
[color=blue]
>Chuck Anderson <websiteaddress@seemy.sig> wrote in message news:<cnn3c.529026$na.1267192@attbi_s04>...[color=green]
>> Can anyone point me in the right direction? I want to use Php to
>> automate confirmation of someone joining an email list by them replying
>> to an email (so they don't have to have a browser?).
>>
>> I will probably use a hyperlink with a unique ID, but I also want to
>> know how to go about reading from a mailbox with Php so I can use an
>> email reply method, too.
>>
>> I'm having trouble finding any kind of tutorial. From the bit of
>> searching I've done, it appears I need to use an IMAP client and the
>> IMAP functions (I've no experience with using IMAP, but could learn).
>>
>> Can I use Php functions to read email from a POP3 mailbox?
>>
>> Does anyone know of any tutorials or helpful web sites that might
>> explain what I need to do?[/color]
>
> 1. forward file <http://groups.google.com/groups?selm=vppnnssuq4p394%40corp.supernews.com>
> 2. <http://in2.php.net/imap> Manual & user notes
>
>
>[/color]
I see. I can use the "IMAP" functions for POP3. Thanks for the pointer.
I can begin experimenting now.

(The first link is how I can have a new email trigger the event. That
will also be most useful.)

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************
CountScubula
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Using Php to receive - read email


Let me ask this, Are you trying to have PHP parse an email when it arrives?

If so, differnt aproach than trying to pop a box.

Also if you are using, say redhat linux:

in /etc/aliases file add this line:

alias-phpparse: "| /etc/smrsh/phpparser.php"


then in /etc/smrsh/ create a script called phpparser.php and it should look
like this:
(make sure the #!/.... is the very first line!)

#!/usr/bin/php -q
<?php
// read from stdin
$fd = fopen("php://stdin", "r");

// we read each line of the incoming email
while (!feof($fd))
{
$inData = fgets($fd, 1024);
$inData = trim($inData);

// we loop over and over untill we read each line
// proccess email here, $inData will contain 1 line from the email
on each pass


}
fclose($fd);
?>


--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
news:cnn3c.529026$na.1267192@attbi_s04...[color=blue]
> Can anyone point me in the right direction? I want to use Php to
> automate confirmation of someone joining an email list by them replying
> to an email (so they don't have to have a browser?).
>
> I will probably use a hyperlink with a unique ID, but I also want to
> know how to go about reading from a mailbox with Php so I can use an
> email reply method, too.
>
> I'm having trouble finding any kind of tutorial. From the bit of
> searching I've done, it appears I need to use an IMAP client and the
> IMAP functions (I've no experience with using IMAP, but could learn).
>
> Can I use Php functions to read email from a POP3 mailbox?
>
> Does anyone know of any tutorials or helpful web sites that might
> explain what I need to do?
>
> Thanks in Advance.
>
> --
> *****************************
> Chuck Anderson • Boulder, CO
> http://www.CycleTourist.com
> Integrity is obvious.
> The lack of it is common.
> *****************************[/color]


CountScubula
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Using Php to receive - read email


so sorry, I forgot 1 thing, add this line to /etc/mail/virtusertable

aname@yourdomain.com alais-phpparser

then rebuild the map with
cd /etc/mail
makemap hash virtusertable < virtusertable

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"CountScubula" <me@scantek.hotmail.com> wrote in message
news:H444c.22905$F15.499@newssvr29.news.prodigy.co m...[color=blue]
> Let me ask this, Are you trying to have PHP parse an email when it[/color]
arrives?[color=blue]
>
> If so, differnt aproach than trying to pop a box.
>
> Also if you are using, say redhat linux:
>
> in /etc/aliases file add this line:
>
> alias-phpparse: "| /etc/smrsh/phpparser.php"
>
>
> then in /etc/smrsh/ create a script called phpparser.php and it should[/color]
look[color=blue]
> like this:
> (make sure the #!/.... is the very first line!)
>
> #!/usr/bin/php -q
> <?php
> // read from stdin
> $fd = fopen("php://stdin", "r");
>
> // we read each line of the incoming email
> while (!feof($fd))
> {
> $inData = fgets($fd, 1024);
> $inData = trim($inData);
>
> // we loop over and over untill we read each line
> // proccess email here, $inData will contain 1 line from the[/color]
email[color=blue]
> on each pass
>
>
> }
> fclose($fd);
> ?>
>
>
> --
> Mike Bradley
> http://www.gzentools.com -- free online php tools
> "Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
> news:cnn3c.529026$na.1267192@attbi_s04...[color=green]
> > Can anyone point me in the right direction? I want to use Php to
> > automate confirmation of someone joining an email list by them replying
> > to an email (so they don't have to have a browser?).
> >
> > I will probably use a hyperlink with a unique ID, but I also want to
> > know how to go about reading from a mailbox with Php so I can use an
> > email reply method, too.
> >
> > I'm having trouble finding any kind of tutorial. From the bit of
> > searching I've done, it appears I need to use an IMAP client and the
> > IMAP functions (I've no experience with using IMAP, but could learn).
> >
> > Can I use Php functions to read email from a POP3 mailbox?
> >
> > Does anyone know of any tutorials or helpful web sites that might
> > explain what I need to do?
> >
> > Thanks in Advance.
> >
> > --
> > *****************************
> > Chuck Anderson . Boulder, CO
> > http://www.CycleTourist.com
> > Integrity is obvious.
> > The lack of it is common.
> > *****************************[/color]
>
>[/color]


Chuck Anderson
Guest
 
Posts: n/a
#6: Jul 17 '05

re: Using Php to receive - read email


CountScubula wrote:
[color=blue]
>Let me ask this, Are you trying to have PHP parse an email when it arrives?
>
>[/color]
That's what I'd like to do.
[color=blue]
>If so, differnt aproach than trying to pop a box.
>
>[/color]
I assume you are talking about having new a new email trigger an event
(parse the email), and that I could still do the same manually or with a
task scheduler using IMAP functions.

Yes?
[color=blue]
>Also if you are using, say redhat linux:
>
>[/color]
My site is on a Linux server, but I don't even have shell access. I'll
keep your suggestion, though, because I *can* get shell access. It
sounds like what I want to do is no simple thing (at least for me).
[color=blue]
>in /etc/aliases file add this line:
>
>alias-phpparse: "| /etc/smrsh/phpparser.php"
>
>
>then in /etc/smrsh/ create a script called phpparser.php and it should look
>like this:
>(make sure the #!/.... is the very first line!)\
>
>[/color]
Gotcha - tells the php "interpreter" to read the following lines.
[color=blue]
>#!/usr/bin/php -q
><?php
> // read from stdin
> $fd = fopen("php://stdin", "r");
>
> // we read each line of the incoming email
> while (!feof($fd))
> {
> $inData = fgets($fd, 1024);
> $inData = trim($inData);
>
> // we loop over and over untill we read each line
> // proccess email here, $inData will contain 1 line from the email
>on each pass
>
>
> }
> fclose($fd);
>?>
>
>
>[/color]
That added line in your next post is quite key to understanding how this
works, right?
"aname@yourdomain.com alias-phpparser"

Thanks for the help.
[color=blue]
>--
>Mike Bradley
>http://www.gzentools.com -- free online php tools
>"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
>news:cnn3c.529026$na.1267192@attbi_s04...[color=green]
>> Can anyone point me in the right direction? I want to use Php to
>> automate confirmation of someone joining an email list by them replying
>> to an email (so they don't have to have a browser?).
>>
>> I will probably use a hyperlink with a unique ID, but I also want to
>> know how to go about reading from a mailbox with Php so I can use an
>> email reply method, too.
>>
>> I'm having trouble finding any kind of tutorial. From the bit of
>> searching I've done, it appears I need to use an IMAP client and the
>> IMAP functions (I've no experience with using IMAP, but could learn).
>>
>> Can I use Php functions to read email from a POP3 mailbox?
>>
>> Does anyone know of any tutorials or helpful web sites that might
>> explain what I need to do?
>>
>> Thanks in Advance.
>>
>> --
>> *****************************
>> Chuck Anderson • Boulder, CO
>> http://www.CycleTourist.com
>> Integrity is obvious.
>> The lack of it is common.
>> *****************************[/color]
>
>
>
>[/color]


--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************
CountScubula
Guest
 
Posts: n/a
#7: Jul 17 '05

re: Using Php to receive - read email


I guess I should have exmplained how it works.

This is a way to have an email, upon arrival, get passed to your php script
instead of proccessed and put into a mailbox. if you wish to save a copy or
have it end up in the correct mailbox, then you need to do that yourself.

This is good for autoreplies, or email request systems (like fax back)


this part[color=blue]
> add line to /etc/mail/virtusertable
>aname@yourdomain.com alias-phpparser
>
>then rebuild the map with
>cd /etc/mail
>makemap hash virtusertable < virtusertable[/color]

adds an email address to the mail server, so anything comming to that email
address would go to user alias-phpparser (since this file only maps email
address to user accounts we map to an alias user)

here we add the alias user, in, well /etc/alias file, this file allows alias
user accounts, these can map to other users, single or more, or can forward
mail to a script. generaly the scripts sit in /etc/smrsh
[color=blue]
>so in /etc/alias file we add the line
>alias-phpparser: "| /etc/smrsh/phpparser.php"[/color]

this tells the box the alias-phpparser is an alias, and to filter the mail
to the script

then in /etc/smrsh/ we put scripts that get passed emails from sendmail,
smrsh is SendMail Retricted SHell, this should be the only dir that sendmail
should be allowed to run scripts.
[color=blue]
>so, in /etc/smrsh/ dir we add the script
>alias-phpparser.php
>also this file needs to be chmod 755[/color]
#!/usr/bin/php -q
<?php
// read from stdin
$fd = fopen("php://stdin", "r");

// we read each line of the incoming email
while (!feof($fd))
{
$inData = fgets($fd, 1024);
$inData = trim($inData);

// we loop over and over untill we read each line
// proccess email here, $inData will contain 1 line from the email
on each pass

}
fclose($fd);
?>



--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
news:f584c.10276$i76.158609@attbi_s03...[color=blue]
> CountScubula wrote:
>[color=green]
> >Let me ask this, Are you trying to have PHP parse an email when it[/color][/color]
arrives?[color=blue][color=green]
> >
> >[/color]
> That's what I'd like to do.
>[color=green]
> >If so, differnt aproach than trying to pop a box.
> >
> >[/color]
> I assume you are talking about having new a new email trigger an event
> (parse the email), and that I could still do the same manually or with a
> task scheduler using IMAP functions.
>
> Yes?
>[color=green]
> >Also if you are using, say redhat linux:
> >
> >[/color]
> My site is on a Linux server, but I don't even have shell access. I'll
> keep your suggestion, though, because I *can* get shell access. It
> sounds like what I want to do is no simple thing (at least for me).
>[color=green]
> >in /etc/aliases file add this line:
> >
> >alias-phpparse: "| /etc/smrsh/phpparser.php"
> >
> >
> >then in /etc/smrsh/ create a script called phpparser.php and it should[/color][/color]
look[color=blue][color=green]
> >like this:
> >(make sure the #!/.... is the very first line!)\
> >
> >[/color]
> Gotcha - tells the php "interpreter" to read the following lines.
>[color=green]
> >#!/usr/bin/php -q
> ><?php
> > // read from stdin
> > $fd = fopen("php://stdin", "r");
> >
> > // we read each line of the incoming email
> > while (!feof($fd))
> > {
> > $inData = fgets($fd, 1024);
> > $inData = trim($inData);
> >
> > // we loop over and over untill we read each line
> > // proccess email here, $inData will contain 1 line from the[/color][/color]
email[color=blue][color=green]
> >on each pass
> >
> >
> > }
> > fclose($fd);
> >?>
> >
> >
> >[/color]
> That added line in your next post is quite key to understanding how this
> works, right?
> "aname@yourdomain.com alias-phpparser"
>
> Thanks for the help.
>[color=green]
> >--
> >Mike Bradley
> >http://www.gzentools.com -- free online php tools
> >"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
> >news:cnn3c.529026$na.1267192@attbi_s04...[color=darkred]
> >> Can anyone point me in the right direction? I want to use Php to
> >> automate confirmation of someone joining an email list by them replying
> >> to an email (so they don't have to have a browser?).
> >>
> >> I will probably use a hyperlink with a unique ID, but I also want to
> >> know how to go about reading from a mailbox with Php so I can use an
> >> email reply method, too.
> >>
> >> I'm having trouble finding any kind of tutorial. From the bit of
> >> searching I've done, it appears I need to use an IMAP client and the
> >> IMAP functions (I've no experience with using IMAP, but could learn).
> >>
> >> Can I use Php functions to read email from a POP3 mailbox?
> >>
> >> Does anyone know of any tutorials or helpful web sites that might
> >> explain what I need to do?
> >>
> >> Thanks in Advance.
> >>
> >> --
> >> *****************************
> >> Chuck Anderson • Boulder, CO
> >> http://www.CycleTourist.com
> >> Integrity is obvious.
> >> The lack of it is common.
> >> *****************************[/color]
> >
> >
> >
> >[/color]
>
>
> --
> *****************************
> Chuck Anderson • Boulder, CO
> http://www.CycleTourist.com
> Integrity is obvious.
> The lack of it is common.
> *****************************[/color]


Chuck Anderson
Guest
 
Posts: n/a
#8: Jul 17 '05

re: Using Php to receive - read email


CountScubula wrote:
[color=blue]
>I guess I should have exmplained how it works.
>
>This is a way to have an email, upon arrival, get passed to your php script
>instead of proccessed and put into a mailbox.
>[/color]
That *is* what I ultimately want to do.
[color=blue]
>This is good for autoreplies, or email request systems (like fax back)
>
>[/color]
Or to automate subscription to a mailing list.
[color=blue]
>
>this part[color=green]
>> add line to /etc/mail/virtusertable
>>aname@yourdomain.com alias-phpparser
>>
>>then rebuild the map with
>>cd /etc/mail
>>makemap hash virtusertable < virtusertable[/color]
>
>adds an email address to the mail server, so anything comming to that email
>address would go to user alias-phpparser (since this file only maps email
>address to user accounts we map to an alias user)
>
>here we add the alias user, in, well /etc/alias file, this file allows alias
>user accounts, these can map to other users, single or more, or can forward
>mail to a script. generaly the scripts sit in /etc/smrsh
>[color=green]
>>so in /etc/alias file we add the line
>>alias-phpparser: "| /etc/smrsh/phpparser.php"[/color]
>
>this tells the box the alias-phpparser is an alias, and to filter the mail
>to the script
>
>then in /etc/smrsh/ we put scripts that get passed emails from sendmail,
>smrsh is SendMail Retricted SHell, this should be the only dir that sendmail
>should be allowed to run scripts.
>[color=green]
>>so, in /etc/smrsh/ dir we add the script
>>alias-phpparser.php
>>also this file needs to be chmod 755[/color]
>#!/usr/bin/php -q
><?php
> // read from stdin
> $fd = fopen("php://stdin", "r");
>
> // we read each line of the incoming email
> while (!feof($fd))
> {
> $inData = fgets($fd, 1024);
> $inData = trim($inData);
>
> // we loop over and over untill we read each line
> // proccess email here, $inData will contain 1 line from the email
>on each pass
>
> }
> fclose($fd);
>?>
>
>
>
>--
>Mike Bradley
>http://www.gzentools.com -- free online php tools
>"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
>news:f584c.10276$i76.158609@attbi_s03...[color=green]
>> CountScubula wrote:
>>[color=darkred]
>> >Let me ask this, Are you trying to have PHP parse an email when it[/color][/color]
>arrives?[color=green][color=darkred]
>> >
>> >[/color]
>> That's what I'd like to do.
>>[color=darkred]
>> >If so, differnt aproach than trying to pop a box.
>> >
>> >[/color]
>> I assume you are talking about having new a new email trigger an event
>> (parse the email), and that I could still do the same manually or with a
>> task scheduler using IMAP functions.
>>
>> Yes?
>>[color=darkred]
>> >Also if you are using, say redhat linux:
>> >
>> >[/color]
>> My site is on a Linux server, but I don't even have shell access. I'll
>> keep your suggestion, though, because I *can* get shell access. It
>> sounds like what I want to do is no simple thing (at least for me).
>>[color=darkred]
>> >in /etc/aliases file add this line:
>> >
>> >alias-phpparse: "| /etc/smrsh/phpparser.php"
>> >
>> >
>> >then in /etc/smrsh/ create a script called phpparser.php and it should[/color][/color]
>look[color=green][color=darkred]
>> >like this:
>> >(make sure the #!/.... is the very first line!)\
>> >
>> >[/color]
>> Gotcha - tells the php "interpreter" to read the following lines.
>>[color=darkred]
>> >#!/usr/bin/php -q
>> ><?php
>> > // read from stdin
>> > $fd = fopen("php://stdin", "r");
>> >
>> > // we read each line of the incoming email
>> > while (!feof($fd))
>> > {
>> > $inData = fgets($fd, 1024);
>> > $inData = trim($inData);
>> >
>> > // we loop over and over untill we read each line
>> > // proccess email here, $inData will contain 1 line from the[/color][/color]
>email[color=green][color=darkred]
>> >on each pass
>> >
>> >
>> > }
>> > fclose($fd);
>> >?>
>> >
>> >
>> >[/color]
>> That added line in your next post is quite key to understanding how this
>> works, right?
>> "aname@yourdomain.com alias-phpparser"
>>
>> Thanks for the help.
>>[color=darkred]
>> >--
>> >Mike Bradley
>> >http://www.gzentools.com -- free online php tools
>> >"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
>> >news:cnn3c.529026$na.1267192@attbi_s04...
>> >> Can anyone point me in the right direction? I want to use Php to
>> >> automate confirmation of someone joining an email list by them replying
>> >> to an email (so they don't have to have a browser?).
>> >>
>> >> I will probably use a hyperlink with a unique ID, but I also want to
>> >> know how to go about reading from a mailbox with Php so I can use an
>> >> email reply method, too.
>> >>
>> >> I'm having trouble finding any kind of tutorial. From the bit of
>> >> searching I've done, it appears I need to use an IMAP client and the
>> >> IMAP functions (I've no experience with using IMAP, but could learn).
>> >>
>> >> Can I use Php functions to read email from a POP3 mailbox?
>> >>
>> >> Does anyone know of any tutorials or helpful web sites that might
>> >> explain what I need to do?
>> >>
>> >> Thanks in Advance.
>> >>[/color][/color]
>[/color]


--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#9: Jul 17 '05

re: Using Php to receive - read email


"CountScubula" <me@scantek.hotmail.com> wrote in message news:<h5a4c.23096$Gv1.18707@newssvr29.news.prodigy .com>...[color=blue]
> I guess I should have exmplained how it works.
>
> This is a way to have an email, upon arrival, get passed to your php script
> instead of proccessed and put into a mailbox. if you wish to save a copy or
> have it end up in the correct mailbox, then you need to do that yourself.
>
> This is good for autoreplies, or email request systems (like fax back)
>
>
> this part[color=green]
> > add line to /etc/mail/virtusertable
> >aname@yourdomain.com alias-phpparser
> >
> >then rebuild the map with
> >cd /etc/mail
> >makemap hash virtusertable < virtusertable[/color]
>
> adds an email address to the mail server, so anything comming to that email
> address would go to user alias-phpparser (since this file only maps email
> address to user accounts we map to an alias user)
>
> here we add the alias user, in, well /etc/alias file, this file allows alias
> user accounts, these can map to other users, single or more, or can forward
> mail to a script. generaly the scripts sit in /etc/smrsh
>[color=green]
> >so in /etc/alias file we add the line
> >alias-phpparser: "| /etc/smrsh/phpparser.php"[/color]
>
> this tells the box the alias-phpparser is an alias, and to filter the mail
> to the script[/color]

I'm not a *nix expert. But, this link
<http://forums.devshed.com/t64071/s.html> says forward file is better
than aliases file. Do you have any comment on it?

--
"I don't believe in the God who doesn't give me food, but shows me
heaven!"--Swami Vivekanandha
Email: rrjanbiah-at-Y!com
CountScubula
Guest
 
Posts: n/a
#10: Jul 17 '05

re: Using Php to receive - read email


Well to use a forward file, you must add a user to the linux box, so then
there actualy is a new user account. you can leave it as no password so no
one uses the account.

Then in that users /home/dir you create a '.forward' file, and stick in
email addresses, one per line. Sorta like a mini mailing list.

Draw backs to me, are for simple 1,2,3 email forwards this consumes a
userid, and requires a user in the /home

On my mail servers, there are only a hand full of /home/dir's and they are
for me, and whom ever is assisting me, the general users have no /home/dir
on any of my servers

Now the alias file, is as it is called, but for user accounts, you create
alias user names, and then point to real users (not email address),
although, it can forward to email addresses.
these are valid entries

owner: root
admins: root, john, jane, joe@otherplace.com
some-script: root, "|/etc/smrsh/script.php"
filter: "|/etc/smrsh/filter.php"


Then is the /etc/virtusertable file, this file maps email addresses to user
accounts. you can also forward email from here.
here are valid entries:

john@mydomain.com john
info@mydomain.com john

noreturn@mydomain.com filter

sam@domain.com sam@otherdomain.com

@domain.com error 550: Sorry, invalid user.


So IMHO, I use as follows:
/etc/alias to set up filter scripts.
/etc/virtusertable to map emails to user names
..forward for mini distribution lists


--
Mike Bradley
http://www.gzentools.com -- free online php tools
"R. Rajesh Jeba Anbiah" <ng4rrjanbiah@rediffmail.com> wrote in message
news:abc4d8b8.0403120318.2b89fadc@posting.google.c om...[color=blue]
> "CountScubula" <me@scantek.hotmail.com> wrote in message[/color]
news:<h5a4c.23096$Gv1.18707@newssvr29.news.prodigy .com>...[color=blue][color=green]
> > I guess I should have exmplained how it works.
> >
> > This is a way to have an email, upon arrival, get passed to your php[/color][/color]
script[color=blue][color=green]
> > instead of proccessed and put into a mailbox. if you wish to save a copy[/color][/color]
or[color=blue][color=green]
> > have it end up in the correct mailbox, then you need to do that[/color][/color]
yourself.[color=blue][color=green]
> >
> > This is good for autoreplies, or email request systems (like fax back)
> >
> >
> > this part[color=darkred]
> > > add line to /etc/mail/virtusertable
> > >aname@yourdomain.com alias-phpparser
> > >
> > >then rebuild the map with
> > >cd /etc/mail
> > >makemap hash virtusertable < virtusertable[/color]
> >
> > adds an email address to the mail server, so anything comming to that[/color][/color]
email[color=blue][color=green]
> > address would go to user alias-phpparser (since this file only maps[/color][/color]
email[color=blue][color=green]
> > address to user accounts we map to an alias user)
> >
> > here we add the alias user, in, well /etc/alias file, this file allows[/color][/color]
alias[color=blue][color=green]
> > user accounts, these can map to other users, single or more, or can[/color][/color]
forward[color=blue][color=green]
> > mail to a script. generaly the scripts sit in /etc/smrsh
> >[color=darkred]
> > >so in /etc/alias file we add the line
> > >alias-phpparser: "| /etc/smrsh/phpparser.php"[/color]
> >
> > this tells the box the alias-phpparser is an alias, and to filter the[/color][/color]
mail[color=blue][color=green]
> > to the script[/color]
>
> I'm not a *nix expert. But, this link
> <http://forums.devshed.com/t64071/s.html> says forward file is better
> than aliases file. Do you have any comment on it?
>
> --
> "I don't believe in the God who doesn't give me food, but shows me
> heaven!"--Swami Vivekanandha
> Email: rrjanbiah-at-Y!com[/color]


Tim Van Wassenhove
Guest
 
Posts: n/a
#11: Jul 17 '05

re: Using Php to receive - read email


On 2004-03-12, CountScubula <me@scantek.hotmail.com> wrote:[color=blue]
> Well to use a forward file, you must add a user to the linux box, so then
> there actualy is a new user account. you can leave it as no password so no
> one uses the account.[/color]

procmail is your friend ;)

--
http://home.mysth.be/~timvw
CountScubula
Guest
 
Posts: n/a
#12: Jul 17 '05

re: Using Php to receive - read email


"Tim Van Wassenhove" <euki@pi.be> wrote in message
news:c2t4m6$20ttd2$2@ID-188825.news.uni-berlin.de...[color=blue]
> On 2004-03-12, CountScubula <me@scantek.hotmail.com> wrote:[color=green]
> > Well to use a forward file, you must add a user to the linux box, so[/color][/color]
then[color=blue][color=green]
> > there actualy is a new user account. you can leave it as no password so[/color][/color]
no[color=blue][color=green]
> > one uses the account.[/color]
>
> procmail is your friend ;)
>
> --
> http://home.mysth.be/~timvw[/color]


I agree with you here, and it could be simpler, one procmail entry and you
could be off and running, but I have seen to many people screw up *all* the
email on a system from a bad entry.

--
Mike Bradley
http://www.gzentools.com -- free online php tools


R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#13: Jul 17 '05

re: Using Php to receive - read email


"CountScubula" <me@scantek.hotmail.com> wrote in message news:<zmn4c.9326$ir7.4513@newssvr27.news.prodigy.c om>...

<some rational explanations snipped>
[color=blue]
> So IMHO, I use as follows:
> /etc/alias to set up filter scripts.
> /etc/virtusertable to map emails to user names
> .forward for mini distribution lists[/color]

Indeed a very useful post.

--
"Democracy: Where all citizens are politicians and all politicians are citizens"
Email: rrjanbiah-at-Y!com
Closed Thread