pike.git / lib / modules / Protocols.pmod / LMTP.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/LMTP.pmod:51:    log(describe_backtrace(err));    continue;    }    outcode(getretcode(check), geterrorstring(check));    }    }   }      //! A LMTP server. It has been fairly well tested against Postfix client.   //! Actually this module is only an extention to the @[SMTP] server. + //! + //! It implements @rfc{2821@}, @rfc{2822@}, @rfc{2033@} and @rfc{1854@}.   class Server { -  static object fdport; +  protected object fdport;    Configuration config;    -  static void accept_callback() +  protected void accept_callback()    {    object fd = fdport->accept();    if(!fd)    error("Can't accept connections from socket\n");    Connection(fd, config);    destruct(fd);    }       //! @decl void create(array(string) _domains, void|int port,@    //! void|string ip, function _cb_mailfrom,@    //! function _cb_rcptto, function _cb_data) -  //! Create a receiving LMTP server. It implements RFC 2821, 2822, 2033 and -  //! 1854. +  //! Create a receiving LMTP server.    //!    //! @param domain    //! Domains name this server relay, you need to provide at least one    //! domain (the first one will be used for MAILER-DAEMON address).    //! if you want to relay everything you can put a '*' after this    //! first domain.    //! @param port    //! Port this server listen on    //! @param listenip    //! IP on which server listen
pike.git/lib/modules/Protocols.pmod/LMTP.pmod:138:    //!    //! int main(int argc, array(string) argv)    //! {    //! Protocols.LMTP.Server(({ "ece.fr" }), 2500, "127.0.0.1", @    //! cb_mailfrom, cb_rcptto, cb_data);    //! return -1;    //! }    void create(array(string) _domains, void|int port, void|string ip, function _cb_mailfrom, function _cb_rcptto, function _cb_data)    {    config = Configuration(_domains, _cb_mailfrom, _cb_rcptto, _cb_data); -  random_seed(getpid() + time()); +     if(!port)    port = 25;    fdport = Stdio.Port(port, accept_callback, ip);    if(!fdport)    {    error("Cannot bind to socket, already bound ?\n");    }    }   }