On Thu, Jan 05, 2017 at 08:34:04AM +1100, martin f krafft wrote:
> also sprach Johannes Berg <johan...@sipsolutions.net> [2017-01-05 01:11 
> +1100]:
> > I'm not even sure how to get the username? Is it even generally
> > possible, if e.g. the plugin is running out of a process that's not
> > invoked through the imapd?
> 
> Well, the plugin certainly does seem to be run as the target user,
> or else how could it be used for user-specific training?

There's probably a lot of things we _could_ do ...

In the most general case getpwuid_r(geteuid(),...) should tell us who we
are running as, no matter how we are run - but that has potential icky,
since getting that name could involve a network access to LDAP or worse.

I'm not sure offhand if dovecot already (reliably) exposes it to us in
the environment we get from it - docs on that didn't pop out at me ...

Or worst case, we could make one, and let people do something like:

 antispam_log_prefix = %u

in their config, since dovecot will expand the %u for us ...
That has the advantage of letting them customise it if they have some
really crazy setup with multiple dovecot instances all logging to the
same place ...


But all of this kind of sets my XY problem overkill alarm off in a
variety of ways, so I think we ought to actually start at the top:

Martin, what _actual_ problem did you have to make you want this?
That might be something we can (also?) fix better and simpler?

  Ron

Reply via email to