procmail
[Top] [All Lists]

Re: if-then or something similar

2001-07-20 03:46:59
Hello again,

On Thu, Jul 19, 2001 at 04:33:41PM -0400, Matt Dunford wrote:
Here is it as shell-script, is there any way to translate it to my
.procmailrc?

if [ "`cat .mutt.aliases | grep -ic $FROM`" != "0" ]; then
    $PERLSCRIPT
fi

Maybe "!=" has to be replaced by "-gt", I am not sure about that yet.
$FROM is from "FROM=`formail -zxFrom:`"

So, is something like that possible?

Try this (untested, of course!):

:0:
* ? grep -i "$FROM" .mutt.aliases
| $PERLSCRIPT

Ok, it works now, just had some errors because I forgot $HOME.
Everything seems fine, but I now have some trouble with my $FROM.
It's like $FROM=User Name <user(_at_)host(_dot_)com>, like in my alias-file, but
when the User changes his Name to e.g. "User :-) Name" I have a problem
;-)
Is there any chance to make formail just extract the last part between
the "<" and ">" or to invoke sed to cut away the first part?
I just tried to use sed, but it had no effect. The LOG said it was
skipping my sed-line in my .procmailrc :-(

Best regards,
Arvid

-- 
 .''`. [Arvid Warnecke] [Arvid(_dot_)Warnecke(_at_)TU-Clausthal(_dot_)de] 
[05323-715724]
: :' : [ICQ 55906559] [ http://up.to/suck ] [PGP-Subject:"get pgp key"]
`. `'  Linux 2.4.2 i686  XFree86 Version 4.0.2  Uptime: 2 days, 20:32
  `--  BOFH #258: That's easy to fix, but I can't be bothered.

Attachment: pgpJc5puxlTTE.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>