Re: [Exim] Exim + Courier IMA

Top Page
Delete this message
Reply to this message
Author: Dave C.
Date:  
To: Friso Kuipers
CC: exim-users
Old-Topics: Re: [Exim] Exim + Courier IMAP
Subject: Re: [Exim] Exim + Courier IMA
On Thu, 24 Jan 2002, Friso Kuipers wrote:

> On 24 Jan, Dave C. wrote:
>
> > On Tue, 15 Jan 2002, Friso Kuipers wrote:
> >
> >>
> >> vmail_smartlist:
> >>   driver = smartuser
> >>   local_parts = dbmnz;/etc/userdb.dat
> >>   home_directory = "${if match{${extract{3}{|}\
> >>                       {${local_part_data}}}}{^mail=(.+)\\$}{$1}fail}"
> >>   transport = vmail_delivery

> >
> > I have question on this - you seem to be relying that the home
> > directory is always in the 3rd field. From what I've seen, the
> > ordering of the fields is arbitrary...
> >
>
> True. When I started to use courier in 2000 I slapped together a script
> to organise the several scripts and programs you need to add and remove
> users. In my setup it's always the third field, but doesn't need to be
> in general. Which I forgot about (I'm the kind of person who forgets his
> own birthday). Looking at my script again it seems you need to use the
> 'userdb' perl script in a consistent manner.
>
> > Now, I seem to remember dimly some way of extracting fields by
> > namefrom this sort of data:
> >
> > eg field1=data field2=otherdate anotherfield=something)
> >
> > from within exim directly - does anyone have a pointer for that or am
> > I just hallucinating?
>
> You mean extract all field for a key and parse them. Sounds complicated.


Well, you don't need all the fields, just specific ones. For exim, all
it needs is the home dir and the uid..

And I've found the following director works great.

virtual:
driver = smartuser
domains = /etc/exim/domains
condition = ${lookup{$local_part@$domain} lsearch {/etc/userdb} {true} {false}}
user=${extract{uid}{ ${tr{${lookup{$local_part@$domain} lsearch {/etc/userdb} {$value} fail}}{|}{ }}}{$value}fail}
group=mail
home_directory = ${extract{home}{ ${tr{${lookup{$local_part@$domain} lsearch {/etc/userdb} {$value} fail}}{|}{ }}}{$value}fail}
transport = local_delivery_maildir

(I use $tr to turn the pipes into spaces, and then exim's $extract gets
the field I need)

My userdb looks like:

.
user@???    home=/var/mail/domain.com/user|systempw=[omitted]|uid=20000
user2@??? home=/var/mail/domain.com/user2|systempw=[omitted]|uid=20001
user@??? home=/var/mail/other.net/user|systempw=[omitted]|uid=20002
.


And the exim transport:

local_delivery_maildir:
driver = appendfile
maildir_format
directory = ${home}/Maildir
delivery_date_add
envelope_to_add
return_path_add
check_string = ""
prefix = ""
suffix = ""
current_directory = /
create_directory = true
directory_mode = 0700