it can also refer to unnatural sexual acts between people of opposite sex.
There are priests who say that sexual activity between two married people is not Sodomy as long as it does not involve artificial contraception and in the end it is open to producing children. Are they heretics? Is there an infallible document which confirms that these priests are heretics?
No, the sexual act to be licit, must not deliberately exclude progeny; any act of copulation that is not of itself for engendering children is Sodomic. Any sexual act in which the procreative end is deliberately frustrated or excluded is Onanism. Marriage is not a license to do whatever one wants; even the marriage act must be in accord with morality and its natural purpose.
Here is a quote from a standard volume of Moral Theology: John McHough, O.P. & Charles Callan, O.P. "Moral Theology-A complete Course Based On St. Thomas Aquinas And the Best Modern Authorities" Vol II pg. 593
c) Unnatural Consumated acts.-Pollution is mortally sinful (#2535 sqq) and is worse in married than in single persons, as being an injury to the faith pledged in marriage; and hence it is not lawful to practice it even for the purpose of artificial fecundation. Rectal copulation is also gravely sinful, being unnatural lust (see 2534) and a violation of conjugal faith. The usual forms of unnatural vaginal coition, which are very much practiced today, are contraceptive in purpose,.....
Then #2534 states the following:
Unnatural lust.-Worst among the sins of impurity, as such, are crimes of unnatural lust, for they exercise the sexual act, not only illicitly, but also in a manner that defeats its purpose of reproduction. In some non-veneral respects, however, natural sins of purity may be worse than the unnatural; for example, adultery is worse as regards injustice, sacrilegious lust as regards religion, etc. There are four distinct species of unnatural impurities-pollution, unnatural coition, sodomy, bestiality (see Denzinger 1124).
a) For procreation nature requires copulation, and hence pollution is unnatural, for it exercises semination without copulation, either alone (self abuse, solitary vice, masturbation) or with another (softness).
b) For procreation nature requires proper copulation, that is, one that will permit of a fertile union between the two life elements, the sperma and the ovum. Hence, unnatural coition does not comply with this necessity, for it does not employ the proper organ of sexual union, substituting rectal for vaginal intercourse, or else by some form of natural or artificial onanism it frustrates the act of its destined conclusion. This sin is worse than pollution, since pollution omits to use intercourse, whereas unnatural coition positively abuses it.
c)For procreation nature requires heterosexual intercourse, a condition disregarded by sodomy, which is the lustful commerce of male with male (pederastry, uranism), or femal with female (tribadism, sapphism, Lesbian love). This sin is worse than unnatural coition, for it is a greater perversity to neglect one of the two needed life elements than to neglect the right process for their union.(see Gen., XIX. 24, 25; Lev., xx. 13; Rom., i. 26,27)
Denzinger 1124 (cited above) in a list of lax moral propositions condemned is the following:
124 24. Voluptuousness, sodomy, and bestiality are sins of the same ultimate species, and so it is enough to say in confession that one has procured a pollution.