next up previous contents
Next: 4 Parametri a riga Up: Manuale di FreePOPs Previous: 2 Storia   Contents

Subsections

3 File di configurazione di FreePOPs

FreePOPs non ha bisogno di una vera configurazione. La maggior parte degli utenti non dovrebbe modificare il file di configurazione. Se siete sviluppatori o utenti curiosi il file di configurazione è config.lua, che si trova nella directory del programma sotto Win32 o in /etc/freepops/ in ambiente posix.

Più avanti vedremo come i plugin sono associati al dominio di un indirizzo di posta, e alcuni di questi plugin hanno alias per altri domini per rendere più facile la raccolta di news da alcuni siti. Leggete la documentazione dei plugin per maggiori informazioni su di essi, e magari inviate una mail con il vostro nuovo alias se volete che venga integrato nella prossima versione di FreePOPs.

Dalla versione 0.0.11 il file config.lua ha una sezione policy. In questa sezione potete escludere o accettare classi di indirizzi mail. Questo può essere utile ad amministratori di rete.

3.1 Simple load balancing

A simple way to run multiple instances of FreePOPs to serve the same pool of users is to use an additional instance of FreePOPs as a proxy that chooses to which FreePOPs instance each connection has to be forwarded. We will call the the proxy instance of FreePOPs master and the other running instances slaves. Consider also the simple case in which the number of concurrent connections accepted by each slave (parameter -t) is five and the number of slaves is three. you may want to run the master instance with the following command line:

freepopsd -c balance.lua -t 15 -p 110 -b 0.0.0.0

The configuration file balance.lua is

freepops.MODULES_MAP[".*"] = {
    name = "popforward.lua",
    regex = true,
    args = {
        host = function(mailaddress)
            local name = freepops.get_name(mailaddress)
            local slaves = {
                { rex = '^[0-9]',    host = "localhost", port = 2000 },
                { rex = '^[a-lA-l]', host = "localhost", port = 2001 },
                { rex = '^[m-zM-Z]', host = "localhost", port = 2002 },
            }
            local host, port = slaves[1].host, slaves[1].port -- defaults
            for _, slave in ipairs(slaves) do
                if string.match(name, slave.rex) then
                    host = slave.host
                    port = slave.port
                    break
                end
            end
            return host, port
        end
    }    
}
freepops.MODULES_PREFIX = {
    os.getenv("FREEPOPSLUA_PATH_UPDATES") or "./",
    os.getenv("FREEPOPSLUA_PATH") or "./",
    "./lua/", "./", "./src/lua/", "./modules/include/", "./modules/lib/"}
freepops.MODULES_CPREFIX = {
    os.getenv("FREEPOPSLUA_CPATH") or "./",
    "./c/", "./", "./updater-ui/fltk/" } 
freepops.MODULES_PREFIX_UNOFFICIAL = {
    os.getenv("FREEPOPSLUA_PATH_UNOFFICIAL") or "./",
    "./src/lua_unofficial/", }

The whole file is reported for completeness, but the last part is the standard one. The host parameter to the popforward plugin is a function returning different host and port according to the email address taken in input. This simple balancing mechanism is supported from version 0.2.6. Note that the master instance has to keep a connection open for every client.


next up previous contents
Next: 4 Parametri a riga Up: Manuale di FreePOPs Previous: 2 Storia   Contents
Enrico Tassi 2008-11-01