The communications occurred before the Trump administration took office, say current and former officials.