[spambayes-dev] pop3proxy binaries

Mark Hammond mhammond at skippinet.com.au
Fri Aug 29 23:18:14 EDT 2003


> > * We should ensure only 1 proxy is running on the machine
> (ie, prevent
> > starting either the service or the .exe twice)
>
> It's not quite as simple as that

Indeed.

> Whether that's relevant for a binary release I
> don't know -
> perhaps the binary release should be simplified.

I vote we go that option.  However, my "simplified" isn't <wink/frown>

> > * We should think about where the databases are stored (the
> > "program files" directory where we install is probably not
> > appropriate - but a "per user" database directory makes no
> > sense for a .exe

Doh - I meant "for a service".

>
> SHGetFolderPath(CSIDL_APPDATA)?

Unfortunately, this is "per user".  For a service logged on as the "system"
user, this would be a problem (as it would mean a "default service" and a
standard .exe would have different directories.

How about this for a first cut:
* A service installed, but configured for the system user is considered
"unconfigured", and will refuse to start.
* A mutex named something like "SpamBayes\{username}" is always created -
service and .exe.  GetCurrentUser() is used to create the mutex name, and
SHGetFolderPath(CSIDL_APPDATA) is used.
* The "bootstrap" executable is always the "tray icon" program.  If the
mutex is alreay set, then it simply offers to launch the UI and whatever
else we feel necessary.  If the mutex is not set, it runs the proxy in
process.

If this process detects the service running, it could present the exact same
UI as if the proxy was running in-process - except it would control the
service instead of running the proxy.  However, it doesn't sound like being
a tray icon is compatible with "RunServices" - but then again CSIDL_APPDATA
doesn't either - so maybe we just stick to being a "normal" tray icon
process on 9x?

Then for later versions someone else figures out what in that doens't work
:)

> > * Consider a "start_pop3proxy" program that "does the right
> thing" depending
> > on the platform and configuration.  Eg, it could start the
> correct program
> > (service if not running but installed, standard exe
> otherwise) and fire the
> > browser to the config URL if it detects it is unconfigured etc.
>
> The way I've envisaged this working (in an ideal world,
> because it would
> probably be a significant effort) is that there's one executable which
> gives you several options when you first run it:

I see no reason this needs to be one executable.  Each new exe under this
py2exe scheme is <30k, so we should be able to develop a "driver" program
that detects the environment, and delegates to the correct "sub-exe".

> I'd also love to see a traditional 'Windows executable'
> wrapper for the UI
> - just a wrapper that hosts the web UI in an embedded IE, and
> would run in
> a separate process,

Aww shucks, I could throw a Pythonwin based one of them together :)  At the
cost of around 1MB in the installer I just managed to remove (MFC) <wink>.

The Outlook dialog/wizard infrastructure works almost exclusively with
"OptionClass" objects - so a stand-alone Wizard that configured your options
would not be impossible.  Finding the time to do it is though <wink>

> or better, a separate (and totally
> independent) thread
> in the pop3proxy process.

That doesn't work for a service, but would work well for a tray-based icon
<wink>

hmmm - I think I will be able to come up with something :)

And Tony said:
> I have a basic one of these made already (it's pretty simple to make
> based on the demo that comes with the win32 extensions).  I can check it
> in if you think it's worth having.

Yes please. In the "windows" directory along with pop3proxy_service.py.

And I saw Tony ask about py2exe: It will be in the standard CVS version of
py2exe - but the sandbox directory.  You can download and configure this
tree now (but remember to run setup.py from sandbox).  None of the py2exe
samples are likely to work, but a simple "standard" py2exe script, as per
the docs, should (but there isn't one of them in the "samples" directory -
only advanced ones.)  I expect to check new code into that sandbox directory
before I go to bed :)

Mark.




More information about the spambayes-dev mailing list