Remaining things to remove mostly per the 80/20 rule hga@xxxxxx (11 Aug 2019 14:35 UTC)
Re: Remaining things to remove mostly per the 80/20 rule Lassi Kortela (11 Aug 2019 15:10 UTC)
Re: Remaining things to remove mostly per the 80/20 rule Lassi Kortela (11 Aug 2019 15:15 UTC)
gecos parser implementation Lassi Kortela (11 Aug 2019 17:30 UTC)
Re: gecos parser implementation John Cowan (12 Aug 2019 04:07 UTC)
Re: Remaining things to remove mostly per the 80/20 rule Lassi Kortela (12 Aug 2019 12:02 UTC)
Re: Remaining things to remove mostly per the 80/20 rule Lassi Kortela (12 Aug 2019 11:52 UTC)
Re: Remaining things to remove mostly per the 80/20 rule Lassi Kortela (12 Aug 2019 12:21 UTC)
Re: Remaining things to remove mostly per the 80/20 rule Lassi Kortela (12 Aug 2019 13:44 UTC)
Timezone files Lassi Kortela (12 Aug 2019 14:00 UTC)
GECOS field parsing Lassi Kortela (17 Aug 2019 08:52 UTC)
Re: GECOS field parsing Lassi Kortela (17 Aug 2019 09:11 UTC)
Re: GECOS field parsing Lassi Kortela (17 Aug 2019 09:16 UTC)
Re: GECOS field parsing Lassi Kortela (17 Aug 2019 09:35 UTC)
Re: GECOS field parsing Lassi Kortela (17 Aug 2019 09:56 UTC)
Re: Remaining things to remove mostly per the 80/20 rule Lassi Kortela (12 Aug 2019 12:39 UTC)

GECOS field parsing Lassi Kortela 17 Aug 2019 08:51 UTC

>> Should & substitution be done on all parts, or only the full name proper?
>
> I don't know. I'll ask on Unix Stack Exchange.

Well, I didn't get an answer from there but GitHub code search is
awesome. A simple search for "gecos" across the entire FreeBSD source
tree and behold: sendmail expands that stuff!

<https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee94b59fdbc12e0c566fd0/contrib/sendmail/libsm/mbdb.c#L206>

Thie is probably as canonical as anything. Delivering the world's mail
traffic provides ample test data and mail is a high priority to fix.

So it splits GECOS into fields - not only at commas, but also at
semicolons and percent signs. Perhaps as a security measure if those are
problematic for mail headers.

It expands an arbitrary number of ampersands in the first GECOS field
(but the output buffer size is limited; if it overflows, sendmail just
uses the Unix username instead of the full name).

Since sendmail only needs the first field, we unfortunately don't get an
answer to ampersands in the other fields.