Olivia says to Malvolio, “Why, this is very midsummer madness” (Twelfth Night, iii. 4). The reference is to the rabies of dogs, which is generally brought on by Midsummer heat.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Midsummer Madness from Infoplease: