datagram that we received, which leads to easier support for
(ignoring) the procmail messages that specify the folder to which
the message was delivered.
When reading the mailbox, if we encounter a "From " line, we should
exit(). This can occur if there are a lot of rapidly arriving, yet
short messages.
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
- KNF
- ensure hostname has trailling nul.
- use initgroups/setgid/setuid rather than just setuid, and do this earlier.
- find "from:" and "subject:" as well.
- use strvis(3) rather than some local crufty code.
This closes an apparent security problem on systems where users have
write access to the mail spool. Since root actually runs comsat, a
user could link their mail file to a system file that they normally
could not access, and use comsat to view said file. This fix simply
makes sure that the mail file is a REGular file.