I don't think it's causing the problem, but you shouldn't call the script like that. The output file is always bcc.txt. I'm surprised it didn't complain about too many arguments.
What's happening is a situation like the one I mentioned where you have firstname.lastname@example.org[some forbidden characters but no spaces, newlines or commas]email@example.com. So you have two "@"s and the script can't cope. It's an easy matter to strip out more of the forbidden characters - but if you can provide a bigger sample, it might offer a pointer as to which are needed.
I'd also like to rewrite it more robustly so it can cope with pretty much any input, but that may take a couple of hours, whereas the stripping out is thirty seconds.