Julia Gillard's spin doctor John McTernan defended not allowing media to report on her controversial 'men in blue ties' speech as "old-fashioned closed-shop unionism", emails leaked to the ABC reveal.

Thousands of internal exchanges obtained by the ABC reveal the tense scenes in the Prime Minister’s office as Ms Gillard's warning about Liberal men in blue ties tampering with abortion rights trickled out into the public domain.

The Women for Gillard address was one of the former prime minister’s defining speeches and, combined with the Women's Weekly knitting photo shoot, positioned Kevin Rudd for his final and successful attempt to regain the leadership.

Labor MPs, publicly and privately, despaired at Gillard's final salvo.

Emails sent from staff in her office that day show she planned to speak "off the cuff" to the 'Women for Gillard' group, which was headed by a former junior Labor staffer linked to the Prime Minister's office.

The Prime Minister’s office knew media were aware of the event, but organisations were "not to be alerted" as the office planned to release its own video recording of the speech later.

But the leaked emails show her chief spin doctor lacked a basic understanding of the logistics involved with distributing large video files to the media for broadcast.

Ms Gillard delivered her speech in Sydney on the morning of June 11 and plans were put in place for her social media coordinator to film the speech and transfer the files to Women for Gillard activists for editing and release to the media.

But the process took hours, and reports about Ms Gillard's abortion comments had already dribbled out, triggering a flurry of media requests by lunchtime for the footage and a transcript of what the prime minister had said.

'It simply can't take that length of time' - McTernan

But by 4:00pm, as the television deadlines loomed, Mr McTernan was still brainstorming the best way of getting the footage to the media, asking staff: "Does it help if we get it delivered to ABC, Sky and 7 in Sydney?"

"It might mean they can broadcast it sooner but I'm not technically knowledgeable enough to tell you for sure," replied a media assistant.

"Can you check with all the TVs who can get the USBs to in the different organisations so that they can get it – and tell them they'll have access via DropBox by ??," Mr McTernan responded, pleading for a time frame.

Government staffers trying to edit and upload the footage had warned after 3:00pm that they were fixing the audio, and uploading the 1.2GB file to Dropbox would probably take another 40 minutes.

"It simply can't take that length of time," Mr McTernan complained.

The footage eventually made it to the media just an hour before the 6:00pm news bulletins went to air.

Channel 9 asked why it should be expected to use footage supplied by the Prime Minister’s office when it had been shut out from the event.

Mr McTernan then fired a terse email to his staff defending the decision "we can film any f**king event the PM is at if we want to. Old fashioned closed shop unionism".

Asked the next day about why the decision was taken to ban the media from an event when the speech was made public anyway, Mr McTernan wrote responded "Don't understand your processological [sic] focus."

The chaos surrounding the speech and its public release is evidence of the perilous condition Ms Gillard's office was in, as the Rudd forces mobilised for one last strike before Parliament rose ahead of the former prime minister’s scheduled election date of September 14.

'Never was an hour of the PM’s time at Kirribilli so well invested'

The emails show the Prime Minister's office feeling as though it was under constant attack from within, and Mr McTernan's disdain for Mr Rudd was obvious as he defended his boss against the constant internal destabilisation.

When Ms Gillard called a leadership ballot in 2012 she prided herself on having never leaked against Mr Rudd, and absolved journalists of their ethical obligations to keep confidences if they believed she was lying.

One of the emails obtained by the ABC shows her communications director bragging about a Sunday Telegraph article listing reasons why Labor "punted [Rudd] in the first place", and crediting Ms Gillard for the publication.

"Never was an hour of the PM's time at Kirribilli so well invested," Mr McTernan gloated to staff in an email sent just weeks before Ms Gillard was evicted from the Lodge.

When Mr Rudd gave a wide-ranging interview in November 2012, on foreign policy and some domestic issues, Mr McTernan specifically and only requested Mr Rudd's "exact words", calling for a better investigation into who leaked the video of him frustrated and swearing from a video message he recorded when prime minister.

He forwarded a meme ridiculing the former prime minister to staff, some of whom continued to serve for Labor despite the change, and the night after Mr Rudd won back the leadership, he replied to a colleague's query that he would not be attending the staff party as he "could not bear to hear Rudd addressing [it]."

'I’m in Comms not policy, the sewer not the sewage'

The emails show Mr McTernan placed great emphasis on how people reacted on Twitter to the Government's messages of the day.

He would celebrate when issues, pictures or memes favourable to Labor, trended online, but when his attempt to spruik Labor's free payments to parents with schoolchildren backfired he was indifferent.

When a media assistant sent an email to staff telling them the prime minister was being 'slammed on Twitter for #cashforyou hashtag' John McTernan replied "I seriously don’t give a f**k."

Separately, Mr McTernan described his own role in communications as being the "sewer" and policy advisors the "sewage", "I'm in Comms not policy, the sewer not the sewage" he wrote when responding to an email pointing out a error in a policy-based claim he wanted to script for Ms Gillard.

Other emails reveal him pointing his staff to Tony Abbott’s communications discipline as "a lesson for us" and praising the Coalition's cohesion in sending out the same messages in key attacks against Labor.

In one tactic, Mr McTernan told staff he had liked a joke from a journalist about wearing a hard hat the day the carbon tax came into effect or doing his cross from a bunker "in case the sky fell in". "Of course he won't," he said, "but we should think about getting one of our backbenchers to do it."

The strategy culminated in the former trade minister Craig Emerson singing 'No Whyalla Wipeout" on camera to mock Opposition claims Whyalla would become a ghost town because of the carbon tax.

Labor sources have told the ABC other cabinet ministers and internal Gillard supporters were infuriated by the tactic, as it mocked genuine fears in the community about how the carbon price might affect the cost of living and employment.