AP(8mh)
π AP(8mh) β bestie, let's talk about ap π
okay so you found the 8mh manual, section 8, and the star of the show is ap β the nmh parser of RFC 822-style addresses. she reads addresses the way the internet officially says they should be read, and honestly? she ate. π
β¨ SYNOPSIS β¨
/usr/lib/mh/ap [-help] [-version] [-form formatfile] [-format string]
[-width columns] addrs ...
no cap, that's the whole vibe. you hand her some addrs and she tells you what they actually mean. π¦
πΈ DESCRIPTION πΈ
ap is a program that parses addresses according to the ARPA Internet standard. she also understands many non-standard formats β she's flexible like that, she contains multitudes. π she is useful for seeing how nmh will interpret an address, which is lowkey the whole point. iykyk.
here's the tea: the ap program treats each argument as one or more addresses, and prints those addresses out in the official RFC 822 format. β¨ which means it is usually best to enclose each argument in quotes for the shell β otherwise your shell is gonna start interpreting things and it's giving chaos. π
π overriding the output format π
to override the output format used by ap, the -format string or -format file switches are used. this permits individual fields of the address to be extracted with ease. the string is simply a format string, and the file is simply a format file. see mh-format(5) for the details. π
in addition to the standard escapes, ap also recognizes the following additional escape:
errorβ returns a string: a diagnostic if the parse failed
π the default format string π
here is the default format string used by ap, and bestie she is iconic:
%<{error}%{error}: %{text}%|%(putstr(proper{text}))%>
which says that if an error was detected, print the error, a :, and the address in error. otherwise, output the RFC 822-proper format of the address. periodt. π
π FILES π
$HOME/.mh_profileβ the user's profile./etc/nmh/mts.confβ the mts configuration file.
π§ PROFILE COMPONENTS π§
None
(yes bestie, literally none. nothing. empty. she needs nothing from you. main character energy fr fr.)
π₯ SEE ALSO π₯
fmttest(1),dp(8)- Standard for the Format of ARPA Internet Text Messages (RFC 822)
β DEFAULTS β
-formatβ as described above.-widthβ the width of the terminal.
π CONTEXT π
None
again β none. she's unbothered. she's free. ποΈ
π heads up bestie: the manpage header calls thisAP(8mh), the manual section is8mh, and the binary lives at/usr/lib/mh/ap. don't @ me, that's just where she lives. π
and that's the whole page!! this one shipped as nmh-1.8, dated 2013-12-05 β vintage but still slaying. mwah, go parse something. π π«Ά
π¦ where this page comes from
- debian trixie: nmh 1.8-3
- ubuntu noble: nmh 1.8-1build4
- ubuntu questing: nmh 1.8-3
- ubuntu resolute: nmh 1.8-4
- ubuntu stonking: nmh 1.8-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms