Hillary was bound by a memorandum of understanding/agreement rather than a requirement of u.s. law. She did not have to sign it if she did not want to be Secretary of State but it was her way and the governments way to overcome perceived or actual conflicts of interest where her husband and her foundation were receiving foreign donations. And it enabled her to get through senate confirmations knowing that it would be a major source of questioning and a hurdle if she had no plan to address it. Naturally- as is her way- she just totally ignored it once she was confirmed. A lot of the interaction between the foundation and the state department would have been covered in the missing 35,000 emails. That's why she moved immediately to delete and bleach bit them within a few days of being ordered to preserve them.