§ 505. Determination of tax liability

(a)
(1) Except as provided in paragraph (2) of this subsection, the court may determine the amount or legality of any tax, any fine or penalty relating to a tax, or any addition to tax, whether or not previously assessed, whether or not paid, and whether or not contested before and adjudicated by a judicial or administrative tribunal of competent jurisdiction.
(2) The court may not so determine—
(A) the amount or legality of a tax, fine, penalty, or addition to tax if such amount or legality was contested before and adjudicated by a judicial or administrative tribunal of competent jurisdiction before the commencement of the case under this title;
(B) any right of the estate to a tax refund, before the earlier of—
(i) 120 days after the trustee properly requests such refund from the governmental unit from which such refund is claimed; or
(ii) a determination by such governmental unit of such request; or
(C) the amount or legality of any amount arising in connection with an ad valorem tax on real or personal property of the estate, if the applicable period for contesting or redetermining that amount under applicable nonbankruptcy law has expired.
(b)
(1)
(A) The clerk shall maintain a list under which a Federal, State, or local governmental unit responsible for the collection of taxes within the district may—
(i) designate an address for service of requests under this subsection; and
(ii) describe where further information concerning additional requirements for filing such requests may be found.
(B) If such governmental unit does not designate an address and provide such address to the clerk under subparagraph (A), any request made under this subsection may be served at the address for the filing of a tax return or protest with the appropriate taxing authority of such governmental unit.
(2) A trustee may request a determination of any unpaid liability of the estate for any tax incurred during the administration of the case by submitting a tax return for such tax and a request for such a determination to the governmental unit charged with responsibility for collection or determination of such tax at the address and in the manner designated in paragraph (1). Unless such return is fraudulent, or contains a material misrepresentation, the estate, the trustee, the debtor, and any successor to the debtor are discharged from any liability for such tax—
(A) upon payment of the tax shown on such return, if—
(i) such governmental unit does not notify the trustee, within 60 days after such request, that such return has been selected for examination; or
(ii) such governmental unit does not complete such an examination and notify the trustee of any tax due, within 180 days after such request or within such additional time as the court, for cause, permits;
(B) upon payment of the tax determined by the court, after notice and a hearing, after completion by such governmental unit of such examination; or
(C) upon payment of the tax determined by such governmental unit to be due.
(c) Notwithstanding section 362 of this title, after determination by the court of a tax under this section, the governmental unit charged with responsibility for collection of such tax may assess such tax against the estate, the debtor, or a successor to the debtor, as the case may be, subject to any otherwise applicable law.