Net_Vpopmaild
[ class tree: Net_Vpopmaild ] [ index: Net_Vpopmaild ] [ all elements ]

Class: Net_Vpopmaild

Source Location: /Net_Vpopmaild-0.3.2/Vpopmaild.php

Class Overview

Net_Vpopmaild_Base
   |
   --Net_Vpopmaild

Net_Vpopmaild


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 38]
Net_Vpopmaild

A package for talking to vpopmaild over tcp/ip sockets. Vpopmail is a Virtual Mail add-on package for qmail and postfix.



[ Top ]


Class Variables

$modUserParms = array('stringParms' => array('quota',
                                    'comment',
                                    'clear_text_password'),'flagParms'=>array('no_password_change','no_pop','no_webmail','no_imap','no_smtp','bounce_mail','no_relay','no_dialup','user_flag_0','user_flag_1','user_flag_2','user_flag_3','system_admin_privileges','system_expert_privileges','domain_admin_privileges','override_domain_limits','no_spamassassin','no_maildrop','delete_spam'))

[line 50]

modUserParms

Array of string parameters and flag parameters that are used by modUser().


Type:   array


[ Top ]

$setLimitsParms = array('stringParms' => array('max_popaccounts',
                                        'max_aliases',
                                        'max_forwards',
                                        'max_autoresponders',
                                        'max_mailinglists', 
                                        'disk_quota',
                                        'max_msgcount',
                                        'default_quota',
                                        'default_maxmsgcount'),'flagParms'=>array('disable_pop','disable_imap','disable_dialup','disable_password_changing','disable_webmail','disable_external_relay','disable_smtp','disable_spamassassin','delete_spam','perm_account','perm_alias','perm_forward','perm_autoresponder','perm_maillist','perm_maillist_users','perm_maillist_moderators','perm_quota','perm_defaultquota'))

[line 84]

setLimitsParms

Array of string parameters and flag parameters that are used by setLimits().


Type:   array


[ Top ]



Method Detail

addAlias   [line 613]

bool addAlias( mixed $alias, mixed $destination)

addAlias

Add alias destination.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $alias     alias name
mixed   $destination     destination address

[ Top ]

addAliasDomain   [line 834]

bool addAliasDomain( mixed $domain, mixed $alias)

addAliasDomain

Add alias domain.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $domain     domain name
mixed   $alias     alias name

[ Top ]

addDomain   [line 812]

bool addDomain( string $domain, string $password)

addDomain

Add domain.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $domain     domain name
string   $password     password

[ Top ]

addIPMap   [line 240]

bool addIPMap( mixed $ip, mixed $domain)

addIPMap

Add IP Map entry. Requires vpopmail to have IP Alias Domains support compiled in.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $ip     ip address
mixed   $domain     domain name

[ Top ]

addUser   [line 902]

bool addUser( string $domain, string $user, string $password)

addUser

Add a user.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $domain     domain name
string   $user     user name
string   $password     password

[ Top ]

aliasesToArray   [line 1355]

array aliasesToArray( array $aliasArray)

aliasesToArray

Take raw listAlias() output, and format into associative arrays

  • Return: array of aliases
  • Access: protected

Parameters:

array   $aliasArray     aliases

[ Top ]

authenticate   [line 1121]

bool authenticate( string $email, string $password)

authenticate

Authenticate user based on email and password

  • Return: true on success, false on failure
  • Access: public

Parameters:

string   $email     email address
string   $password     password

[ Top ]

clogin   [line 126]

bool clogin( mixed $email, mixed $password)

clogin

compact login. Returns a compact list of user info which is stored in $loginUser

  • Return: true on success, false on failure
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $email     email address
mixed   $password     password

[ Top ]

delDomain   [line 854]

bool delDomain( mixed $domain)

delDomain

Delete domain.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $domain     domain name

[ Top ]

deleteAlias   [line 591]

bool deleteAlias( string $alias)

deleteAlias

Completely delete an alias.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $alias     alias name

[ Top ]

delIPMap   [line 262]

bool delIPMap( mixed $ip, mixed $domain)

delIPMap

Delete IP Map entry. Requires vpopmail to have IP Alias Domains support compiled in.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $ip     ip address
mixed   $domain     domain name

[ Top ]

delLimits   [line 714]

bool delLimits( mixed $domain)

delLimits

Delete vlimits on a domain.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $domain     domain name

[ Top ]

delUser   [line 924]

bool delUser( string $domain, string $user)

delUser

Delete a user.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $domain     domain name
string   $user     user name

[ Top ]

delVacation   [line 1313]

bool delVacation( string $user, string $domain, [string $vacationDir = 'vacation'])

delVacation

Delete vacation message.

  • Return: true on success, false on failure
  • Access: public

