I am looking for a fic I read maybe 4 years ago? It has SG-1, Martouf/Lantash, and Jacob/Selmak going on a mission together. The locals have some rule against women being unmarried when they are above 25, so Sam has to pick someone to marry now or they will force her to marry the son of the local leader. Jack and Martouf/Lantash offer to marry her, and are sort-of fighting for her hand. Eventually she realizes she want them both/all, and she ends up married to Jack AND Martouf/Lantash. I think the fic is NC-17 and has a rather steamy threesome/foursome wedding night scene.
I think they also discuss how to be together after going back home, and both Sam and Jack are seriously considering joining the Tok'ra so they can all be together.
They have a lot of tests that Jack and Martouf/Lantash had to go through to prove they were worthy of marrying Sam. And the son of the local leader kept making advances to Sam.
I think it was called something like Allies and Enemies? Or maybe Enemies, allies.
It was on Geocities, so it disappeared when that went away. I don't have the author or the link, unfortunately