# Email to index generators

### e2i_inc()
    Incremental email to index generator.

    Unique key will be returned for each email recipient. You can use
    another e2i generator to convert it's value to unique.

    Usage: e2i_inc( )
       or: e2i_inc(e2i_...(...))

    Example: e2i_inc(e2i_regexp(...))

    New in version 0.7.0.

### e2i_regexp()
    Regular expression based email to index generator.

    Recipient emails are tested against regular expressions and after first
    match it's index will be returned.

    Usage: e2i_regexp([['reg1','SCANNER_NAME'],[...]])

    Example: e2i_regexp([['^login@foo.edu','FILTER1']])

    New in version 0.7.0.

### e2i_sql()
    SQL based email to index generator.

    Email recipients are searched in an supported SQL database. Each line
    contains three values (index,email,priority). First match ordered
    by priority will be returned.

    Usage: e2i_sql(db_connection, query="SELECT idx FROM e2i " \
                                       +"WHERE '%s' LIKE email ORDER BY prio")

    Where: db_connection is an database connectim. For more information see
             Databases.txt file.

    Example: e2i_sql(db.sqlite(dbname='/etc/scanner_idx.sqlite'))

    New in version 0.7.0.