Hello again!

i wrote:
 |Afan <snailm...@ottenheimer.com> wrote:
 ||> If you use the -u command line option or set the $USER environment
 ||> variable, then we fetch that specified user identity, instead of
 ||> deducing the one that is implied by "you" as the person who is
 ||> running the script. 
 ||
 ||I tested -u and got this error: 
 ||
 ||    The -u option cannot be used in send mode
 |
 |Oh!  Indeed we yet follow the POSIX standard which defines -u only
 |for receive mode (as «Read the system mailbox of the login name
 |user»), which is of course wrong.  (It was always more in the BSD
 |Mail codebase.)  I'll fix that in a minute!

So that finally made me think and i've spent the day redefining
what this MUA does.  In the future:

  . "-u USER" is exactly the same as "-f %USER".

  . upon startup we verify that $LOGNAME is set to the name of the
    active user, and correct as necessary, and complain, then.

  . shall $USER be set, we do the same [with it].

  . $LOGNAME and $USER are now readonly [thereafter].

Well, the problem of the BSD Mail codebase has always been that
the argument to -u is used for quite a lot of internal things
(like the so-called From_ line of MBOX mailboxes and, yes...,
a consideration of who YOU are).  Until now i dragged this along,
only added verification code that ensures that the given user was
a valid one.

I really think you pointed out something important here, and
i hope the new situation reflects more what the standard really
means.  Really "impersonating" as the -u USER would be something
really, really different and is possibly better accomplished with
su(1) or similar.

Once more: thanks -- this will be in v14.9!
Ciao!

--steffen

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
__________________________________
S-nail-users@lists.sourceforge.net

Reply via email to