After reading the portion of Struthio's reference by Joseph Pohle, I note that he gives two theories. The first one is essentially what I have said and the second one is the one that says that no one can ever know any sacrament is valid because we cannot know a person's internal intentions. I didn't see his evaluation as to which theory is the correct theory.
In any event, when a minister's announced heretical doctrine (i.e., in the case of the referenced Jansenists) is publicly known and the individual's public understanding of what he is doing is not what the Church does, then the sacrament is not valid. Archbishop Lefebvre did not hold (as far as I have ever heard) a public heretical doctrine in regards to the sacraments so his administration of those sacraments are valid. Whether they were licit is another matter entirely and is not relevant to the topic.