FS#2677 support arrays in to, cc, bcc headers in Mailer

This does not fix FS#2677, it only adds support for fixing it later.