Early in my career I held a 'part time, hourly' job as a tech in a smallish company. It quickly became apparent that I was more knowledgeable in systems than their full time admin, who coincidentally was also very lazy (had no intention of increasing his knowledge). During my time there, I implemented a lot of systems which were frankly quite a bit above my pay grade. For a while, I didn't care, because it was good experience for me. However, as time wore on, the laziness of the full time SA, and the micromanagement of our CIO boss really started to wear on me, and I started looking. I had asked for a promotion, citing my skill, the very technical projects I had accomplished, and specified areas where I could augment the existing SA's lack of experience with my own, in a full time capacity. These were denied due to the size of the company, yada yada...
It didn't take me long to find another job, I had a couple of different offers to choose from, but I was really quite young and still bitter about the way things had gone. The denial of promotion after I had done so much, and the SA had done so little, and knew so little. I didn't send a nasty email my boss, the company or its owners, although the thought had crossed my mind several times. I sent a thank you note to the CEO, and received a gracious reply. However, I couldn't let it go, it kept grinding on me. It was fresh in my mind. So, when I learned that my re-hire was about to be hired, I acquired his email address from a friend still with the company, and sent him a very detailed email, outlining (and probably exaggerating) all of the personal and professional deficiencies of the CIO. Trust me, there were many to choose from, it was a long email. It was unprofessional and mean spirited.
What I didn't ponder at the time is what trouble this could get my friend who was still with the company into. I felt horrible after sending it, I worried about his job (since he gave me the contact info, etc). As it turns out, the new prospect forwarded the email to his future employer, which is not really what I anticipated. He was able to use the email as leverage to negotiate a higher wage (good for him), and decided to take the job anyway. (For what its worth, I had lunch with my replacement less than a year after he had taken the job, and was moving on to another. He confirmed that everything I had said was true...)
All said, it was a very stupid thing for me to do, and I certainly will not do anything like that in the future. Now I am hesitant to even list that company on my resume, as I'm certain that CIO will not give me a good reference or even a stable reference. I certainly wouldn't if I were him. So rather than having a good solid reference employer, where I had accomplished a lot of good things, and left in a reasonably gracious fashion, now I have a past that I have to stay clear of and basically throw away that experience.
My advice is to just leave graciously. All of the annoyances you suffer currently, will seem increasingly less as time goes on. Especially if you find a company (as I did) which recognizes your talent and advances you quickly.