Group by email instead of section For a long time I had only one email account in my Mail.app and had all my sections (inbox, sent, junk, trash, ...) nicely organised in the Mailboxes sidebar. But recently I added another account and now I've all my accounts separated by section instead of by email.
Is there a way to have it like:

email1@example.com
    inbox
    sent
    junk
    trash
    archive
email2@example2.com
    inbox
    sent
    junk
    trash
    archive


instead of:

inbox
    email1@example.com
    email2@example2.com
sent
    email1@example.com
    email2@example2.com
junk
    email1@example.com
    email2@example2.com
trash
    email1@example.com
    email2@example2.com


I understand why apple did this, to have a practical way of viewing all my emails inbox at once but I don't need it and always check my accounts separately.
The answer, unfortunately in your case, is "no". Apple's Mail.app does not have the ability to group maiboxes by account rather than by function.

Any mailboxes other than these "special" ones stored on IMAP servers do get sorted by account, down in the sidebar section where mailboxes that are stored "On My Mac" are listed. 

Thus, if you set up IMAP accounts so that Mail.app does not store "Sent", "Drafts", "Junk" and "Trash" mailboxes on the server but rather stores them "On My Mac", you could sort of simiulate some of the look that you want and those IMAP mailboxes would get listed down with any other IMAP mailboxes that are on the server. However, set up in this way, the functionality of the various menu commands and automatic things that Mail.app does with those folders would not work (well they would "work" but just not using the IMAP mailboxes), and you would have two sets of all these "special" mailboxes listed in the sidebar - those on the servers below and those stored locallay listed above all grouped together in the manner you don't like.