It was a simple trick posted on Twitter by a Sydney software engineer that led to an avalanche of spam and harassment being sent to Attorney-General George Brandis' iPhone.

The tweet, containing a screenshot of a rude text message marked "delivered", showed how the engineer had been able to send a message to Senator Brandis' mobile without his mobile number.

Greg Hunt reportedly sent this message to someone messaging him. Credit:BuzzFeed/Fairfax Media Graphics

The Twitter followers of Justin Simon, the engineer who tweeted the message, then joined in and began sending unsolicited messages to Senator Brandis and other MPs including Greg Hunt and Scott Morrison.

What Mr Simon and his followers had discovered was that it was possible to directly contact Senator Brandis on his mobile using iMessage, the free text messaging service that comes with Apple's iPhones.