The first paragraph about message modification is: "Sites MAY modify submissions to ensure compliance with standards and site policy. This section describes a number of such modifications that are often considered useful." From is typically modified to comply with SPF and/or DKIM.
The sections on header rewriting are essentially examples of what the document describes as "modifications that are often considered useful", they're not an exhaustive list. The only MUST NOT rule that concerns email address rewriting is about destination addresses.
(Well, almost unrestricted. The results have to be syntactically valid.)
There's an explanation of this phenomenon that doesn't assume malice: there are N (> 1) servers with different certificates, and you're not hitting the same one every time.
But what that doesn't show is that they then changed it back, and forth... for a while. It was just a UX issue that only affected computer literate people. THE BEST KIND. :(
I remember when some combination of Gmail features* enabled me to upload my old mbox with years of personal email into my GAFYD account... emails from before Gmail publicly existed. And now I could SEARCH them! The future was bright.
I certainly felt confident that I would be a gmail user for life. I certainly didn't consider the possibility that they'd one day just deny my access to the whole thing because I spoke ill of them in a HN comment. ;)
* access external pop3 account and auto-rewrite message headers so messages would be associated with my gmail address even though they were originally delivered to a different domain... Brilliant.
Sorry I'm being a bit thick, but did this happen, or does the emoticon at the end mean it's hypothetical?
My conclusion at the time was that they wanted to keep the percentage of users of the IMAP service below some value, and every time the jerked the config around, they'd see a dip in the graph on their end. My setup is currently non-functional. The maintenance cost was too high. Mission accomplished.
Note: now that I think about it, maybe the cert rotation issue was on (e)SMTP, not IMAP. Same diff.