Parameters:

string   $user     user name
string   $domain     domain name
string   $vacationDir     vacation directory name, defaults to 'vacation'

[ Top ]

displayForwardLine   [line 1394]

string displayForwardLine( string $line)

displayForwardLine

Remove '&' prefix from a forward line for display.

  • Return: parsed forward string
  • Access: public

Parameters:

string   $line     forward line

[ Top ]

domainCount   [line 787]

int domainCount( )

domainCount

Count domains.

  • Return: count on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

[ Top ]

domainInfo   [line 735]

array domainInfo( mixed $domain)

domainInfo

Get domain info.

  • Return: dom_info array on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $domain     domain name

[ Top ]

dotQmailSplit   [line 315]

array dotQmailSplit( mixed $fileContents)

dotQmailSplit

Split .qmail file into an array.

  • Access: public

Parameters:

mixed   $fileContents     file contents

[ Top ]

findDomain   [line 875]

mixed findDomain( mixed $domain, [mixed $perPage = 0])

findDomain

Return page number that the domain occurs on.

  • Return: page number on success, null on on failure
  • Access: public

Parameters:

mixed   $domain     domain name
mixed   $perPage     domains per page

[ Top ]

getAliasContents   [line 1329]

string getAliasContents( mixed $contentsArray)

getAliasContents

Take array of alias destinations and format them as a comma delimited list (qmailadmin style)

  • Return: alias contents as string
  • Access: public

Parameters:

mixed   $contentsArray     alias contents

[ Top ]

getGidBit   [line 150]

bool getGidBit( mixed $bitmap, mixed $bit, [mixed $flip = false])

getGidBit

Get gid bit flag value.

  • Return: true on success, false on failure
  • See: Net_Vpopmaild::setGidBit()
  • Throws: Net_Vpopmaild_Exception if $bit is unknown
  • Access: public

Parameters:

mixed   $bitmap     bitmap
mixed   $bit     bit flag
mixed   $flip     flip it?

[ Top ]

getIPMap   [line 204]

string getIPMap( string $ip)

getIPMap

Get IP Map entry. Requires vpopmail to have IP Alias Domains support compiled in.

  • Return: domain on success, null on failure
  • Access: public

Parameters:

string   $ip     ip address

[ Top ]

getLastAuth   [line 1099]

array getLastAuth( string $domain, string $user)

getLastAuth

Get last authentication time and IP address as an array for a user.

  • Return: array('time' => (timestamp), 'ip' => IP (0.0.0.0 for none))
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $domain     domain name
string   $user     user name

[ Top ]

getLimits   [line 634]

array getLimits( mixed $domain)

getLimits

Get vlimits for a domain.

  • Return: limits array on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $domain     domain name

[ Top ]

getModUserParms   [line 942]

array getModUserParms( )

getModUserParms

Getter for $this->modUserParms

  • Return: modUserParms array
  • Access: public

[ Top ]

getQuota   [line 1218]

string getQuota( string $quota)

getQuota

Format a maildir++ quota as human readable (10MB).

  • Return: formatted quota string
  • Access: public

Parameters:

string   $quota     quota string

[ Top ]

getSetLimitsParms   [line 653]

array getSetLimitsParms( )

getSetLimitsParms

Getter for $this->setLimitsParms

  • Return: array
  • Access: public

[ Top ]

getVacation   [line 1241]

mixed getVacation( array $user_info, [string $line = ''])

Get Vacaation Message Contents

Parse .qmail line contents to get message subject and meessage body.

  • Return: vacation array on success, null on failure
  • Access: public

Parameters:

array   $user_info     user info
string   $line     .qmail line with path to vacation message. defaults to ''

[ Top ]

isDomainAdmin   [line 1167]

void isDomainAdmin( mixed $domain, [string $loginUser = null])

isDomainAdmin

Determine if the user is a domain administrator for a domain. Optional $loginUser argument defaults to the logged in user.

  • Access: public

Parameters:

mixed   $domain     domain name
string   $loginUser     user account info

[ Top ]

isSysAdmin   [line 1147]

bool isSysAdmin( [array $loginUser = null])

isSysAdmin

Does this $loginUser (user info array) have system administrator rights? The optional $loginUser (array) argument allows a system administrator to check the rights of a different account.


Parameters:

array   $loginUser     user account info

[ Top ]

isUserAdmin   [line 1199]

void isUserAdmin( string $name, string $domain)

isUserAdmin

Determine if this user have privileges on this account. Will not work if you did not authenticate using authenticate(), as it relies on $this->loginUser['domain'] to be set.


Parameters:

string   $name     user name
string   $domain     domain name

[ Top ]

listAlias   [line 539]

