Re: [Exim] lookup question

Góra strony
Delete this message
Reply to this message
Autor: Kelley Reynolds
Data:  
Dla: exim-users
Temat: Re: [Exim] lookup question
--- 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.