[exim] Complex forwarding issue

Top Page
Delete this message
Reply to this message
Author: kmb
Date:  
To: exim-users
Subject: [exim] Complex forwarding issue

List memebers,

I have a client that has several users that use BlackBerry
units to read their email. I have worked out the delivery of the mail
to the BlackBerry users via a router that mirrors the system aliases,
as most blackberry webclient accounts only allow for 10MB of storage, I
have also placed a Condition Statement to test if the message is over
1MB. Here is my Router

Code:
--------------------

blackberry_aliases:
driver = redirect
allow_fail
allow_defer
condition = ${if <{$message_size}{1000000}{1}{0}}}
data = ${lookup{$local_part}lsearch{/etc/blackberry.aliases}}
headers_add = X-added-header: added by BlackBerry Forward\n
user = exim
unseen
file_transport = address_file
pipe_transport = address_pipe

--------------------


The headers_add is just for testing and will be removed.

This works perfectly, But The client wants to be notified that a
message did not get sent to the BlackBerry due to the size limt, so
they can look for the skiped message on the Corporate server. Seems
resonable to me. At first I thought that I could just add to my
exsisting Routers to test if it was oversized, so I added a new Router:


Code:
--------------------

# BlackBerry Router over sized message:
blackberry_notify:
driver = redirect
allow_fail
allow_defer
condition = ${if <{$message_size}{1000000}{0}{1}}}
data = ${lookup{$local_part}lsearch{/etc/blackberry.aliases}}
headers_add = X-BlackBerry-oversize: Too Large\n
user = exim
allow_filter
unseen
no_verify
file_transport = address_file
reply_transport = address_reply

--------------------


Then in the system filter I added a check for the new header. But Now
I've learned that the System filter does not look at the redirected
message. I guess I could just process this filter code via a secondary
"user" filter. My Current System Filter looks like this:

Code:
--------------------

# Exim filter

headers add "X-Been-Filter: This message has been to the filter"

if "${if def:header_X-New-Subject: {there}}" is there
then
headers remove Subject
headers add "Subject: $h_X-New-Subject:"
headers remove X-New-Subject
endif
if "${if def:header_X-BlackBerry-oversize: {there}}" is there
then
mail to $header_to
from $header_from
reply_to $header_reply-to
subject $header_subject
text "\
The message sent by $h_from was too large to deliver to your\n\
blackberry ( size = $message_size )\n\
"
endif
finish

--------------------

The first if statement is unrelated to the current issue.    
My question is where do I define the user filter given my current
router If I were to defind a separate filter with just the second
conditon in it?  Can any one suggest a better method to send the
notification out to the blackberry alias when the message is over
sized?


Thanks for any help you can provide.

Kevin B


--
kmb


------------------------------------------------------------------------
kmb's Profile: http://www.exim-users.org/forums/member.php?action=getinfo&userid=1
View this thread: http://www.exim-users.org/forums/showthread.php?threadid=48184