This is a thread to discuss [further] modularization of sg code. Currently, the web code and the mail code are wholly distinct, but they're starting to share more functions, as we add the "send the first message" feature. Here's the state of things:
spameater doesn't use modules of it's own, and it has the spamgourmet.config file for configuration info.
the web code does have modules:
1) WebConfig.pm - provides the database connection and configuration data, which is hard coded in the module (no config file)
2) Session.pm - provides web session management functionality, and wraps CGI.pm and Dialogs.pm
3) Dialogs.pm - provides the translated versions of dialogs
4) Page.pm - provides template building functionality
Here's what we could do:
a) rename WebConfig.pm to be SpamgourmetConfig.pm, or something, and cause it to read configuration data from a config file. Both the web code and spameater code can then use it for database and configuration params.
b) add a new module SpamgourrmetUtils.pm that contains the code that is shared between spameater and the web code
Then, we'd deploy the same module set for both web and mail:
spameater would load and use SpamgourmetConfig.pm and SpamgourmetUtils.pm, and leave the others alone, and the web code could start using SpamgourmetUtils.pm to access the shared code.
spameater could perhaps use Dialogs.pm for translations of the Subject tagline (currently, it's English-only). I believe the module already supports loading different sets of dialogs, so that spameater wouldn't have to load up the big set of web dialogs. We would have the restriction that subject text be in ascii -- the full utf-8 set isn't supported by SMTP, AFAIK -- that could be hairy.
Does that sound good?