Re: [exim] Exim + filter + mkdir

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: andrey.morskoy
Data:  
Para: Andrey Morskoy, exim-users
Assunto: Re: [exim] Exim + filter + mkdir
ACL vars seems to be invisible for filter - them are empty there, but
thanks for idea.

Phil Pennock wrote:
> On 2008-03-16 at 13:18 +0200, Andrey Morskoy wrote:
>
>> I have made setup of system filter for exim:
>> unseen save /home/mailstore/mail/$reply_address+$tod_log+$message_exim_id
>>
>> Everything works fine, but now I want to store mail this way:
>> /home/mailstore/mail/Mar/$reply_address+$tod_log+$message_exim_id
>> /home/mailstore/mail/May/$reply_address+$tod_log+$message_exim_id
>> ...
>> /home/mailstore/mail/Dec/$reply_address+$tod_log+$message_exim_id
>>
>> I do not want to change Exim's config every month, as well, as I do not
>> want to have a set of empty dirs, created for further months...
>>
>> Can exim calculate current Month?
>> I suppose, that I need to make regex for $tod_log - I think can, but how
>> does it looks in Exim?
>>
>
> The Subject: says mkdir, so I'll cover that easy bit first: in the
> appendfile transport which is specified by
> "system_filter_file_transport", set "create_directory" (and perhaps
> "directory_mode"), so that parent directories will be created for you.
>
> The easiest way to get the month into the system filter is probably to
> set an ACL variable during message reception and then refer to it in the
> filter file. I _think_ the ACL variables are visible to the system
> filter (but I've never checked it).
>
> So:
> warn set acl_c_month = ${extract{2}{ }{$tod_bsdinbox}}
>
> and then just use $acl_c_month in the system filter.
>
> Otherwise, you have to do some kind of dummy comparison against the date
> and then use $1 to get the extracted field.
>
> -Phil
>
>



--
Best regards,
Andrey Morskoy
System Manager

Negeso Kiev
19 M. Raskovoy St., 7th floor, office 719
02002 Kiev, Ukraine
Tel: +380-44-516 83 84
Fax: +380-44-516 83 84
MSN: cyclope@???
www.negeso.com.ua


Mobile:+380-95-490-29-65
E-mail: andrey.morskoy@???