array listAlias( mixed $domain, [string $user = ''])

listAlias

List aliases. You can list all aliases for a domain or just the alias that matches the optional user argument.

  • Return: alias array on success, null on failure
  • Access: public

Parameters:

mixed   $domain     domain name
string   $user     user name optional

[ Top ]

listDomains   [line 757]

array listDomains( [int $page = 0], [int $perPage = 0])

listDomains

List domains. The page and perPage arguments support optional pagination.

  • Return: domains array on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

int   $page     page number, default 0 (don't paginate)
int   $perPage     domains per page, default 0 (don't paginate)

[ Top ]

listLists   [line 507]

array listLists( mixed $domain, [string $user = ''])

listLists

List ezmlm mailing lists.

  • Return: lists array on success, error on failure
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $domain     domain name
string   $user     user name optional

[ Top ]

listUsers   [line 1025]

array listUsers( string $domain, [int $page = 0], [int $perPage = 0])

listUsers

List users for a domain. page and perPage arguments allow for optional pagination.

  • Return: users array on success, null on failure
  • Access: public

Parameters:

string   $domain     domain name
int   $page     page number
int   $perPage     domains per page

[ Top ]

modUser   [line 960]

bool modUser( string $domain, string $user, array $userInfo)

modUser

Modify a user.

  • Return: true success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $domain     domain name
string   $user     user name
array   $userInfo     user info data

[ Top ]

paginateArray   [line 1444]

array paginateArray( array $array, int $page, int $limit)

paginateArray

A simple function to paginate an array.

  • Return: paginated array
  • Access: public

Parameters:

array   $array     array to paginate
int   $page     page to get
int   $limit     limit

[ Top ]

parseAliases   [line 1410]

array parseAliases( array $in_array, string $type)

parseAliases

Return correct type of aliases - forwards, responders, or lists (ezmlm)

  • Return: array of parsed aliases
  • Access: public

Parameters:

array   $in_array     aliases array
string   $type     type to look for (forwards, responders, lists)

[ Top ]

removeAlias   [line 570]

bool removeAlias( mixed $alias, mixed $destination)

removeAlias

Remove destination from alias.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $alias     alias name
mixed   $destination     destination address

[ Top ]

robotDel   [line 359]

bool robotDel( mixed $domain, mixed $user)

robotDel

Delete mail robot.

  • Return: true on success, false on failure
  • Access: public

Parameters:

mixed   $domain     domain name
mixed   $user     user name

[ Top ]

robotGet   [line 450]

array robotGet( mixed $domain, mixed $user)

robotGet

Get mail robot values.

  • Return: robot on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $domain     domain name
mixed   $user     user name

[ Top ]

robotSet   [line 394]

bool robotSet( mixed $domain, mixed $user, mixed $subject, mixed $message, mixed $forward, [mixed $time = ''], [mixed $number = ''])

robotSet

Set mail robot.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

mixed   $domain     domain name
mixed   $user     user name
mixed   $subject     subject
mixed   $message     message
mixed   $forward     forward destination
mixed   $time     time
mixed   $number     number

[ Top ]

setGidBit   [line 178]

void setGidBit( mixed &$bitmap, mixed $bit, bool $value, [mixed $flip = false])

setGidBit

Set gid bit flag value.


Parameters:

mixed   &$bitmap     bitmap to set
mixed   $bit     bit flag
bool   $value     value
mixed   $flip     flip it?

[ Top ]

setLimits   [line 670]

bool setLimits( string $domain, array $limits)

setLimits

Set vlimits for a domain.

  • Return: true on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $domain     domain name
array   $limits     domain limits

[ Top ]

setVacation   [line 1280]

void setVacation( string $user, string $domain, string $subject, string $message, [string $vacationDir = 'vacation'])

setVacation

Set vacation message (autorespond) values.

  • Access: public

Parameters:

string   $user     user name
string   $domain     domain name
string   $subject     subject line
string   $message     message contents
string   $vacationDir     vacation directory name, defaults to 'vacation'

[ Top ]

showIPMap   [line 281]

array showIPMap( )

showIPMap

List all IP map entries. Requires vpopmail to have IP Alias Domains support compiled in.

  • Return: sorted ip map array on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

[ Top ]

userCount   [line 1072]

int userCount( string $domain)

userCount

Count users in a domain.

  • Return: count on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $domain     domain name

[ Top ]

userInfo   [line 1002]

array userInfo( string $domain, string $user)

userInfo

Get user info array.

  • Return: user info array on success
  • Throws: Net_Vpopmaild_Exception on failure
  • Access: public

Parameters:

string   $domain     domain name
string   $user     user name

[ Top ]


Documentation generated on Sat, 04 Oct 2008 13:00:08 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.