Commit Graph

1782 Commits (f568309ef5f566760d36ce40f88f61c94e977946)
 

Author SHA1 Message Date
Christian Boltz fad18fc953 MailboxHandler.php: add (nearly) everything for creating a mailbox
(TODO: generating random passwords - when this is done, MailboxHandler
can replace create-mailbox.php)

- initStruct(): 
  - make 'username' a 'mail' field (doesn't really change anything at
    the moment)
  - make 'maildir' editable on $new
- init(): minor cleanup
- validate_new_id(): error out early if check_email() fails
- beforestore(): 
  - convert quota from MB to bytes - previously in setmore()
  - on $new, create mailbox alias
- storemore(): run mailbox_postcreation(), send_welcome_mail() and
  create_mailbox_subfolders() on $new
- add send_welcome_mail()
- _field_quota(): return true on success (otherwise it's interpreted 
  as invalid value)
- add _missing_local_part(), _missing_domain() and _missing_maildir()
  to fill those fields on $new
- remove add() because all the code moved to the functions mentioned 
  above. 
  Known regression: this breaks CLI create mailbox for now



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1425 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 5388bcf4cd AliasHandler.php:
- add MailboxAliasConfig() and $called_by_MailboxHandler for special
  handling if called by MailboxHandler
- create_allowed(): always allow creating an alias for a mailbox
- remove _missing_on_vacation() and _missing_active() which returned the
  default from $this->struct. This is now done by default, see previous
  change in PFAHandler



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1424 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 28f59d8305 PFAHandler.php:
- set(): if a field is not set and there's no _missing_$field() method
  for it, take default value from $this->struct
  (side effect: this automagically fixes CLI create domain)
- store(): add a beforestore() hook that is called at the beginning of
  store()
- add empty beforestore() (will be overwritten by MailboxHandler)
- some comment updates


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1423 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz a46bcc955c edit.php:
- prefill all $formconf['prefill'] fields from URL parameters (typically
  used for the domain)

model/AliasdomainHandler.php:
- allow to prefill alias_domain and target_domain from URL parameters
 
model/AliasHandler.php:
- allow to prefill domain from URL parameters
- some whitespace changes
- add storemore() with a TODO note

model/MailboxHandler.php:
- allow to prefill domain from URL parameters
- some whitespace changes
- add some TODO notes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1422 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz efb98c24c5 header.tpl:
- link header logo to main.php
  https://sourceforge.net/tracker/?func=detail&atid=937967&aid=3601801&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1421 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz a937c95d4f vacation.pl:
- fix confusing "my" vs. "our"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1420 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 8c408cfc49 list-virtual_mailbox.tpl:
- use edit.php to edit mailboxes

edit-mailbox.php:
- delete, obsoleted by edit.php + MailboxHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1416 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz fd7b02c870 MailboxHandler.php:
add everything for editing a mailbox

Details:
- include 'maildir' in "display in list" for now (not really
  needed/wanted in listview, but needed for the postedit hook)
- display max. allowed quota in quota field description (via init())
- add read_from_db_postprocess() - convert quota to MB and store the 
  original value in 'quotabytes'
- add setmore() - convert quota from MB to bytes
- add storemore() - call mailbox_postedit()
- add _field_quota() - quota validation


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1415 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 50252ecf6a *.lang:
- add $PALANG['mb_max'] = 'MB (max: %s)';
- $PALANG['pVacation_reply_type']
  $PALANG['pVacation_reply_delay_time']
  $PALANG['pVacation_reply_delay_time_text']
  was only in en.lang - add it to the translations



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1414 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 7a7403aa76 functions.inc.php:
- check_quota(): first check if enforcing quotas is disabled via $CONF[quota]


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1413 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz c38a9ef0b6 create-alias-domain.tpl:
- deleted - unused since exactly one year (r1275 | 2011-11-13)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1412 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 8457bcaa80 fetchmail.php:
- fix bool and date handling for pgsql
  (patch from Christian Eberl)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1410 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz b2026a4bb1 README.Debian:
- add "Integration with Postfix, Dovecot etc." section
  (mostly copied from INSTALL.TXT)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1409 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz d136b5d466 shells/mailbox.php / AddTask:
- move counting params into if (!empty($this->args[0])) block
  (the previous commit broke interactive mode)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1408 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz c3cc667caf scripts/shells/mailbox.php:
