Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2002 19:19:06 +0100
From:      "Mxsmanic" <mxsmanic@hotmail.com>
To:        "Barry Byrne" <barry.byrne@wbtsystems.com>, "FreeBSD Questions" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Getting Perl scripts to work as mail filters
Message-ID:  <OE31qwso6EsEWo2q0LZ00004187@hotmail.com>
References:  <NCBBIAMNAKDKFJIIGNPKGEGLKHAA.barry.byrne@wbtsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
*** Well it looks like your script is being run - what should your script
do? ***

Heck, it's so simple I can list it here:

---
#!/usr/bin/perl

   while ($inputline = <STDIN>)
   {
      $inputline =~ s/18 Dec 2002/29 Dec 2013/;
      print STDOUT $inputline;
   }
---

The s/// stuff is just to give me some proof that the script saw the
message.  I'm not getting anything at all now, though.

I assumed that writing to STDOUT would somehow get the message delivered,
but maybe not.  But if that's not the way to get it delivered, what is?  The
sendmail manual is not at all clear on this.  I looked in sendmail.cf for
the name of some program to which perhaps I should pipe STDOUT in the
aliases file, but couldn't find anything.  When the aliases file does not
specify piping of messages to some special program, who normally delivers
them?

*** sendmail doesn't do anything with the STDOUT from your script. I'm nut
sure what you mean by 'delivers whatever comes out' - where would it deliver
it? ***

To my mailbox.  I want the script to see incoming messages just before they
get deposited in my mailbox on the server.  From what I can understand of
how this works, some program actually receives the messages from sendmail
(?) and deposits them in my /usr/home/$USER mailbox, which appears to be
just a simple text file (I can't find any reference giving the format of
that, either).

*** sendmail is should not be running as root (probably 'mailnull'). ***

It's running as root on my system.  I thought it _had_ to run as root (?);
doesn't it have to access mailboxes that have only 600 access or something?

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OE31qwso6EsEWo2q0LZ00004187>