Alternc
3.2
Alternc logiel libre pour l'hébergement
|
This class handle emails (pop and/or aliases and even wrapper for internal classes) of hosted users. More...
Public Member Functions | |
m_mail () | |
Constructeur. | |
hook_menu () | |
get_total_size_for_domain ($domain) | |
catchall_getinfos ($domain_id) | |
catchall_del ($domain_id) | |
catchall_set ($domain_id, $target) | |
hook_quota_get () | |
get_quota (hook for quota class), returns the number of used service for a quota-bound service | |
alternc_password_policy () | |
Password policy kind used in this class (hook for admin class) | |
enum_domains ($uid=-1) | |
Returns the list of mail-hosting domains for a user. | |
available ($mail) | |
available: tells if an email address can be installed in the server check the domain part (is it mine too), the syntax, and the availability. | |
enum_domain_mails ($dom_id=null, $search="", $offset=0, $count=30, $show_systemmails=false) | |
hook_mail_get_details ($detail) | |
create ($dom_id, $mail, $type="", $dontcheck=false) | |
Function used to insert a new mail into the db should be used by the web interface, not by third-party programs. | |
get_details ($mail_id) | |
function used to get every information we can on a mail | |
is_it_my_mail ($mail_id) | |
Check if an email is mine ... | |
hook_dom_del_mx_domain ($dom_id) | |
Hook called when the DOMAIN class will delete a domain. | |
get_account_by_mail_id ($mail_id) | |
delete ($mail_id) | |
Function used to delete a mail from the db should be used by the web interface, not by third-party programs. | |
undelete ($mail_id) | |
Function used to undelete a pending deletion mail from the db should be used by the web interface, not by third-party programs. | |
set_passwd ($mail_id, $pass) | |
set the password of an email address. | |
enable ($mail_id) | |
Enables an email address. | |
disable ($mail_id) | |
Disables an email address. | |
set_details ($mail_id, $islocal, $quotamb, $recipients, $delivery="dovecot", $dontcheck=false) | |
Function used to update an email settings should be used by the web interface, not by third-party programs. | |
add_wrapper ($dom_id, $m, $delivery) | |
A wrapper used by mailman class to create it's needed addresses @ param : $dom_id , the domain id associated to a given address @ param : $m , the left part of the mail address being created @ param : $delivery , the delivery used to deliver the mail. | |
create_alias ($dom_id, $m, $alias, $type="", $dontcheck=false) | |
A function used to create an alias for a specific address @ param : $dom_id , the domain sql identifier @ param : $m , the alias we want to create @ param : $alias , the already existing aliased address @ param : $type, the type of the alias created. | |
del_wrapper ($mail_id) | |
A wrapper used by mailman class to create it's needed addresses @ param : $mail_id , the mysql id of the mail address we want to delete of the email for the current acccount. | |
alternc_export_conf () | |
Export the mail information of an account. | |
enum_slave_account () | |
Return the list of allowed slave accounts (secondary-mx) | |
check_slave_account ($login, $pass) | |
Check for a slave account (secondary mx) | |
echo_domain_list ($format=null) | |
Out (echo) the complete hosted domain list : | |
add_slave_account ($login, $pass) | |
Add a slave account that will be allowed to access the mxdomain list. | |
del_slave_account ($login) | |
Remove a slave account. | |
hook_dom_add_slave_domain ($domain_id, $target_domain) | |
hook function called by AlternC when a domain is created for the current user account using the SLAVE DOMAIN feature This function create a CATCHALL to the master domain | |
hook_dom_add_mx_domain ($domain_id) | |
hook function called by AlternC when a domain is created for the current user account This function create a postmaster mail which is an alias to LOGIN @ FQDN wich is a dynamic alias to the alternc's account mail | |
hook_upnp_list () | |
hook function called by AlternC-upnp to know which open tcp or udp ports this class requires or suggests |
Data Fields | |
$domains | |
domain list for this account private | |
$specialchars = array('"',"'",'\\','/') | |
If an email has those chars, 'not nice in shell env' ;) we don't store the email in $mail/u/{user}_domain, but in $mail/_/{address_id}_domain private. | |
$forbiddenchars = array('"',"'",'\\','/','?','!','*','$','|','#','+') | |
If an email has those chars, we will ONLY allow RECIPIENTS, NOT POP/IMAP for DOVECOT ! Since Dovecot doesn't allow those characters private. | |
$total | |
Number of results for a pager display public. | |
$srv_submission | |
$srv_smtp | |
$srv_smtps | |
$srv_imap | |
$srv_imaps | |
$srv_pop3 | |
$srv_pop3s | |
$cache_domain_mail_size = array() |
Private Attributes | |
$isitmy_cache = array() |
This class handle emails (pop and/or aliases and even wrapper for internal classes) of hosted users.
Definition at line 36 of file m_mail.php.
add_slave_account | ( | $login, | |
$pass | |||
) |
Add a slave account that will be allowed to access the mxdomain list.
string | $login | the login to add |
string | $pass | the password to add |
Definition at line 833 of file m_mail.php.
add_wrapper | ( | $dom_id, | |
$m, | |||
$delivery | |||
) |
A wrapper used by mailman class to create it's needed addresses @ param : $dom_id , the domain id associated to a given address @ param : $m , the left part of the mail address being created @ param : $delivery , the delivery used to deliver the mail.
Definition at line 682 of file m_mail.php.
References $db, $err, $mail_id, and set_details().
alternc_export_conf | ( | ) |
Export the mail information of an account.
Definition at line 725 of file m_mail.php.
References $d, $db, $domain, $err, $key, $r, $val, enum_domain_mails(), enum_domains(), and get_details().
alternc_password_policy | ( | ) |
Password policy kind used in this class (hook for admin class)
Definition at line 203 of file m_mail.php.
available | ( | ) |
available: tells if an email address can be installed in the server check the domain part (is it mine too), the syntax, and the availability.
string email to check |
Definition at line 246 of file m_mail.php.
References $db, $dom, $domain, and $err.
catchall_del | ( | $domain_id | ) |
Definition at line 154 of file m_mail.php.
References $catch, and catchall_getinfos().
Referenced by catchall_set().
catchall_getinfos | ( | $domain_id | ) |
Definition at line 127 of file m_mail.php.
Referenced by catchall_del().
catchall_set | ( | $domain_id, | |
$target | |||
) |
Definition at line 160 of file m_mail.php.
References $err, catchall_del(), and create_alias().
Referenced by hook_dom_add_slave_domain().
check_slave_account | ( | $login, | |
$pass | |||
) |
Check for a slave account (secondary mx)
string | $login | the login to check |
string | $pass | the password to check |
Definition at line 786 of file m_mail.php.
create | ( | $dom_id, | |
$mail, | |||
$type = "" , |
|||
$dontcheck = false |
|||
) |
Function used to insert a new mail into the db should be used by the web interface, not by third-party programs.
This function calls the hook "hooks_mail_cancreate" which must return FALSE if the user can't create this email, and raise and error accordingly
$dom_id | integer A domain_id (owned by the user) (will be the part at the right of the @ in the email) |
string the left part of the email to create (something) |
Definition at line 329 of file m_mail.php.
References $cuid, $db, $dom, $domain, $err, and $hooks.
create_alias | ( | $dom_id, | |
$m, | |||
$alias, | |||
$type = "" , |
|||
$dontcheck = false |
|||
) |
A function used to create an alias for a specific address @ param : $dom_id , the domain sql identifier @ param : $m , the alias we want to create @ param : $alias , the already existing aliased address @ param : $type, the type of the alias created.
Definition at line 698 of file m_mail.php.
References $db, $err, $mail_id, and set_details().
Referenced by catchall_set(), and hook_dom_add_mx_domain().
del_slave_account | ( | $login | ) |
del_wrapper | ( | $mail_id | ) |
A wrapper used by mailman class to create it's needed addresses @ param : $mail_id , the mysql id of the mail address we want to delete of the email for the current acccount.
Definition at line 714 of file m_mail.php.
delete | ( | $mail_id | ) |
Function used to delete a mail from the db should be used by the web interface, not by third-party programs.
$mail_id | integer the number of the email to delete |
Definition at line 461 of file m_mail.php.
References $cuid, $db, $dom, $err, $hooks, $mail_id, $mailinfos, get_details(), and is_it_my_mail().
disable | ( | $mail_id | ) |
Disables an email address.
$mail_id | integer Email ID |
Definition at line 595 of file m_mail.php.
References $db, $err, $mail_id, and is_it_my_mail().
echo_domain_list | ( | $format = null | ) |
Out (echo) the complete hosted domain list :
Definition at line 801 of file m_mail.php.
enable | ( | $mail_id | ) |
Enables an email address.
$mail_id | integer Email ID |
Definition at line 581 of file m_mail.php.
References $db, $err, $mail_id, and is_it_my_mail().
enum_domain_mails | ( | $dom_id = null , |
|
$search = "" , |
|||
$offset = 0 , |
|||
$count = 30 , |
|||
$show_systemmails = false |
|||
) |
Definition at line 277 of file m_mail.php.
References $cuid, $db, $err, $hooks, and $res.
Referenced by alternc_export_conf(), and hook_dom_del_mx_domain().
enum_domains | ( | $uid = -1 | ) |
Returns the list of mail-hosting domains for a user.
Definition at line 212 of file m_mail.php.
References $cuid, $db, $err, and $uid.
Referenced by alternc_export_conf(), and hook_menu().
enum_slave_account | ( | ) |
Return the list of allowed slave accounts (secondary-mx)
Definition at line 768 of file m_mail.php.
get_account_by_mail_id | ( | $mail_id | ) |
get_details | ( | $mail_id | ) |
function used to get every information we can on a mail
$mail_id | integer |
Definition at line 377 of file m_mail.php.
References $cuid, $db, $err, $hooks, $mail_id, and is_it_my_mail().
Referenced by alternc_export_conf(), delete(), and set_details().
get_total_size_for_domain | ( | $domain | ) |
Definition at line 113 of file m_mail.php.
References $db, $domain, and isset.
hook_dom_add_mx_domain | ( | $domain_id | ) |
hook function called by AlternC when a domain is created for the current user account This function create a postmaster mail which is an alias to LOGIN @ FQDN wich is a dynamic alias to the alternc's account mail
string | $domain_id | Domain that has just been created private |
Definition at line 882 of file m_mail.php.
References $db, $err, $mem, and create_alias().
hook_dom_add_slave_domain | ( | $domain_id, | |
$target_domain | |||
) |
hook function called by AlternC when a domain is created for the current user account using the SLAVE DOMAIN feature This function create a CATCHALL to the master domain
string | $domain_id | Domain that has just been created |
string | $target_domain | Master domain private |
Definition at line 867 of file m_mail.php.
References $err, and catchall_set().
hook_dom_del_mx_domain | ( | $dom_id | ) |
Hook called when the DOMAIN class will delete a domain.
$dom | integer the number of the email to delete |
Definition at line 432 of file m_mail.php.
References $list, and enum_domain_mails().
hook_mail_get_details | ( | $detail | ) |
Definition at line 311 of file m_mail.php.
hook_menu | ( | ) |
Definition at line 93 of file m_mail.php.
References $d, and enum_domains().
hook_quota_get | ( | ) |
get_quota (hook for quota class), returns the number of used service for a quota-bound service
$name | string the named quota we want |
Definition at line 187 of file m_mail.php.
References $cuid, $db, $err, and $q.
hook_upnp_list | ( | ) |
hook function called by AlternC-upnp to know which open tcp or udp ports this class requires or suggests
Definition at line 904 of file m_mail.php.
is_it_my_mail | ( | $mail_id | ) |
Check if an email is mine ...
$mail_id | integer the number of the email to check |
Definition at line 409 of file m_mail.php.
References $cuid, $db, $err, $mail_id, and isset.
Referenced by delete(), disable(), enable(), get_details(), set_passwd(), and undelete().
m_mail | ( | ) |
Constructeur.
Definition at line 83 of file m_mail.php.
References variable_get().
set_details | ( | $mail_id, | |
$islocal, | |||
$quotamb, | |||
$recipients, | |||
$delivery = "dovecot" , |
|||
$dontcheck = false |
|||
) |
Function used to update an email settings should be used by the web interface, not by third-party programs.
$mail_id | integer the number of the email to delete |
$islocal | boolean is it a POP/IMAP mailbox ? |
$quotamb | integer if islocal=1, quota in MB |
$recipients | string recipients, one mail per line. |
Definition at line 615 of file m_mail.php.
References $cuid, $db, $dom, $err, $hooks, $mail_id, $r, ALTERNC_MAIL, and get_details().
Referenced by add_wrapper(), and create_alias().
set_passwd | ( | $mail_id, | |
$pass | |||
) |
set the password of an email address.
$mail_id | integer email ID |
$pass | string the new password. |
Definition at line 565 of file m_mail.php.
References $db, $err, $mail_id, and is_it_my_mail().
undelete | ( | $mail_id | ) |
Function used to undelete a pending deletion mail from the db should be used by the web interface, not by third-party programs.
$mail_id | integer the email id |
Definition at line 515 of file m_mail.php.
References $cuid, $db, $dom, $err, $hooks, $mail_id, and is_it_my_mail().
$cache_domain_mail_size = array() |
Definition at line 78 of file m_mail.php.
$domains |
domain list for this account private
Definition at line 43 of file m_mail.php.
$forbiddenchars = array('"',"'",'\\','/','?','!','*','$','|','#','+') |
If an email has those chars, we will ONLY allow RECIPIENTS, NOT POP/IMAP for DOVECOT ! Since Dovecot doesn't allow those characters private.
Definition at line 59 of file m_mail.php.
|
private |
Definition at line 400 of file m_mail.php.
$specialchars = array('"',"'",'\\','/') |
If an email has those chars, 'not nice in shell env' ;) we don't store the email in $mail/u/{user}_domain, but in $mail/_/{address_id}_domain private.
Definition at line 51 of file m_mail.php.
$srv_imap |
Definition at line 73 of file m_mail.php.
$srv_imaps |
Definition at line 74 of file m_mail.php.
$srv_pop3 |
Definition at line 75 of file m_mail.php.
$srv_pop3s |
Definition at line 76 of file m_mail.php.
$srv_smtp |
Definition at line 71 of file m_mail.php.
$srv_smtps |
Definition at line 72 of file m_mail.php.
$srv_submission |
Definition at line 70 of file m_mail.php.
$total |
Number of results for a pager display public.
Definition at line 66 of file m_mail.php.