Update: I've got a catch-all alias that redirects @domain.com to user@domain.com. It seems that the extension is empty because of this. So the question becomes: Can I have a catch-all so that random+ext@domain.com redirects to user+ext@domain.com without explicitly defining either the random or the ext part?

I have a similar setup using Postfix and CourierIMAP. You could try using procmail to handle this. I have a wildcard set up so that all mail goes to one user, and then use procmail rules to filter e-mail into various folders based on the address it was sent to.

For example, this would filter e-mail to adsense or google @domain.com into a Google folder:

:0
* ^(To|CC|BCC).*(adsense|google)\@domain\.com
.Google/

To expand on this for your purpose, you could use a more advance rule like this:

However, note that the folder would be case-sensitive, and you would need to make sure the folder has been created. You could get more advanced and just do scripting to create folders when they don't already exist if necessary.