Operating System - HP-UX
1846207 Members
4569 Online
110255 Solutions
New Discussion

Re: .forward to execute some script

 
PVR
Valued Contributor

.forward to execute some script

Hi

I have to execute some script when I receive a mail in HP-UX mbox. I sit possible through .forward file ?

Thanks in advance !
Don't give up. Try till success...
4 REPLIES 4
RikTytgat
Honored Contributor

Re: .forward to execute some script

Yes,

Start your .forward file with a | (pipe).

Also have a look at "man 5 aliases"

Regards,
Rik
Naveej.K.A
Honored Contributor

Re: .forward to execute some script

Yes,

You can use the redirector a.k.a pipe ( | )

For eg:

250 <"|/opt/majordomo/wrapper resend -l primary -h hpuxmail.xyz.hp.com primary-ooing"@hpuxmail.cup.xyz.com>

Regards,
Naveej
practice makes a man perfect!!!
PVR
Valued Contributor

Re: .forward to execute some script

Hi Friends

Thanks for your quick reply.

I didn't get you properly. I want to execute a script /opt/test/services.sh as soons as mail reaches the system from outside world.

Many Thanks
Pramod
Don't give up. Try till success...
Anthony Lennan
Valued Contributor

Re: .forward to execute some script

If you want to execute a script every time you receive a mail for a specific user you can put the following line in the /etc/mail/aliases file.

Example:

unix_mail_username : "/opt/test/script.sh",/var/mail/unix_mail_username

Regards,
Anthony