- update add, delete and password tasks to use new MailboxHandler syntax
- (roughly) check number of cmdline arguments for add

Reported by mkathuria at
http://sourceforge.net/projects/postfixadmin/forums/forum/676076/topic/5396581


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1407 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 299cde311d config.inc.php:
- changed some defaults as discussed on the mailinglist:
  - $CONF['database_type'] = 'mysqli';
  - $CONF['dovecotpw'] = "/usr/sbin/doveadm pw"; 
    $CONF['new_quota_table'] = 'YES'; (for dovecot 2)
  - $CONF['domain_path'] = 'YES'; $CONF['domain_in_mailbox'] = 'NO';
    (results in domain.tld/username/ maildirs)
  - $CONF['alias_control'] = 'YES'; $CONF['alias_control_admin'] = 'YES';
  - $CONF['backup'] = 'NO';
  - $CONF['show_status']='YES'; $CONF['show_status_key']='YES';
    $CONF['show_undeliverable']='YES'; $CONF['show_popimap']='YES';
    $CONF['show_undeliverable_exceptions']- "gmail.com" removed


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1406 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0f672c7fb7 config.inc.php:
- $CONF[encrypt]: add warning about salted dovecot:* methods


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1403 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f317ab41a7 footer.tpl:
- replace link to postfixadmin.com with postfixadmin.sf.net


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1401 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4dfe1db68e vacation.pl:
- fix typo (reported by Jan Kruis on the mailinglist)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1400 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ae61ee180f functions.inc.php:
- check_owner(): with AdminHandler, we can get 2 results (ALL + a domain).
  Relax the check to accept this case.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1399 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a63b80fb23 create-mailbox.php:
- do not escape the password coming from $_POST. Fixes
  https://sourceforge.net/tracker/index.php?func=detail&aid=3094804&group_id=191583&atid=937964 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1398 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 17911b75d2 functions.inc.php:
- pacrypt(): no longer escape_string() the result. This fixes
  https://sourceforge.net/tracker/index.php?func=detail&aid=3094804&group_id=191583&atid=937964

create-mailbox.php, password.php:
- escape_string() the pacrypt() result

login.php:
- simplify code to require one query less (this also removes the need 
  to escape_string() the password)

I also checked the other files using pacrypt() - they don't need 
escaping or already do it.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1397 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 57b28f1ae2 config.inc.php:
- remove the (now superfluous) $CONF['postfix_admin_url'] config option

debian/patches/db_credentials:
- remove the section that sets $CONF['postfix_admin_url']

functions.inc.php - authentication_require_role():
- also remove $CONF['postfix_admin_url'] from comments
- remove the './' part from the redirect

