Many aspects of social behavior are controlled by sex-specific pheromones. Gender-appropriate production of the sexually dimorphic transcription factors doublesex and fruitless controls sexual differentiation and sexual behavior. miR-124 mutant males exhibited increased male–male courtship and reduced reproductive success with females. Females showed a strong preference for wild-type males over miR-124 mutant males when given a choice of mates. These effects were traced to aberrant pheromone production. We identified the sex-specific splicing factor transformer as a functionally significant target of miR-124 in this context, suggesting a role for miR-124 in the control of male sexual differentiation and behavior, by limiting inappropriate expression of the female form of transformer. miR-124 is required to ensure fidelity of gender-appropriate pheromone production in males. Use of a microRNA provides a secondary means of controlling the cascade of sex-specific splicing events that controls sexual differentiation in Drosophila. DOI: http://dx.doi.org/10.7554/eLife.00640.001, eLife digest Like many animals, the fruit fly Drosophila uses pheromones to influence sexual behaviour, with males and females producing different versions of these chemicals. One of the pheromones produced by male flies, for example, is a chemical called 11-cis-vaccenyl-acetate (cVA), which is an aphrodisiac for female flies and an anti-aphrodisiac for males. The production of the correct pheromones in each sex is genetically controlled using a process called splicing that allows a single gene to be expressed as two or more different proteins. A variety of proteins called splicing factors ensures that splicing results in the production of the correct pheromones for each sex. Sometimes, however, the process by which sex genes are expressed as proteins can be ‘leaky’, which results in the wrong proteins being produced for one or both sexes. Small RNA molecules called microRNAs act in some genetic pathways to limit the leaky expression of genes, and a microRNA called miR-124 carries out this function in the developing brain Drosophila. Now, Weng et al. show that miR-124 also helps to regulate sex-specific splicing and thereby to control pheromone production and sexual behaviour. Mutant male flies lacking miR-124 were less successful than wild-type males at mating with female flies, and were almost always rejected if a female fly was given a choice between a mutant male and a wild-type male. Moreover, both wild-type and mutant male flies were more likely to initiate courtship behaviour towards another male if it lacked miR-124 than if it did not. The mutant male flies produced less cVA than wild-type males, but more of other pheromones called pentacosenes, which is consistent with the observed behaviour because cVA attracts females and repels males, whereas pentacosenes act as aphrodisiacs for male flies in large amounts. Weng et al. showed that these changes in the production of pheromones were caused by an increased expression of the female version of a splicing factor called transformer in the mutant males, but further work is needed to understand this process in detail. DOI: http://dx.doi.org/10.7554/eLife.00640.002