I asked a question: "Can you send an email to an address, have it be accepted by the mail server, and then the mail server silently deletes it?" on Stack Overflow and it was downvoted and closed after 6 days.
Yes, because that's a question about how mail servers work; it is demonstrably not a question about a specific programming problem, software algorithm, or software tool commonly used by programmers (meaning, specifically by programmers), and it isn't a practical, answerable problem that is unique to software development.
Or as I like to formulate it: it isn't a question about
Which is why, when the question was closed, the blue shaded box that the system automatically added to the question says, among other things:
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers."
When the system is explicitly telling you that the question was closed because of what it "appears to be about", I should hope the natural conclusion would be "oh, they think my question is off topic".
I asked the identical core question, with a different title and context on Server Fault and received two very useful answers within 6 hours.
Sure. You might well have gotten them with the same title and context, too.
After all, it is a question about how mail servers work, which demonstrably is a question about managing the hardware or software of servers, workstations, storage or networks (specifically, the software of a server and/or a local network).
However the context for the question on Server Fault was a lie as I am not setting up my own email server, I am trying to help my friend debug sending me emails.
We don't care if that's a lie. The question is how to set up an email server. Whether the server will be used for you or your friend does not change the facts about how setting up an email server works.
Similarly, just as it is perfectly acceptable to answer your own question in order to contribute to the Q&A database, it is acceptable to pose as a newbie to ask the question and then answer it as an expert. (In many cases, this is the only reasonable route to getting a good Q&A, because the people who need the question answered are fundamentally incapable of asking it properly - if they were capable of asking it, they'd be capable of figuring it out, too).
On the flip side: when asking a question anywhere on the Stack Exchange network, but especially on the technically oriented sites, we don't want the question to include things that are not about the problem.
The fact (or supposition, or hypothetical, or legal fiction) that you want (or someone else wants) the problem solved for a particular reason (or e.g. by a particular deadline), doesn't change how the task is performed. We want as little of that as possible in the question. Sometimes a line like "I'm trying to write a program to do X" is helpful for understanding the context of a debugging question, but that's about it.
So, rather than fuss over whether you're asking for yourself or a friend, or pretending that the other one is the case, just ask the question.
As you can see from the comments under the Stack Overflow question I tried to explain why this was a valid question but it was then immediately closed ¯\_(ツ)_/¯ despite being quickly answered on Server Fault.
Yes, bumping an ignored question tends to draw attention to it. When site curators have their attention drawn to something that is clearly off topic, they tend to act quickly to close it.
Bluntly, you are not the one who gets to decide whether a question is on-topic. The response you offered in the comments does not address the problem that was pointed out.
(Also, please consider the attitude that you project by using that emote. That, and the age of your account, have a lot to do with why I'm not treating you with kid gloves here. You should know better by now.)
I am wondering if there is any better approach I could have taken. The experience of the honest question was disappointing and ultimately pointless. The experience of the dishonest question, whilst productive, feels ignoble and dishonourable to be dishonest. It doesn't seem like that's the spirit we want to foster on stackexchange? It's certainly not what I want to do.
None of this has anything to do with the "honesty" of the question framing. It is purely about topicality.
I appreciate this might be off topic but if not I would be interested to hear if people think this is just the way it has to be or if there's a better approach I could have taken?
The better approach you could have taken is: when you were told to hover over the tag and read its description, read all three sentences:
Use this tag for questions involving code to send or receive email messages. Posting to ask why the emails you send are marked as spam is off-topic for Stack Overflow. Questions about configuration of mail servers belong on Server Fault.
I don't know how it could possibly be any clearer.