On Tue, 27 Feb 2001 06:28, Jason wrote:
> Hi,
>
> I need a way to walk through mail headers and search for a specific
> string in the subject. If the message contains the string, it will be
> forwarded to a different account, otherwise it will trigger an
> autoresponse with a certain message to the sender. Does anyone have any
> infomation on doing this, or can point me where to start. I think the
> thing I'm caught up on is how I walk through the mail headers in the
> mail file (We are on FreeBSD). Thanks.
>
> Jason

Procmail should be able to do this for you?

But how are you actually dealing with the incoming mails? Are they being 
sent to the php script as they arrive from an alias or procmail, or are 
you attempting to parse the contents of the mail spool file for a 
particular user?

If it's the former, all you need to do is parse each line until you find 
the one beginning with Subject and do the necessary.

If the latter, you'll need to check the relevant RFCs to determine how 
messages are separated in the spool, and how the body of the message is 
separated from the headers - I'm fairly sure that's two newlines. RFC1822 
from memory?

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to