British spies have required BT to give them access to public communications since 1985, declassified files show.