When is it appropriate to use the terms Dear Sir or Madam and To whom it may concern? The rules I was taught state that Dear Sir or Madam should be used when you're writing a letter to a person about something that person has direct involvement in (e.g. returning a defective product to a customer service department). By the same rules, To whom it may concern would be used for situations in which the recipient is a third party to the topic of the letter (e.g. regarding a letter of reference or recommendation).
Was I taught correctly? Is the rule actually something else? Or is this one of those situations where many people have an opinion but there is no real rule?