Your turrets will not attack the turrets on a hostile ship even if you have them all set to attack selected targets. If the turrets are undocked or the mothership overheats and become normal ships and not turrets than they will become target able by your turrets.
On my smaller ships I use the attack selected target option in the Bobby AI so I can park the ships in my station without them shooting the walls and other parked ships but don't have to re-configure all the turrets before taking the ship out.... so that's kind of a secondary bug, turrets need to only fire at what they can actually see. I've patched more holes in my station from my own guns than I have from raiding pirates. (faction homebase makes the game less fun if it is invincible)
On my smaller ships I use the attack selected target option in the Bobby AI so I can park the ships in my station without them shooting the walls and other parked ships but don't have to re-configure all the turrets before taking the ship out.... so that's kind of a secondary bug, turrets need to only fire at what they can actually see. I've patched more holes in my station from my own guns than I have from raiding pirates. (faction homebase makes the game less fun if it is invincible)