[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: mail processing



In case u want to pass the incoming mail to a shell/perl script, say called
"script_file" , try using:
"|  /bin/sh /path/to/script_file arguments" in ur .forward file (safely assuming
that /bin contains sh). This should work.

If the main purpose of ur program is filtering, etc it's may be a good idea to
use procmail in which case you may use:
"| procmail"  in the .forward file
and add ur recipes to the .procmailrc file. Since it's already got a lot of
useful built-in features, it may fulfill ur requirements : )

-Sridhar


> I have a problem in forwarding  mails to a program. I want to (automatic)
> process the incoming mails by forwarding it to a program. I tried the
> following
>
> I put the following the .forward file in the home dir of the user and sent a
> mail to the user.
>
> "| /path/to/program ARG"
>
> It is notworking and the mail is bounced to postmaster/Mailer-daemon . The
> error message is, the program is not availble for sendmail programs.
>
> When i commented the .forwared file, the mail reaches /var/spool/mail/USER.
>
> But when I use  from the command line it is working
>
> /path/to/program ARG < mail contents
>
> Can any one help me in this. How to make the .forward to work?
>


------------------------------