Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Transport directory based on sender address

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


brent at servuhome

Oct 2, 2007, 9:24 PM

Post #1 of 3 (2244 views)
Permalink
Transport directory based on sender address

Exim users,
I'm trying to set a rule that will set the Maildir storage directory
partly based on the sending server's IP address using lsearch.
I'm getting errors that "" is not a absolute path to the maildir
directory, but the lsearch should be returning the proper string.

Here is the rule:

obstore:
driver = appendfile
directory = ${lookup{$sender_host_address}lsearch{/etc/storetable}}
delivery_date_add
envelope_to_add
return_path_add
maildir_format = true
create_directory = true

And here is what the /etc/storetable contains

10.0.0.1: /var/mail/catch/main/

Here is what the error_log shows:

appendfile: file or directory name "" is not absolute

Pardon my ignorance, but shouldn't that lsearch line return
/var/mail/catch/main/ as the directory path?

Any hits on to where I am off would be appreciated!



Brent Jones
brent [at] servuhome [dot] net





----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


jh at plonk

Oct 3, 2007, 4:49 AM

Post #2 of 3 (2106 views)
Permalink
Re: Transport directory based on sender address [In reply to]

Brent Jones wrote:

> directory = ${lookup{$sender_host_address}lsearch{/etc/storetable}}
> And here is what the /etc/storetable contains
> 10.0.0.1: /var/mail/catch/main/
>
> appendfile: file or directory name "" is not absolute

I'd say it should, but it seems that the lookup returns nothing, so the
resulting string is "".
Run a debug session with "exim -d+expand -bh 10.0.0.1" (or use the swaks
tool) to see what's going wrong.

Oh, and what do you expect to happen when the sender's host address has
no match in /etc/storetable?


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


brent at servuhome

Oct 3, 2007, 11:58 AM

Post #3 of 3 (2111 views)
Permalink
Re: Transport directory based on sender address [In reply to]

Quoting Jakob Hirsch <jh [at] plonk>:

> Brent Jones wrote:
>
>> directory = ${lookup{$sender_host_address}lsearch{/etc/storetable}}
>> And here is what the /etc/storetable contains
>> 10.0.0.1: /var/mail/catch/main/
>>
>> appendfile: file or directory name "" is not absolute
>
> I'd say it should, but it seems that the lookup returns nothing, so the
> resulting string is "".
> Run a debug session with "exim -d+expand -bh 10.0.0.1" (or use the swaks
> tool) to see what's going wrong.
>
> Oh, and what do you expect to happen when the sender's host address has
> no match in /etc/storetable?


I found that lsearch wasn't returning any results, but came across
another function, iplsearch. The lookup now works correctly.
If it doesn't match something, I don't know what I'll do yet, maybe
I'll do some checking in an ACL to reject hosts that don't fall into
known IP ranges before it even gets to the transport.

Regards




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.