Re: [Exim] lookup question

Etusivu
Poista viesti
Vastaa
Lähettäjä: craig jackson
Päiväys:  
Vastaanottaja: schnozzy, exim-users
Aihe: Re: [Exim] lookup question
Kelley Reynolds wrote:
> --- Original Message ---
> From: Philip Hazel <ph10@???>
> Sent: Tue, 28 Oct 2003 09:34:05 +0000 (GMT)
> To: Kelley Reynolds <schnozzy@???>
> Subject: Re: [Exim] lookup question
>
>
>>On Mon, 27 Oct 2003, Kelley Reynolds wrote:
>>
>>
>>>Unfortunately, for a text lookup to occur in pgsql, it has to be
>>>surrounded by single quotes (tried double quotes, and pgsql threw an
>>>error). So, the following *should* work, but doesn't.
>>>
>>>command = "${lookup pgsql{select homedir from domains where domain='$domain' limit 1} {$value} mail}/mailman/mail/mailman"
>>
>>I see the problem. Because the entire value of the option is quoted, the
>>quotes are being stripped when the value is read. Try
>>
>>command = "\"....'$domain' .... \""
>
>
> Closer, but no good. Let me give you the whole line...
>
> command = "\"${lookup pgsql{select homedir from domains where domain='${quote_pgsql:$domain}' limit 1} {$value} fail}}/mailman/mail/mailman\" \"${if def:local_part_suffix {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} {post}}\" $local_part"
>
> Now, when this one runs, it throws an error in the regex claiming
>
> mailman_transport transport failed: regular expression error in "-(w+)(+.*)?": nothing to repeat at offset 6
>
> Now, that regex is a cut and paste of regex in the mailman howto portion, and it works if I replace the first lookup with just a string and take away the escaped double-quotes like so
>
> command = /home/foo/mailman/mail/mailman '${if def:local_part_suffix {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} {post}}' $local_part
>
> I tried several more iterations or different quotes slashed and not in various places, and apparently haven't got the correct one yet. It either tosses an error on the regex, says something about there being a '\' at the end of the line, or it breaks in the original manner. Quite vexing.
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>


I see how you are doing this, and I don't mean to belittle your way by
suggesting another, which happens often in open source world. But I use
mailman in the same way (except I use LDAP as store) and have no problem:


My router...............
list_pipes:
driver = redirect
allow_fail
allow_defer
hide data = ${lookup ldap {user="cn=admin,dc=localsurface \
,dc=com" pass=PASS \
ldap:///mail=${quote_ldap:$local_part},ou=lists,\
ou=${quote_ldap:$domain},\
dc=localsurface,dc=com?maildrop?sub?}}
user = mail
pipe_transport = address_pipe

My transport.........
address_pipe:
driver = pipe
return_output

The entire command is stored in the attribute like so:
"| /path/to/mailman/command option"
including the quotes. This way quotes are not an issue nor is multiple
mailman installations which some people use (not I).

Hope that helps,
Craig




--

Craig Jackson
__________________________

localsurface.com
__________________________