Starting point should be this simple minimum example with the fromrule below the senders name and the senders personal data aligned to the right hand side:

\documentclass{scrlttr2}

\KOMAoptions { fromalign=right,
fromrule=aftername }

\usepackage[english, ngerman]{babel}

\begin{document}

\setkomavar{fromname}    {John Doe (sender)}
\setkomavar{fromaddress} {25th Doe's Avenue \\ 54321 Springfield}

\begin{letter}  { Maria Lae\\
12345 Milltown }

\opening{Dear Maria,}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua.

\closing{Sincerely yours}

\end{letter}

\end{document}


Unfortunately, both the fromrule and the set alignment disappear by use of a custom-made firsthead despite of performed activation by setting fromrule=aftername and fromalign=right in the preamble.

The only way to preserve fromrule and alignment is to remove the custom-made firsthead out of the source code.

How can I add the fromrule into a custom firsthead, for example inside this self made exemplary firsthead-code like the following:

\setkomavar{firsthead} {%
{\usekomafont{fromname}\strut\ignorespaces\usekomavar{fromname}} \\
}


Of course, I also could easily add an ordinary line by inserting...

\rule{\textwidth}{.5pt}


... at the final desired position (below the senders name) ...

\setkomavar{firsthead} {%
{\usekomafont{fromname}\strut\ignorespaces\usekomavar{fromname}} \\
\rule{\textwidth}{.5pt}
}


... , but ordinary lines use completely different spaces and distances to the text than the fromrule. That's the reason why I want to continue to to use the fromrule instead of an ordinary one...

Do you have any ideas? Thank you very much for your help!

It is not possible to use the fromrule option together with firsthead. But here is an suggestion how you can get the same line as in your MWE:

\documentclass{scrlttr2}
%\KOMAoptions { fromalign=right,
%fromrule=aftername }

\parbox{\textwidth}{
\raggedleft
{\usekomafont{fromname}\strut\ignorespaces\usekomavar{fromname}} \\[-.5\baselineskip]
{\usekomafont{fromrule}\rule{\textwidth}{\useplength{fromrulethickness}}}\\
}}

\usepackage[english, ngerman]{babel}

\begin{document}

\setkomavar{fromname}    {John Doe (sender)}
\setkomavar{fromaddress} {25th Doe's Avenue \\ 54321 Springfield}

\begin{letter}{Maria Lae\\
12345 Milltown}

\opening{Dear Maria,}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua.

\closing{Sincerely yours}
\end{letter}
\end{document}


• "It is not possible to use the fromrule option together with firsthead." Okay, I didn't know that for sure... Thank you very much! – Dave May 25 '15 at 10:28