I must precede my discussion of legal definitions of shall, must, will, should and may with the caveat that common use of these terms can differ from legal use, the efforts of the Plain English in the Law movement notwithstanding. These definitions are based on American law, which, except for Louisiana, is based on the English common law, and thus I suspect that usages are similar in many other English language legal systems.

Shall = has a duty to
Must = (no legal definition, so the lay definition applies) = used to express an imperative
Will = (no legal definition other than that pertaining to the document used to dispose of a decedent’s estate, so a lay definition) = expected or required to
Should = (lay again) = pt of shall, indicative of duty, propriety or expediency
May = is permitted to

In drafting contracts or statutes, "shall" is often used to impose a mandatory duty, but the use of "shall" is in large part attributable to the inertia of legal writing (some of the statutes still in effect were initially drafted over 100 years ago). I use "must" instead. It also conveys imperative, but at least in the US is the more modern and common term, and thus far has not caused confusion over its meaning like "shall" occasionally does. Sometimes, the Legislature will confuse "shall" and "may," or "and" and "or," making interpretation more of an art than a science.

I agree with prior posters that "shall" clearly means an imperative when spoken by one as a command to another, but conveys a meaning closer to expectation when spoken about oneself. In contracts or statutes, of course, only the command nuance arises.

Per Webster’s, the traditional rule says that future time is indicated by "shall" in the first person and "will" in the other persons, and that determination is expressed by "will" in the first person and "shall" in other persons. Webster’s and the Gregg Reference Manual both say that "shall" has largely given way to "will" in all but the most formal writing and speech, and that "should" and "would" similarly have formal and informal distinctions and follow the same rules in expressions of future time, determination, and willingness.

Well, I could go on, but I will not, as there are things I must do and I should get back to work.

I shall return.