Combined with the previous two commits, this fixes
https://sourceforge.net/tracker/?func=detail&aid=3039042&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1396 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 89ffcbf25f smarty.inc.php:
- replace (last) usage of $CONF['postfix_admin_url'] with $rel_path
  (relative path to CSS etc., set to '../' in users/*)

users/*.php:
- set $rel_path to '../'

https://sourceforge.net/tracker/?func=detail&aid=3039042&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1395 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 40011a1a98 functions.inc.php:
- authentication_require_role(): no longer use $CONF['postfix_admin_url']
  https://sourceforge.net/tracker/?func=detail&aid=3039042&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1394 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d17fb42cde AdminHandler.php:
- initStruct():
  - pgsql doesn't support group_concat, so we need a database-dependent
    query to list the domains :-/
  - change some "..." to '...' to make them pgsql-compatible


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1393 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a6a3483569 Some things are easier than you might think...
functions.inc.php:
- create_page_browser(): Fix count() query for pgsql. Fixes
  https://sourceforge.net/tracker/?func=detail&aid=3292648&group_id=191583&atid=937964
- surprise: the query to actually generate the pagebrowser already works 
  with pgsql :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1392 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 47bc9bb2ad upgrade.php:
- _pgsql_field_exists(), _mysql_field_exists():
  Those functions are always called with the expanded table name - don't
  expand it twice. (The better solution would be to change all calling
  code to provide non-expanded tablenames, but that's more work.)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1391 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a211a95c39 functions.inc.php:
- check_email(): don't trim() mail address to avoid that aliases
  starting with a space are allowed. This fixes
  https://sourceforge.net/tracker/?func=detail&aid=3066059&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1390 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 05d502558f add a friendly from address to vacation messages; probably needs more work to beautify it though...; change error handling if we cannot send the reply to be hopefully more robust
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1389 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 954b18c169 functions.inc.php
- create_page_browser(): revert r1387 and...
- db_query(): ...replace it with the correct fix ;-) (avoid mysqli 
  reconnects)

The problem was that db_query() used is_resource() to check if we
already have a database connection, but a mysqli connection is an
object, not a resource.
This resulted in a new database connection for each query. Therefore
mysqli "forgot" the value of SET @row before executing the following
SELECT query (which used a new mysqli connection).

The fix is to also check with is_object() to avoid mysqli reconnects.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1388 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 182c67e1cd functions.inc.php:
- create_page_browser(): include MOD(idx.row, $page_size) in outer SELECT.
  This is needed on some MySQL setups which otherwise return an empty set.

Thanks to f-dens_ on IRC for helping to debug it.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1387 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 102cb4ed50 functions.inc.php:
- change list_admins() to use AdminHandler (code from list-admin.php)
  Note: this changes the return value format to include all details, 
  not only the usernames. Use array_keys(list_admins()) if you need
  the previous return format.
 
list-admin.php:
- replace code with a list_admins() call

list-domain.php:
- adopt to new list_admins() return value



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1386 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 232cee9d5f PFAHandler:
- make PFAHandler an "abstract class"
- add functions that must be implemented by every *Handler class
  as abstract functions:
  - abstract protected function initStruct();
  - abstract protected function initMsg();
  - abstract public function webformConfig();
  - abstract protected function validate_new_id();
- lots of additional comments

AdminHandler, AliasdomainHandler, DomainHandler, MailboxHandler:
- remove comments that are now in PFAHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1385 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4bb441d45d PFAHandler:
- mark _inp_* functions as protected


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1384 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e36c3e2a23 PFAHandler.php:
- add lots of comments
- sort variables into categories
  - public variables (currently only errorMsg)
  - must be defined in *Handler classes
  - set by methods
- (no "real" code changes)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1383 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ca8c27ae93 AliasHandler.php:
- initStruct(): add 'editable' virtual field
- add various comments

AdminHandler.php:
- add some comments


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1382 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4635480afd de.lang, it.lang:
- replace htmlentities with the actual character


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1381 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ded2dcb640 templates/list-virtual_alias.tpl:
- use edit.php to enable/disable aliases (instead of edit-active.php)
- merge/simplify conditions for "editable"/check_alias_owner
- use {#url_create_alias#} instead of hardcoded edit.php
- some whitespace changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1380 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ebc3536a2e edit.php:
- hand over $handler->errormsg to flash_error() as array (avoids 
  various foreach or join calls)
- drop variable $mode, instead set smarty $mode directly based on $new
- comment updates


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1379 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b3cdbfe88a functions.inc.php:
- _flash_string(): also accept an array of messages, not only a string
- comment updates for _flash_info() and flash_error() to reflect this change


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1378 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a9f252baea functions.inc.php:
- delete unused function db_boolean_to_int()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1377 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Norman Messtorff f535a0f66f Updating trunk also to current Debian packaging...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1376 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 87f33d95ae patch from Jan Kruis - see http://sourceforge.net/tracker/?func=detail&aid=3520749&group_id=191583&atid=937966 (Tracker id 3520749) ; thank you!
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1374 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin ef80736445 Merge jan-kruis's vacation interval reply behaviour - see SF patch 3508083 - https://sourceforge.net/tracker/?func=detail&aid=3508083&group_id=191583&atid=937966 ; Thank you
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1373 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 76efcb2c47 merge of patch from maharaja - delete old vacation_notifications - see https://sourceforge.net/tracker/?func=detail&aid=3323227&group_id=191583&atid=937966
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1372 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 3d3d61963b vacation.pl: refactor duplicated sql into a function (check_for_vacation($x)) - thanks to jan kruis for submitting this - see https://sourceforge.net/tracker/?func=detail&aid=3507319&group_id=191583&atid=937966
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1371 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin d5803088aa vacation.pl: merge in patch from ichier (thank you) - see patch 3371641 - https://sourceforge.net/tracker/?func=detail&aid=3371641&group_id=191583&atid=937966
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1370 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3b920fc442 functions.inc.php:
- remove_from_array() was accidently wrapped by 
  if (!function_exists('hex2bin'))


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1369 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 31b94156c4 functions.inc.php:
- delete leftover comment from (long time deleted) function create_admin()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1368 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago