Turns out Proton is super picky about RFC compliance and will reject anything that doesn't met the criteria, which sucks because GMail does exactly the opposite and will take almost anything you throw at it.
So I have so far written about 7 different regexes to fix some specific mailer issues to make them RFC compliant, with plenty more to go. And even then it still somewhat sucks because I am, effectively, modifying the emails to a state they were not received/sent in.
Email only has two really mandatory headers: Date and From. There were emails without a Date header, you can't make that shit up. Naturally MUAs also can't deal with this, e.g. Thunderbird shows the timestamp of the first sync.