Preheat the oven to 375 degrees F (190 degrees C).
Heat olive oil in a skillet over medium heat and cook onions until soft and browned, about 10 minutes. Season with marjoram and a little salt. Remove from heat.
Place lemon slices in a single layer in a clean skillet over high heat and cook until lightly browned on both sides, about 3 minutes. Add star anise and water and bring to a boil. Remove from heat.
Cover a baking pan large enough to hold the salmon with sheets of aluminum foil, leaving an overhang on all sides. Lay onions in a single layer on the bottom; place salmon fillet on top, skin-side down. Rub fillet with salt and pepper. Cover with lemon slices and star anise. Fold up the edges of the foil over the salmon to create a packet, making sure to seal the edges well.
Bake in the preheated oven until salmon flakes easily with a fork, 35 to 40 minutes. Remove from oven, open foil carefully, and serve.