post...@corwyn.net a écrit : > And a last betterer/simpler way to do it. > > SELECT > if(INSTR(maildir,'+'),concat(left(maildir,instr(maildir,'+')-1),'/Maildir/.',right(maildir,length(maildir)-instr(maildir,'+'))),CONCAT(maildir,'Maildir/')) > from mailbox where username ='%s' and active='1' > > >
you are still allowing random folder names. create a table, say Folder, where you put the folders you want to support ("spam", ....). That should also make your query a little simpler (unfortunately, postfixadmin table structure makes this and other things harder...).