MH & nmh: Email for Users & Programmers

May, 2006

replcomps before MH 6.8

Below is the format of replcomps lines 1-2 before MH 6.8. Or, here is the explanation for MH version 6.8 and later.

Lines 1 and 2 of the default replcomps file look like this before MH version 6.8:

    %(lit)%(formataddr %<{reply-to}%|%<{from}%|%<{sender}%|%<{return-path}%>%>%>%>)\
    %<(nonnull)%(void(width))%(putaddr To: )\n%>\
Those lines look for the best address in the original message. The %(lit) erases a storage register that'll hold the address. The %(formataddr ...) formats an address and stores it in the register. The rest of line 1, the argument to formataddr, chooses the address:
It's several nested if-else tests. It means: If none of those tests found the address they needed, we don't have a To: address for the reply.

Line 2 starts with a test (%<) that runs the (nonnull) function to see whether formataddr saved an address in line 1. If not, the test fails and line is skipped; no To: field is output. Otherwise, %(void(width)) saves the width of the address. (The Section scan Format Strings has more information about the string and numeric registers where those values are saved.) The %(putaddr To: )\n uses a function named putaddr. It gets the address field that was saved in line 1 and prints To: followed by the address and a newline character (\n). We've got the To: address, if any; the %> ends the test.