\usemodule[letter]

\useletterstyle[dinb]

%
% header/footer alternative
%

\setupletterstyle
  [head,foot]
  [alternative=myletter]

%
% header: long infoblock
%

\setupletterstyle [head]
  [align=flushright, style={\switchtobodyfont[small]}]

\defineletterelement [head] [myletter] {
  \framed [frame=off,width=6.4cm, align=flushleft] {%
    {\tfc A very long infoblock}\blank[big]
    \input materie \endgraf}
}

%
% footer
%

\setupletterstyle [foot]
  [style={\switchtobodyfont[small]},
  spacebefore=4cm, % spacebefore has no effect
  spaceafter=4cm]  % spaceafter has no effect

\defineletterelement[foot][myletter] {
  \hrule
  A custom footer\\that is\\longer than\\three lines\\and misses space before and after and has strange linespacing.
}

%
% format back address
%

\setupletterstyle
  [backaddress]
  [bottomframe=on,
    separator={~\textbullet~}]

\setupletterstyle
  [option]
  [backaddress=yes]

%
% reference line
%

\setupletterstyle
  [reference]
  [alternative=e,
    list={yourref,yourmail,myref,date}, % why the trailing comma? without reference line is missing.
  ]

\setupletter
  [yourref,yourmail,myref,date]
  [width=.25\textwidth,
    titlestyle=\tfxx]

\setupletter
  [yourref=Yie/hie4,
    yourmail=2010-08-15,
    myref=Io/ch3ac,
    date=\currentdate]

%
% from/to address
%

\setupletter [fromname={Dr.\ No},
  fromaddress={Address\\City\\Country}]

\setupletter [toname={To whom it may concern},
  toaddress={Somecompany\\Somethingelse\\Somestreet\\Somecity\\Somecountry}]

%\setupletterstyle[dispatch=no]

%
% letter text
%

\starttext

\startletter
  [subject=Subject,
   opening={To whom it may concern,},
   closing={Regards,}]
\dorecurse{4}{\input tufte\par}
\stopletter

\stoptext

