<<< Date Index >>>     <<< Thread Index >>>

Re: Delivering system mail



On Fri, Jan 30, 2009 at 08:57:47AM +0200, Tolga wrote:
>>>     
>> Thanks for the response, Patrick.  I get line two, but wouldn't line three 
>> of the
>> recipe have to read $HOME/Mail/system/?
>>
>> Rem
>>   
> Add MAILDIR=$HOME/Mail at the beginning of your .procmailrc and amend  
> the recipe Patrick gave to
>
> :0:
> * ^TO_.*root
>  system/

With procmail's special ^TO_ pattern you don't need ".*" :

:0:
* ^TO_root
system/

My own system message filtering works this way:

- each machine on the network sends their 'root' message to a
  filter-friendly address:

  root+admin-mymachine@xxxxxxxxxxx

  This is done with a simple postfix virtual rule on each box:

  /^root@/ root+admin-mymachine@xxxxxxxxxxx

- these mails are all relayed to the central mail host, where
  /etc/aliases points any 'root' mail to my own account,

- my .procmailrc then filters them:

## pseudo variable $1 can't be used on condition line: copy the value to ARG
EXTENSION=$1
## 
## admin and cron messages
:0
* EXTENSION ?? ^admin-\/.*
.Admin.$MATCH/


-- 
http://www.critikart.net