|
Posted by Gordon Burditt on 07/23/05 01:09
>> >"mail($To,$Subject,$Msg,$headers, '-f'.$returnaddress);
>> >
>> >where $returnaddress = your email. "
>>
>> this would not help as the action is not automated... try setting up
>> an account that will be monitored by a script:
>> On receving mail, remove sender's adress from database, also search
>> body for e-mail adresses and remove them.
>
>Okay, but, how does one set up a PHP script to monitor bounced email
>coming back to the account I've already set up? That's the part I have
>no idea how to do.
>
There are several approaches:
(1) If you have a system which supports it (e.g. Linux or UNIX using
sendmail, smail, Exim, etc.), you can forward mail received by a
user into a pipe by specifying this in a .forward file in the user's
home directory. The program (which could be written in just about
anything: standalone PHP, Perl, sh, C, or whatever) will be invoked
with the email text (including the headers) on stdin. Details of
what user the program will run as or what the current working
directory will be may vary. Whether or not the admin has turned
this off or not may vary also. It is up to the program to go
through the headers and body to figure out what to do with it.
(2) You could set up a cron job which periodically invokes a program
which polls a mailbox using POP3, IMAP, or just opens the mailbox
file directly. For example, fetchmail can be used to transfer the
mailbox contents to a local file. Then a program could look at
what came in. The host with the program doesn't have to be the same
host as the one with the mailbox, in the case of POP3 or IMAP polling.
Gordon L. Burditt
Navigation:
[Reply to this message]
|