Are children born outside of marriage in the case of sperm donation considered illegitimate even when no penetration occurred?

The child would not be considered illegitimate according to Ayatollah Khamenei however the child's father is the one who donated the sperm hence the discussion of mahram, inheritance etc will all come in play