I use Outlook Express 6 but I would think that the same option would be available in most other mail clients.
Create a new folder in the inbox for each mail account, ie: g-mail, isp, yahoo etc.
Now create a new "message rule" for each specified account that places your mail in the corresponding folder. Your g-mail will go to your new g-mail folder etc etc after the messages are downloaded from the server, same with all your accounts.
Have a look here, hope this helps.
Mail Rules Pic