I have received addressed mail from political groups reminding me to use my postal vote to further their cause. My details are not on the open version of the electoral roll. How do they get my name and address and how do they know that I use a postal vote?
They're getting your name, address and whether or not you use a postal vote from the full version of the electoral register. Political parties are (rightly or wrongly) allowed to use the register for "electoral purposes". There's no definition of what "electoral purposes" are but the powers that be, including the Information Commissioner's Office, agree that this includes using the electoral roll as a junk mail list.
You can prevent political parties and the various referendum campaigns from using your personal details by sending them a so-called data protection notice. This is a legally binding demand to stop processing your personal details for "marketing purposes". You can find links to template e-mails and the contact details you need on my blog.
Unfortunately, senders have at least 28 days to comply with data protection notices and the Information Commissioner usually extends this to a whopping two months. By that time the referendum will be all over…
Also, it's worth noting that political parties and, in this case, the two official referendum campaigns are entitled to a free "election communication". This is a one-off mail-drop, funded by the tax payer, which can't be prevented using a data protection notice. In other words, even if you send a political party a data protection notice months before the start of an election campaign you will still get at least one piece of political junk mail. The reason is that politicians think there's no way people can decide who to vote for without receiving unsolicited propaganda.
Perhaps the best thing to do with such unsolicited mailings is returning them to the senders.