I'm working on migrating to Dovecot. At the moment, I have a mail path that includes the domain, so I'm using %d to get that. However, if users authenticate without specifying a domain (i.e. using "bob" instead of "bob at wiktel.com"), then %d expands to nothing. I'd like to have that expand to a default domain (wiktel.com) instead. Is that possible? Thanks, Richard
You could use the perdition proxy to achieve this: http://www.vergenet.net/linux/perdition/ Richard Laager wrote:>I'm working on migrating to Dovecot. At the moment, I have a mail path >that includes the domain, so I'm using %d to get that. However, if users >authenticate without specifying a domain (i.e. using "bob" instead of >"bob at wiktel.com"), then %d expands to nothing. I'd like to have that >expand to a default domain (wiktel.com) instead. Is that possible? > >Thanks, >Richard > > > >
On Monday 27 March 2006 21:47, Richard Laager wrote:> I'm working on migrating to Dovecot. At the moment, I have a mail > path that includes the domain, so I'm using %d to get that. > However, if users authenticate without specifying a domain (i.e. > using "bob" instead of "bob at wiktel.com"), then %d expands to > nothing. I'd like to have that expand to a default domain > (wiktel.com) instead. Is that possible? > > Thanks, > RichardThe best solution to this (afaik) is to let the SQL server to the dirty work for you, e.g.: SELECT [...] CASE WHEN ('%d' = '') THEN 'default.com' ELSE '%d' END AS domain [...] Depending on your database schema, you may be able to get away without the CASE statement usage with something like this: SELECT ... WHERE (('%d' != '' AND domain='%d') OR ('%d' = '' AND domain='default.com') ... It's not the greatest of solutions, but it works well enough. HTH, -- Ben Winslow <rain at bluecherry.net>
On Mon, 2006-03-27 at 20:47 -0600, Richard Laager wrote:> I'm working on migrating to Dovecot. At the moment, I have a mail path > that includes the domain, so I'm using %d to get that. However, if users > authenticate without specifying a domain (i.e. using "bob" instead of > "bob at wiktel.com"), then %d expands to nothing. I'd like to have that > expand to a default domain (wiktel.com) instead. Is that possible?auth_default_realm = wiktel.com
On Fri, 2006-03-31 at 17:15 +0300, Timo Sirainen wrote:> On Mon, 2006-03-27 at 20:47 -0600, Richard Laager wrote: > > I'd like to have that > > expand to a default domain (wiktel.com) instead. Is that possible? > > auth_default_realm = wiktel.comThat seems to be working. Thanks. I'm sorry for bothering everyone. I don't know how I could've missed that in the example config file. Richard