On Wed, 21 Aug 2002 11:41:40 +0200 Thomas Baumann wrote:
> I now know my fault, but dont know how to solve:
> local_delivery_cyrus:
> driver = pipe
> command = /usr/cyrus/bin/deliver \
> -m ${substr_1:$local_part_suffix} -- $local_part
> is expanded to
> echo "Subject: abc" | \
> /usr/cyrus/bin/deliver \
> -m list.exim -- tirili+list.exim
> but should be expanded to
> /usr/cyrus/bin/deliver \
> -m list.exim -- tirili
> So how do I have to modify the above command ($local_part)
> to sth. like local_part_before_delimiter,
> but if there is no suffix take the complete local_part
maybe it's because you do the string expansion within
the transport, I think at transport time the $local_part
thing is the _complete_ local part, including the suffix.
However, doing it while directing, you get the $local_part
without the suffix.
FWIW, here is my suffix_users config:
# this is just to convert mail addresses to unix logins
# for users longlongname -> shorty
LOOKUP_ADDR_TO_LOGIN = lookup {${lc:$local_part}} cdb {EXIM_TABLES/ADDR2login.CDB}
suffix_users:
driver = smartuser
local_parts = ^[^\\+]+\\+
suffix = +*
suffix_optional
# this is to skip the director for suffixes that don't match
# an existing imap box; the file EXIM_TABLES/IMAP-boxes.CDB
# is updated at a 5 min interval using a cron job.
condition = \
${lookup \
{${LOOKUP_ADDR_TO_LOGIN {$value} fail}.\
${tr {${substr_1:$local_part_suffix}} {+} {.} }} \
cdb {EXIM_TABLES/IMAP-boxes.CDB} \
{yes} \
fail \
}
new_address = | DELIVER \
-m user.${LOOKUP_ADDR_TO_LOGIN{$value}}.${tr{${substr_1:$local_part_suffix}}{+}{\.}} \
-a ${LOOKUP_ADDR_TO_LOGIN {$value} }
no_rewrite
user = EXIM_UID
group = EXIM_GID
pipe_transport = shell_users_delivery
#
# Delivery to IMAP sub-mailboxes. Address syntax is <user>+<sub-box1>..+<sub-boxN>
# Conditions is mailbox <user>+<sub-box1>..+<sub-boxN> does exist, else driver fails.
and the transport.
shell_users_delivery:
driver = pipe
return_output
log_output
log_defer_output
prefix =
suffix =
user = EXIM_UID
group = MAIL_GID
#
# The command is handed over from the switch_users director. prefix = is
# mandatory for cyrus (else output is prefixed with the unix mail separator
# From <address> string, which is the default; cyrus interprets this as
# invalid headers).
HTH,
Bernard Stern, SWITCH