  The well-known Giudice-Masiero mechanism explains the presence of a mu term
of the order of the gravitino mass, but does not explain why the holomorphic
mass term is absent in the superpotential. We discuss anomaly-free discrete
symmetries which are both compatible with SU(5) unification of matter and the
Giudice-Masiero mechanism, i.e. forbid the mu term in the superpotential while
allowing the necessary Kaehler potential term. We find that these are Z_M^R
symmetries with the following properties: (i) M is a multiple of four; (ii) the
Higgs bilinear H_u H_d transforms trivially; (iii) the superspace coordinate
theta has charge M/4 and, accordingly, the superpotential has charge M/2; (iv)
dimension five proton decay operators are automatically absent. All Z_M^R
symmetries are anomaly-free due to a non-trivial transformation of a
Green-Schwarz axion, and, as a consequence, a holomorphic mu term appears at
the non-perturbative level. There is a unique symmetry that is consistent with
the Weinberg operator while there is a class of Z_M^R symmetries which explain
suppressed Dirac neutrino masses.
