As long as the sail is built from polyester sailcloth, but not otherwise, it is quite ok to soak it in a strong bleach solution.
I have done this a number of times over the years, including on foam luffed genoas, and it both works and does not damage the sail - so in the sense of another thread I can claim experience.
But as some, mostly catamaran
owners it seems, are of the view that my experience is actually just opinion made from the comfort of a fireside armchair, and for the confusion of other assorted naysayers I will also point you to the following North Sails
web page North Sails One Design
to provide veracity - you need to scroll about 1/3 of the way down the page to get to the subject.
If the sail panels
were glued before sewing you may find that some mildew staining stays in the glue line, similarly if the mildew is inside multiple layers of cloth at reinforcing.
If there is algae build up in between folds, if the sail was folded when the problem occured, it can be removed by very light soft brushing - taking care not to damage the filler between the threads making up the cloth.