[plug] Receiving emails to a script

Ryan ryan at is.as.geeky.as
Tue Apr 6 16:10:57 WST 2004

On Tue, 2004-04-06 at 16:11, Randal Adamson wrote:
> Hi,
> Has anyone played with receiving emails into a script? I am after some
> pointers. I hope to do a script in Perl. From what I can gather I need
> to run it in the ~/.forward file with some code like this:
> |/path/to/my/script.pl
> Looking thru my O'Reilly Sendmail book - they talk about something
> called smrsh - and that sendmail has locked down users from using the
> .forward file. Which probably has something to do with why I can't get
> mine to work properly.

You need to symlink to the executables allowed to run from .forward
files in /etc/mail/smrsh, mine looks like this (i've added the vacation
one myself):

lrwxrwxrwx    1 root     root           26 May 18  2003 mail.local ->
lrwxrwxrwx    1 root     root           28 May 18  2003 sensible-mda ->
lrwxrwxrwx    1 root     root           17 Jul  2  2003 vacation ->

Make you own script and use the forward file as you showed and you'll
have the mail rolling in.  Sendmail will log the fact that mail has been
redirected by the .forward file and also log any errors with it.


More information about the plug mailing list