Re: how to trigger an action on email recieved
- From: rpnabar@xxxxxxxxx
- Date: Sat, 8 Dec 2007 02:37:50 -0800 (PST)
On Dec 7, 6:44 pm, Kees Theunissen <theun...@xxxxxxxx> wrote:
Robert M. Riches Jr. wrote:
On 2007-12-07, rpna...@xxxxxxxxx <rpna...@xxxxxxxxx> wrote:
Quick question:Is there any recipie I can impliment as a user.
Without invoking my root previlages. Second, my MTA seems to be
sendmail.(I think; any way to check?) So would the procmail recipies
above still work?
Procmail, used as a mail delivery agent, will run with the access
rights of the user receiving the message, and will use that users'
~/.procmailrc file.
See the manpages (procmail, procmailrc and procmailex) for further
details.
Depending on your MTA, you may be able to put an instruction
to pipe through procmail in your ~/.forward file.
All linux distributions I've seen so far (slackware, redhat,
fedora, debian) use procmail as the default local delivery agent
for sendmail.
To find your MTA, you might use your package manager to see
which of sendmail and/or postfix is installed.
This will depend on your package management system. I don't know
if Redhat would prevent the installation of several MTA's.
Dependency rules on a Debian system would prevent this. But in
theory there is nothing wrong if you install several MTA's
and 'activate' one of those by setting up some symlinks.
Such symlinks will be used anyway because sendmail has been
the de facto standard for a long time. Other MTA's will use
symlinks to alias themselves as 'sendmail' in order to supply
an uniform interface to the users of the system.
Follow those symlinks and just see what program they point to.
On my Slackware 12.0 system, with sendmail 8.14.1 installed
this shows:
kees@lankhmar:~$ ls -l `which sendmail`
lrwxrwxrwx 1 root root 18 2007-10-31 18:29 /usr/bin/sendmail ->
/usr/sbin/sendmail*
kees@lankhmar:~$ ls -l /usr/sbin/sendmail
-r-xr-sr-x 1 root smmsp 692804 2007-06-10 07:16 /usr/sbin/sendmail*
An easy test is to send a message to yourself on your workstation and
inspect the headers of the received message. Something like:
date | sendmail kees@localhost
This resulted in the following message:
From k...@xxxxxxxxxxxxxxxxxxxx Sat Dec 8 01:07:56 2007
Return-Path: <k...@xxxxxxxxxxxxxxxxxxxx>
X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08)
on lankhmar.remmin.home
X-Spam-Level:
X-Spam-Status: No, score=-0.1 required=5.0
tests=ALL_TRUSTED,AWL,BAYES_00,
MISSING_HEADERS,MISSING_SUBJECT autolearn=no version=3.2.3
Received: from lankhmar.remmin.home (IDENT:1000@localhost [127.0.0.1])
by lankhmar.remmin.home (8.14.1/8.14.1)
with ESMTP id lB807usY024821
for <k...@xxxxxxxxxxxxxxxxxxxx>; Sat, 8 Dec 2007 01:07:56 +0100
Received: (from kees@localhost)
by lankhmar.remmin.home (8.14.1/8.14.1/Submit) id lB807uPP024820
for kees@localhost; Sat, 8 Dec 2007 01:07:56 +0100
Date: Sat, 8 Dec 2007 01:07:56 +0100
From: Kees Theunissen <k...@xxxxxxxxxxxxxxxxxxxx>
Message-Id: <200712080007.lB807uPP024...@xxxxxxxxxxxxxxxxxxxx>
Sat Dec 8 01:07:56 CET 2007
Sendmail shows its version number and config file version (both 8.14.1
in this case) in the 'Received:' headers. Although the name 'sendmail'
is not mentioned in the headers, this version number is a sure
indication that the real sendmail is involved.
Other MTA's (and other sendmail configurations) might show their name
in the 'Received:' header(s) added by them.
Regards,
Kees.
--
Kees Theunissen.
I did as suggested :
ls -al `which sendmail` => /usr/sbin/sendmail -> /etc/alternatives/mta
=> /usr/sbin/sendmail.sendmail.
So it seems we are using sendmail on the system! Thanks for the tips
Kees and Robert.
Next: I added these lines to ~/.procmailrc
:0
*
| /home/rpnabar/bin/a.sh
Now, I thought whenever I received an email procmail should run a.sh.
Am I correct in thinking so? Unfortunately there seems to be no action
taken.
Aain, I get very little regular email on this user linux account. So
I'm thinking of putting a keyword in the subject or body of the
message and using its presence to trigger a.sh. But thats for later.
Right now I just want the script to run!
Any ideas what I'm messing up? Again, I can't change any root files so
its important that I do this through user ode changes and scripting.
Thanks!
.
- Follow-Ups:
- Re: how to trigger an action on email recieved
- From: Kees Theunissen
- Re: how to trigger an action on email recieved
- References:
- how to trigger an action on email recieved
- From: rpnabar
- Re: how to trigger an action on email recieved
- From: The Natural Philosopher
- Re: how to trigger an action on email recieved
- From: rpnabar
- Re: how to trigger an action on email recieved
- From: The Natural Philosopher
- Re: how to trigger an action on email recieved
- From: rpnabar
- Re: how to trigger an action on email recieved
- From: Robert M. Riches Jr.
- Re: how to trigger an action on email recieved
- From: Kees Theunissen
- how to trigger an action on email recieved
- Prev by Date: Re: Who is Jesus?
- Next by Date: PAQUET CIGARETTES
- Previous by thread: Re: how to trigger an action on email recieved
- Next by thread: Re: how to trigger an action on email recieved
- Index(es):
Relevant Pages
|
|