Mahlab is the spice made from the ground pit of a wild cherry that is used to flavor numerous Greek and Middle Eastern pastries. It is one of those flavors that is largely unfamiliar to western taste buds. If you are in the US, you may have a hard time finding this spice unless you live near a well-stocked specialty food store. If you hunt for mahlab comes up short, you are not alone. There are a few tried and true alternatives out there.
Your best bet: Almond extract and star anise
Almond extract and star anise are two potent flavors that you can use together and in moderation to mimic the flavor of mahlab. Since the main flavor of mahlab is that of almonds, the almond extract can do an effective job of replacing that. The extract consists of oil extracted from bitter almonds along with water and oil. Star anise is the fruit of the Illicium verum, which is an Asian evergreen tree. Star anise can provide the deep, mysterious licorice notes that true mahlab brings to baked goods.
You will have to adjust this substitute to taste, but you should combine the two flavorings so that there is slightly more of the almond extract than of the star anise. You want the almond flavor at the forefront and the star anise in the background. It is important to remember that both are extremely pungent, so proceed cautiously.
In a pinch: Pure anise extract
Anise can deliver the licorice notes that mahlab lovers want. The extract is widely available but you can make your own without much trouble if you have trouble finding it. The recipe has two ingredients: 2 teaspoons of anise seeds and 6 ounces of vodka.
Note that this takes a certain amount of foresight as the assembled ingredients will not be ready to use before two months have passed. As with the substitutes above, it is best to try a small amount of this mahlab alternative and adjust until you get the desired taste. The anise flavor will continue to intensify until you remove the anise seeds from the vodka.
One common option is the combination of ground fennel seed and cardamom, both of which may be easier to find than most of the options above. Fennel seeds can provide the licorice notes while cardamom provides an intense sweetness that should complement the bread and cookie recipes that call for mahlab.
If you can find bitter almonds, some cooks recommend them as a mahlab replacement. If you live in the US, you may have an especially hard time finding these because of their potential toxicity. The Food and Drug Administration deems both the kernel and the tree illegal.