2
I Use This!
Activity Not Available

News

Analyzed 4 months ago. based on code collected 11 months ago.
Posted about 13 years ago by [email protected] (Manvendra Bhangui)
IndiMail uses MySQL for storing information of virtual domain users. The table 'indimail' stores important user information like password, access permissions, quota and the mailbox path. Most of user related queries have to lookup the 'indimail' ... [More] table in MySQL. Rather than making individual connections to MySQL for extracting information from the 'indimail' table, IndiMail programs use the service of the inlookup(8) server. Programs use an API function inquery() to request service. InLookup is a connection pooling server to serve requests for inquery() function. It is implemented over two fifos. One fixed fifo for reading the query and reading the path of a randomly generated fifo. The randomly generated fifo is used for writing the result of the query back. inlookup(8) creates a read FIFO determined by the environment variable INFIFO. If INFIFO is not defined, the default FIFO used is /var/indimail/inquery/infifo. inlookup(8) then goes into an infinite loop reading this FIFO. If INFIFO is not an absolute path, inlookup(8) uses environment variable FIFODIR to look for fifo named by INFIFO variable. Inlookup(8) can be configured by setting environment variables in /service/inlookup.info/variables inlookup helps in optimizing connection to MySQL(1), by keeping the connections persistent. It also maintains the query result in a double link list. It uses binary tree algorithm to search the cache before actually sending the query to the database. IndiMail clients send requests for MySQL(1) queries to inlookup through the function inquery() using a fifo. The inquery() API uses the InLookup service only if the environment variable QUERY_CACHE is set. If this environment variable is not set, the inquery() function makes a direct connecton to MySQL. Clients which are currently using inquery are qmail-smtpd(1), proxyimap(8), proxypop3(8), vchkpass(8) and authindi(8). inlookup(8) service is one of the reasons why IndiMail is able to serve million+ users using commodity hardware. The program inquerytest simulates all the queries which inlookup supports and can be used as a test/diagnostic tool for submitting queries to inlookup. e.g % sudo inquerytest -q 3 -i "" [email protected] [Less]
Posted about 13 years ago by [email protected] (Manvendra Bhangui)
IndiMail uses MySQL for storing information of virtual domain users. The table 'indimail' stores important user information like password, access permissions, quota and the mailbox path. Most of user related queries have to lookup the 'indimail' ... [More] table in MySQL.Rather than making individual connections to MySQL for extracting information from the 'indimail' table, IndiMail programs use the service of the InLookup(8) server. Programs use an API function inquery() to request service.  InLookup  is  a connection pooling server to serve requests for inquery() function. It is implemented over two fifos. One fixed fifo for reading the query  and  reading  the  path of a randomly generated fifo. The randomly generated fifo is used for writing the result of the query back. InLookup  helps  in optimizing connection to MySQL(1), by keeping the connections persistent.  IndiMail clients send requests for MySQL(1) queries to InLookup through the function  inquery()  using  a  fifo. The inquery() API uses the InLookup service only if the environment variable QUERY_CACHE is set. If this environment variable is not set, the inquery() funcation makes a direct connecton to MySQL. Clients which are currently using inquery are qmail-smtpd(1), proxyimap(8), proxypop3(8), vchkpass(8) and authindi(8). InLookup(8) service is one of the reasons why IndiMail is able to serve million+ users using commodity hardware.The  program  inquerytest simulates all the queries which InLookup supports and can be used as a test/diagnostic tool for submitting queries to InLookup. [Less]
Posted about 13 years ago by [email protected] (Cprogrammer)
IndiMail now has a plugin functionality for qmail-smtpd. You can write your own plugin to carry out tasks during the MAIL, RCPT or the DATA phase of SMTP.  See the man page for plugin_init(3) for details. NAME plugin_init() - Template for Dynamic ... [More] SMTP Plugins SYNTAX #include smtp_plugin.h char *from_plug(char *rip, char *from, char **mesg); char *rcpt_plug(char *rip, char *from, char *rcpt, char **mesg); char *data_plug(char *local, char *rip, char *rhost, char *rinfo, char **mesg); PLUGIN *plugin_init(); typedef struct { int (*mail_func) (char *, char *, char **); int (*rcpt_func) (char *, char *, char *, char **); int (*data_func) (char *, char *, char *, char *, char **); } PLUGIN; DESCRIPTION PLUGIN structure has three components: mail_func is a pointer to function to be exe‐ cuted in the SMTP MAIL session. rcpt_func is a pointer to function to be executed in the SMTP RCPT session. data_func is a pointer to function to be executed in the SMTP DATA session. To write a SMTP plugin you have to write the plugin_init() function. Depending on which phase of SMTP (MAIL, RCPT, DATA) you want to call your function, you have to write the from_plug, rcpt_plug, data_plug functions. The plugin_init() function can be written as below PLUGIN * plugin_init() { static PLUGIN plug; PLUGIN *ptr; ptr = &plug; ptr->mail_func = from_plug; ptr->rcpt_func = rcpt_plug; ptr->data_func = data_plug; return &plug; } To compile the plugin you can use gcc(1). gcc -shared -rdynamic -nostartfiles -fPIC -s -O4 -o smtpd-plugin.so smtp_plugin.o RETURN VALUE The functions from_plug, rcpt_plug, data_plug must return 0 on success. These func‐ tions should return 1 to terminate the sesson with a message. You can set your own message by assigning mesg variable. If you have the below function in smtpd-plugin.so int rcpt_plug(char *remoteip, char *from, char *rcpt, char **mesg) { if (!strstr(rcpt, "@yahoo.com")) { *mesg = "530 We are serious and don't Yahoo (#5.7.1) return (1); } return (0); } SEE ALSO qmail-smtpd(8), dlopen(3), gcc(1) [Less]
Posted about 13 years ago by [email protected] (Manvendra Bhangui)
IndiMail now has a plugin functionality for qmail-smtpd. You can write your own plugin to carry out tasks during the MAIL, RCPT or the DATA phase of SMTP.  See the man page for plugin_init(3) for details.NAMEplugin_init() - Template for Dynamic SMTP ... [More] PluginsSYNTAX#include smtp_plugin.hchar *from_plug(char *rip, char *from, char **mesg);char *rcpt_plug(char *rip, char *from, char *rcpt, char **mesg);char *data_plug(char *local, char *rip, char *rhost, char *rinfo, char **mesg);PLUGIN *plugin_init();typedef struct{int (*mail_func) (char *, char *, char **);int (*rcpt_func) (char *, char *, char *, char **);int (*data_func) (char *, char *, char *, char *, char **);} PLUGIN;DESCRIPTIONPLUGIN structure has three components: mail_func is a pointer to function to be exe‐cuted in the SMTP MAIL session. rcpt_func is a pointer to function to be executed inthe SMTP RCPT session. data_func is a pointer to function to be executed in the SMTPDATA session.To write a SMTP plugin you have to write the plugin_init() function. Depending onwhich phase of SMTP (MAIL, RCPT, DATA) you want to call your function, you have towrite the from_plug, rcpt_plug, data_plug functions.The plugin_init() function can be written as belowPLUGIN *plugin_init(){static PLUGIN plug;PLUGIN *ptr;ptr = &plug;ptr->mail_func = from_plug;ptr->rcpt_func = rcpt_plug;ptr->data_func = data_plug;return &plug;}To compile the plugin you can use gcc(1).gcc -shared -rdynamic -nostartfiles -fPIC -s -O4 -o smtpd-plugin.so smtp_plugin.oRETURN VALUEThe functions from_plug, rcpt_plug, data_plug must return 0 on success. These func‐tions should return 1 to terminate the sesson with a message. You can set your ownmessage by assigning mesg variable. If you have the below function in smtpd-plugin.sointrcpt_plug(char *remoteip, char *from, char *rcpt, char **mesg){if (!strstr(rcpt, "@yahoo.com")){*mesg = "530 We are serious and don't Yahoo (#5.7.1)return (1);}return (0);}SEE ALSOqmail-smtpd(8), dlopen(3), gcc(1) [Less]
Posted about 13 years ago by [email protected] (Cprogrammer)
IndiMail now has a plugin functionality for qmail-smtpd. You can write your own plugin to carry out tasks during the MAIL, RCPT or the DATA phase of SMTP.  See the man page for plugin_init(3) for details.NAMEplugin_init() - Template for Dynamic SMTP ... [More] PluginsSYNTAX#include smtp_plugin.hchar *from_plug(char *rip, char *from, char **mesg);char *rcpt_plug(char *rip, char *from, char *rcpt, char **mesg);char *data_plug(char *local, char *rip, char *rhost, char *rinfo, char **mesg);PLUGIN *plugin_init();typedef struct{int (*mail_func) (char *, char *, char **);int (*rcpt_func) (char *, char *, char *, char **);int (*data_func) (char *, char *, char *, char *, char **);} PLUGIN;DESCRIPTIONPLUGIN structure has three components: mail_func is a pointer to function to be exe‐cuted in the SMTP MAIL session. rcpt_func is a pointer to function to be executed inthe SMTP RCPT session. data_func is a pointer to function to be executed in the SMTPDATA session.To write a SMTP plugin you have to write the plugin_init() function. Depending onwhich phase of SMTP (MAIL, RCPT, DATA) you want to call your function, you have towrite the from_plug, rcpt_plug, data_plug functions.The plugin_init() function can be written as belowPLUGIN *plugin_init(){static PLUGIN plug;PLUGIN *ptr;ptr = &plug;ptr->mail_func = from_plug;ptr->rcpt_func = rcpt_plug;ptr->data_func = data_plug;return &plug;}To compile the plugin you can use gcc(1).gcc -shared -rdynamic -nostartfiles -fPIC -s -O4 -o smtpd-plugin.so smtp_plugin.oRETURN VALUEThe functions from_plug, rcpt_plug, data_plug must return 0 on success. These func‐tions should return 1 to terminate the sesson with a message. You can set your ownmessage by assigning mesg variable. If you have the below function in smtpd-plugin.sointrcpt_plug(char *remoteip, char *from, char *rcpt, char **mesg){if (!strstr(rcpt, "@yahoo.com")){*mesg = "530 We are serious and don't Yahoo (#5.7.1)return (1);}return (0);}SEE ALSOqmail-smtpd(8), dlopen(3), gcc(1) [Less]
Posted about 13 years ago by [email protected] (Cprogrammer)
IndiMail provides close to around 300 different programs as part of a flexible Enterprise Messaging Platform. You can carry administer the entire platform with around 45 of these programs. A program called indisrvr(8) provides a way for users to ... [More] secure execute these commands from any remote location. To execute these programs, you need to have an admin account on the IndiMail server. These accounts can be created by the mgmtpass(8) program. Once you have an admin account on the IndiMail server, you can further restrict users to certain programs using the vpriv(8) program. vpriv can further modify privileges by allowing only certain options within a allowed program.To execute these programs on the IndiMail server, you need to connect to port 4000 and use the adminclient protocol. The adminclient protocol is described below by showing a conversation between a client and the server 'indisrvr's - denotes serverc - denotes client        s: "Login: "        c: "userid\n"        s: "Password: "        c: "password\n"        s: "OK\n"        c: "index command arg1 arg2 ...\n"        s:         c: "\n"        s: "RETURNSTATUS[return value of command]\n"To execute 'vuserinfo' you will need to do the following.        % telnet 0 4000        Trying 0.0.0.0...        Connected to 0.        Escape character is '^]'.        Login: admin        Password: benhur20        OK        7 vuserinfo -n [email protected]        name          : [email protected]                RETURNSTATUS0Index value of '7' was used for vuserinfo. A privileged user 'admin' with password 'benhur20' was used to execute vuserinfo. Each command has an index. The values are given as below.Index Commands----- --------00    vadduser01    vpasswd02    vdeluser03    vsetuserquota04    vbulletin05    vmoduser06    valias07    vuserinfo08    vipmap09    vacation10    vmoveuser11    vrenameuser12    crc13    vcfilter14    indiversion15    vsmtp16    dbinfo17    vhostid18    mgmtpass19    inquerytest20    printdir21    shit22    vaddaliasdomain23    vadddomain24    vcalias25    vcaliasrev.sh26    vconvert27    vdeldomain28    vrenamedomain29    vdominfo30    vfstab31    vgroup32    vatrn33    vpriv34    vlimit35    hostcntrl36    execmysql37    updatefile38    vreorg39    vdeloldusers40    ipchange41    svctool42    clearopensmtp43    hostsync44    inquerytest45    vmoddomain If you have a user provisioning interface written in your favourite language, you can connect to the port 4000 and execute the above programs. IndiMail also provides you a command line program 'adminclient' which can execute any of the above programs. Read the man page for adminclient for further details. [Less]
Posted about 13 years ago by [email protected] (Cprogrammer)
IndiMail provides close to around 300 different programs as part of a flexible Enterprise Messaging Platform. You can carry administer the entire platform with around 45 of these programs. A program called indisrvr(8) provides a way for users to ... [More] secure execute these commands from any remote location. To execute these programs, you need to have an admin account on the IndiMail server. These accounts can be created by the mgmtpass(8) program. Once you have an admin account on the IndiMail server, you can further restrict users to certain programs using the vpriv(8) program. vpriv can further modify privileges by allowing only certain options within a allowed program. To execute these programs on the IndiMail server, you need to connect to port 4000 and use the adminclient protocol. The adminclient protocol is described below by showing a conversation between a client and the server 'indisrvr' s - denotes server c - denotes client         s: "Login: "         c: "userid\n"         s: "Password: "         c: "password\n"         s: "OK\n"         c: "index command arg1 arg2 ...\n"         s:         c: "\n"         s: "RETURNSTATUS[return value of command]\n" To execute 'vuserinfo' you will need to do the following.         % telnet 0 4000        Trying 0.0.0.0...        Connected to 0.        Escape character is '^]'.        Login: admin        Password: benhur20        OK        7 vuserinfo -n [email protected]        name          : [email protected]                RETURNSTATUS0 Index value of '7' was used for vuserinfo. A privileged user 'admin' with password 'benhur20' was used to execute vuserinfo. Each command has an index. The values are given as below. Index Commands ----- -------- 00    vadduser 01    vpasswd 02    vdeluser 03    vsetuserquota 04    vbulletin 05    vmoduser 06    valias 07    vuserinfo 08    vipmap 09    vacation 10    vmoveuser 11    vrenameuser 12    crc 13    vcfilter 14    indiversion 15    vsmtp 16    dbinfo 17    vhostid 18    mgmtpass 19    inquerytest 20    printdir 21    shit 22    vaddaliasdomain 23    vadddomain 24    vcalias 25    vcaliasrev.sh 26    vconvert 27    vdeldomain 28    vrenamedomain 29    vdominfo 30    vfstab 31    vgroup 32    vatrn 33    vpriv 34    vlimit 35    hostcntrl 36    execmysql 37    updatefile 38    vreorg 39    vdeloldusers 40    ipchange 41    svctool 42    clearopensmtp 43    hostsync 44    inquerytest 45    vmoddomain If you have a user provisioning interface written in your favourite language, you can connect to the port 4000 and execute the above programs. IndiMail also provides you a command line program 'adminclient' which can execute any of the above programs. Read the man page for adminclient for further details. [Less]
Posted about 13 years ago by [email protected] (Manvendra Bhangui)
IndiMail provides close to around 300 different programs as part of a flexible Enterprise Messaging Platform. You can carry administer the entire platform with around 45 of these programs. A program called indisrvr(8) provides a way for users to ... [More] secure execute these commands from any remote location. To execute these programs, you need to have an admin account on the IndiMail server. These accounts can be created by the mgmtpass(8) program. Once you have an admin account on the IndiMail server, you can further restrict users to certain programs using the vpriv(8) program. vpriv can further modify privileges by allowing only certain options within a allowed program.To execute these programs on the IndiMail server, you need to connect to port 4000 and use the adminclient protocol. The adminclient protocol is described below by showing a conversation between a client and the server 'indisrvr's - denotes serverc - denotes client        s: "Login: "        c: "userid\n"        s: "Password: "        c: "password\n"        s: "OK\n"        c: "index command arg1 arg2 ...\n"        s:         c: "\n"        s: "RETURNSTATUS[return value of command]\n"To execute 'vuserinfo' you will need to do the following.        % telnet 0 4000         Trying 0.0.0.0...         Connected to 0.         Escape character is '^]'.         Login: admin         Password: benhur20         OK         7 vuserinfo -n [email protected]         name          : [email protected]                  RETURNSTATUS0 Index value of '7' was used for vuserinfo. A privileged user 'admin' with password 'benhur20' was used to execute vuserinfo. Each command has an index. The values are given as below. Index Commands----- --------00    vadduser01    vpasswd02    vdeluser03    vsetuserquota04    vbulletin05    vmoduser06    valias07    vuserinfo08    vipmap09    vacation10    vmoveuser11    vrenameuser12    crc13    vcfilter14    indiversion15    vsmtp16    dbinfo17    vhostid18    mgmtpass19    inquerytest20    printdir21    shit22    vaddaliasdomain23    vadddomain24    vcalias25    vcaliasrev.sh26    vconvert27    vdeldomain28    vrenamedomain29    vdominfo30    vfstab31    vgroup32    vatrn33    vpriv34    vlimit35    hostcntrl36    execmysql37    updatefile38    vreorg39    vdeloldusers40    ipchange41    svctool42    clearopensmtp43    hostsync44    inquerytest45    vmoddomain If you have a user provisioning interface written in your favourite language, you can connect to the port 4000 and execute the above programs. IndiMail also provides you a command line program 'adminclient' which can execute any of the above programs. Read the man page for adminclient for further details. [Less]
Posted about 13 years ago by [email protected] (Manvendra Bhangui)
IndiMail provides close to around 300 different programs as part of a flexible Enterprise Messaging Platform. You can carry administer the entire platform with around 45 of these programs. A program called indisrvr(8) provides a way for users to ... [More] secure execute these commands from any remote location. To execute these programs, you need to have an admin account on the IndiMail server. These accounts can be created by the mgmtpass(8) program. Once you have an admin account on the IndiMail server, you can further restrict users to certain programs using the vpriv(8) program. vpriv can further modify privileges by allowing only certain options within a allowed program.To execute these programs on the IndiMail server, you need to connect to port 4000 and use the adminclient protocol. The adminclient protocol is described below by showing a conversation between a client and the server 'indisrvr's - denotes serverc - denotes client        s: "Login: "        c: "userid\n"        s: "Password: "        c: "password\n"        s: "OK\n"        c: "index command arg1 arg2 ...\n"        s:         c: "\n"        s: "RETURNSTATUS[return value of command]\n"To execute 'vuserinfo' you will need to do the following.        % telnet 0 4000         Trying 0.0.0.0...         Connected to 0.         Escape character is '^]'.         Login: admin         Password: benhur20         OK         7 vuserinfo -n [email protected]         name          : [email protected]                  RETURNSTATUS0 Index value of '7' was used for vuserinfo. A privileged user 'admin' with password 'benhur20' was used to execute vuserinfo. Each command has an index. The values are given as below. Index Commands----- --------00    vadduser01    vpasswd02    vdeluser03    vsetuserquota04    vbulletin05    vmoduser06    valias07    vuserinfo08    vipmap09    vacation10    vmoveuser11    vrenameuser12    crc13    vcfilter14    indiversion15    vsmtp16    dbinfo17    vhostid18    mgmtpass19    inquerytest20    printdir21    shit22    vaddaliasdomain23    vadddomain24    vcalias25    vcaliasrev.sh26    vconvert27    vdeldomain28    vrenamedomain29    vdominfo30    vfstab31    vgroup32    vatrn33    vpriv34    vlimit35    hostcntrl36    execmysql37    updatefile38    vreorg39    vdeloldusers40    ipchange41    svctool42    clearopensmtp43    hostsync44    inquerytest45    vmoddomain If you have a user provisioning interface written in your favourite language, you can connect to the port 4000 and execute the above programs. IndiMail also provides you a command line program 'adminclient' which can execute any of the above programs. Read the man page for adminclient for further details. [Less]
Posted over 13 years ago by [email protected] (Cprogrammer)
Some mail providers like hotmail, yahoo restrict the number of connections from a single IP and the number of mails that can be delivered in an hour from a single IP. To increase your ability to deliver large number of genuine emails from your users ... [More] to such sites, you may want to send out mails from multiple IP addresses.IndiMail has the ability to call a custom program instead of qmail-local(8) or qmail-remote(8). This is done by defining the environment variable QMAILLOCAL or QMAILREMOTE. qmail-remote(8) can use the environment variable OUTGOINGIP to set the IP address of the local interface when making outgoing connections. By writing a simple script and setting QMAILREMOTE environment variable pointing to this script, one can randomly chose an IP address from the control file/var/indimail/control/outgoingipThe script below also allows you to define multiple outgoing IP addresses for a single host. e.g. you can create the control file to send out mails from multiple IPs only for the domain hotmail.com/var/indimail/control/outgoingip.hotmail.comLet us name the below script balance_outgoing% su# echo "/var/indimail/bin/balance_outgoing" > /service/qmail-send.25/variables/QMAILREMOTE# svc -d /service/qmail-send.25# svc -u /service/qmail-send.25# exit%Finally the balance_outgoing script can be placed with execute bit in /var/indimail/bin#!/bin/sh# This scripts expects qmail-remote arguments on command line# argv0          - qmail-remote# argv1          - host   (host)# argv2          - sender (sender)# argv3          - qqeh   (qmail queue extra header)# argv4          - size# argv5 .. argvn - recipients# #host=$1sender=$2qqeh=$3size=$4shift 4cd /var/indimailif [ " $CONTROLDIR" = " " ] ; then    FN=/var/indimail/control/filterargselse    FN=$CONTROLDIR/filterargsfiif [ -n "$SPAMFILTER" -o -n "$FILTERARGS" -o -f $FN ] ; then    # execute spawn-filter if you have filters defined for remote/local deliveries    PROG="bin/spawn-filter"else    PROG="bin/qmail-remote"fiif [ " $CONTROLDIR" = " " ] ; then    if [ -f /var/indimail/control/outgoingip.$host ] ; then        IP=(`cat /var/indimail/control/outgoingip.$host`)    elif [ -f /var/indimail/control/outgoingip ] ; then        IP=(`cat /var/indimail/control/outgoingip`)    else        exec -a qmail-remote $PROG "$host" "$sender" "$qqeh" $size $*    fielse    if [ -f $CONTROLDIR/outgoingip.$host ] ; then        IP=(`cat $CONTROLDIR/outgoingip.$host`)    elif [ -f $CONTROLDIR/outgoingip ] ; then        IP=(`cat $CONTROLDIR/outgoingip`)    else        exec -a qmail-remote $PROG "$host" "$sender" "$qqeh" $size $*    fifiIP_COUNT=${#IP[*]}if [ $IP_COUNT -gt 1 ] ; then    i=`expr $RANDOM % $IP_COUNT`    export OUTGOINGIP=${IP[$i]}fiexec -a qmail-remote $PROG "$host" "$sender" "$qqeh" $size $* [Less]