Hi: First post to this forum, so apologies is this is in the wrong place.
I too have a pipe fence, leaning about 15 to as much as 30 degrees. I'll describe what I'm doing here--hopefully the less experienced can pick up a hint, and the more experienced a laugh at my screw-ups.
This is in Fairview texas, with clay soil. As far as I know, fence was installed in mid '80s. I don't have a tractor to pull it straight, or a truck (which may be enough to have me deported from TX, so please keep this to yourselves), and it leans so far I wasn't sure if it could be pulled straight in the first place without destroying it. If that's successful, then I'll move on to a strategy to keep it straight.
The first of two sections to be straightened is about 150 feet, with 6 inch posts at each end.
First I laid down 1/2 in. poly pipe, with little drip sprinklers at each posts, and let it soak overnight. Next morning, at the base of each post, I dug a 12-18 inch-deep half circle. I took four boards, each 5-6 long (stuff I had laying around, a 2 x 12, couple of 4x4 posts, coupl of 2x4s nailed together to make a 4x4), and laid them on the ground, perpendicular to the fence line, abutting to the post. At the end of each post/board, I screwed in earth anchors--essentially a big eye-bolt with an auger on the end. Got these at a 'tractor supply' store, and then cheaper at another shop (rhymes with 'Ranger'). First used 40 inch anchors, then swithed to 30 inch because turning 40 inches all the way into the ground takes A LOT of effort.
So there's a fence post, a board lying perpendicular on the ground, abutting to the post, and an earth anchor screwed into the ground at the end of the board. Then I used a come-along, with one end hooked to the earth anchor, and the other end hooked to the top fence rail, thus making a trialnge with the three sides: 1) fence post, 2) board on the ground, and 3) come-along cable. I ratcheted and darned if it didn't immediately begin to straighten out the fence.
As I mentioned, however, I have 150 feet in total, and the other panels weren't straightening. I duplicated the set-up a few posts down the fence line, and got the same good result. I will add 2 more of these set-ups, then hope to pull straight the whole 150 feet. So far, I've reduced the lean by half, but don't want to pull harder until I have all 4 come-alongs attached.
Next thing (assuming I can pull it straight) will be to figure out how to keep it that way. I'm thinking of additional concrete around the posts, without a shoulder as per Wrought_n_harv, plus a couple of 6 foot t-posts, say 2-3, pounded straight down, then welded to the fence posts.
Life's hard (and expensive) without heavy equipment!
Total costs so far:
$60 plus tax for 4 cheap come-alongs
$30 for earth anchors
$50 for chain, cable, hooks
$40 for poly pipe and fittings