Sorry if you already know how to do this, but this was a trick PHWall taught me ages ago and it's probably been the most helpful thing in my post processing that I learnt. In Photoshop:
1. Choose Rectangle selection tool on left
2. Click Select>All
3. Using the Rule Bar Tool, drag it down to the horizon
4. Right click Free Transform
5. Right click Warp
6. With your Cursor, drag the horizon up to the Ruler, and thus straightening it
I hope this helps, if not, I hope you don't mind.