Compare commits

...

1716 Commits

Author SHA1 Message Date
David Goodwin 864065cd37 fix MailboxHandler -> adding mailbox with empty quota field 4 years ago
David Goodwin 192c797fe1 add a support block to compoer.json 4 years ago
David Goodwin 052f2faffb do not fail on error from coveralls 4 years ago
David Goodwin 85e15790bb should fix: #351 4 years ago
Christian Boltz ad4142134a
merge __parseParams() into parseParams() 4 years ago
Christian Boltz 9833a8f289
whitespace fix in __parseParams() 4 years ago
Christian Boltz 4e9e3db75d
Fix parameter parsing for '-1'
'--quota -1' gets parsed as two options ("quota" and "1"), but it's
meant to be "quota => -1".

Make sure '-1' is considered as a value, not as an option.

Also get rid of unset()'ing $params[$i] and (now?) superfluous recursive
calls to __parseParams() to make the code less confusing.
4 years ago
David Goodwin fc464d6e69 update INSTALL.TXT - see also #349 4 years ago
David Goodwin df9a400ea2 remove debug stuff 4 years ago
David Goodwin fd48714615 fix issue reported with __LANG.$var - 844840c6a8 (commitcomment-38653465) 4 years ago
Christian Boltz 44c3ac5e20
language-update.sh: silence warning about undefined $CONF variable
This warning was for example

PHP Notice:  Undefined variable: CONF in .../languages/en.lang on line 184

and is caused by some texts that include $CONF['admin_name']
4 years ago
David Goodwin be0105b33e
Merge pull request #348 from Jolly-Pirate/patch-1
Flush privileges
4 years ago
drakos f17c722f0b
Flush privileges
Must `FLUSH PRIVILEGES;` after granting.
4 years ago
David Goodwin 844840c6a8 simplify Config use; drop support for dotty name notation which we are not using 4 years ago
David Goodwin e4158d6d7e psalm fix 4 years ago
David Goodwin f8415eef2a remove cache suppression 4 years ago
David Goodwin ffc7787b76 psalm fix 4 years ago
David Goodwin 3cd62f9f4f update to phpunit v8, try changing coveralls library, update github action 4 years ago
David Goodwin 5e8ce2b5b0 move to php-parallel-lint/php-parallel-lint rather than abandoned jakuk-onderka/php-parallel-lint 4 years ago
David Goodwin c69211ca5f Merge remote-tracking branch 'origin/master' 4 years ago
David Goodwin eea72e0019 check for PDO modules in setup.php, not old style functions 4 years ago
Christian Boltz 3b704715dc
setup.php: replace last mentions of php5 with php7 4 years ago
David Goodwin dec4b38f35 improve langauge checks (remove unnecessary is_string check) 4 years ago
Christian Boltz 531a52e053
remove superfluous code in check_language()
dd52a98d43 added honoring POST['lang'] and
COOKIE['lang'] even if $_SERVER['HTTP_ACCEPT_LANGUAGE'] is not set.
This also means we can drop the now-duplicate check in the code section
handling $_SERVER['HTTP_ACCEPT_LANGUAGE'].
4 years ago
Christian Boltz 4d10a2c4bb
remove obsolete translation markers from tr.lang 4 years ago
David Goodwin d81363541a fix psalm 4 years ago
David Goodwin 338fb8c564 Fix quota storage; see https://github.com/postfixadmin/postfixadmin/issues/342 4 years ago
David Goodwin d3295a59bb format 4 years ago
David Goodwin d540d904db cast mailbox['quota'] to be integer.
see:  https://github.com/postfixadmin/postfixadmin/issues/342
4 years ago
David Goodwin 3303f25bcc add some php 7+ array type hints. 4 years ago
David Goodwin 1c0fd02323 composer format time 4 years ago
David Goodwin d6869a4d35 update CHANGELOG.TXT, some stuff probably missing 4 years ago
David Goodwin 3b9d8f867e merge sha512.b64 encrypt support - see https://github.com/postfixadmin/postfixadmin/issues/58 4 years ago
David Goodwin 48e236ffc0 use hash_equals for login - see: https://github.com/postfixadmin/postfixadmin/issues/58 4 years ago
David Goodwin dd52a98d43 prefer POST/COOKIE lang over browser http header - see: https://github.com/postfixadmin/postfixadmin/issues/28 4 years ago
David Goodwin 8f20c96278 see: https://github.com/postfixadmin/postfixadmin/issues/101 - in Debian Buster, /var/lock is writeable by anyone, /var/run is not... both are tmpfs 4 years ago
David Goodwin fefe3f7df5 default domain_quota_default to -1 if not specified - see https://github.com/postfixadmin/postfixadmin/issues/299 4 years ago
David Goodwin d2b8f7ac15 might fix: https://github.com/postfixadmin/postfixadmin/issues/306 4 years ago
David Goodwin 8754af58cb fix undefined variables (psalm) 4 years ago
David Goodwin 3b1fffdf22 merge in patch from @jackdeguest - see https://github.com/postfixadmin/postfixadmin/issues/337 4 years ago
David Goodwin 5e1a4e27dd ensure edit works 4 years ago
David Goodwin e49c25139e ignore coveralls erroring 4 years ago
David Goodwin 7f58163d65 update README.md 4 years ago
David Goodwin 70fe1f93f2 rename build 4 years ago
David Goodwin 50bbae62f4
switch from travis to github action 4 years ago
David Goodwin 591ea333ea drop caching; we as we do not add composer.lock to git anyway 4 years ago
David Goodwin 22bb34ff60 try this 4 years ago
David Goodwin a00e551a8a try adding composer caching 4 years ago
David Goodwin 71966ce917 Revert "drop coveralls"
This reverts commit b6c7d1418d.
4 years ago
David Goodwin 3809cf905f rinse repeat 4 years ago
David Goodwin fddd450df0 rinse, repeat 4 years ago
David Goodwin cd6386bdea - => _ 4 years ago
David Goodwin 6c3d595c0b coverage.xml 4 years ago
David Goodwin e661f2445a coveralls test - see af8a5e1ebf/.github/workflows/build.yml and https://github.com/php-coveralls/php-coveralls/issues/273 4 years ago
David Goodwin b6c7d1418d drop coveralls 4 years ago
David Goodwin 2444b0c16b Revert "try updating coveralls"
This reverts commit cffcd1c4ec.
4 years ago
David Goodwin cffcd1c4ec try updating coveralls 4 years ago
David Goodwin 79ee5f82cb add a far better MailboxHandler test case 4 years ago
David Goodwin 01b4d6c587 cleanup db after running 4 years ago
David Goodwin 30f97c97ee avoid: A non-numeric value encountered errors from no quota being specified 4 years ago
David Goodwin 6a7abbe663 fix formatting 4 years ago
David Goodwin 28a3f5f157 better testing 4 years ago
David Goodwin a4afebbe77 verify ssl certs when connecting to the db by default (we also do if this setting is not present) 4 years ago
David Goodwin 6edbda45e2
Merge pull request #321 from adrium/transport-map-support
POSTFIX_CONF.txt: Add transport map support
4 years ago
David Goodwin 1ecada175c and support whether we verify ssl certs; default to true 4 years ago
David Goodwin 212415db56 document better 4 years ago
David Goodwin 4cbd82d750 remove empty settings so not all SSL things are required for using SSL with MySQL 4 years ago
David Goodwin 2a1383ee2e give the browser a hint that we want a new password for new admin accounts - see https://github.com/postfixadmin/postfixadmin/issues/331 4 years ago
David Goodwin 5b16f4a483 composer build 4 years ago
David Goodwin 9dfc866edd composer format 4 years ago
David Goodwin eb5fcf829e
Merge pull request #332 from kr1pt0ph0b14/patch-1
Update tr.lang
4 years ago
Özgür Kazanççı 97c2b582a3
Update tr.lang
The file was a big mess, Turkish exclusive chars were completely corrupted, gramatically wrong words in the translation such as;
Not "Hiçbirşey" but "Hiçbir şey".
Not "eposta" but "e-posta" and/or "E-posta".
Not "Şuanki" but "Şu anki"
Not "ddeðiþtirmek" but "değiştirmek" (Wrong/corrupted Turkish characters)
Not "Yönlendirmen deðiþtir" but "Yönlendirme değiştir" (Wrong/corrupted Turkish characters)

As well as a lot of lines weren't translated -yet-. So here it is.

Regards,
Özgür Kazancci
4 years ago
David Goodwin 268daa892d
Merge pull request #330 from veitw/dovecot-quota2-docs
Update dovecot documentation
4 years ago
David Goodwin 6a10c869e5 allow existance of pdo for us to proceed with setup 4 years ago
Veit eb83a0aa3f Update dovecot documentation
- added quota2 table dict template for dovecot 1.2 and newer to dovecot
  documentation
4 years ago
David Goodwin 95d92a2345 psalm fix: rewrite to avoid php error (@) suppression 4 years ago
David Goodwin ec2fbfd87f skip this query - for a new database it will run before the domain table has been created and just error 4 years ago
David Goodwin fd35dada38 try and be consistent with MySQL table types/collations - see https://github.com/postfixadmin/postfixadmin/issues/327 4 years ago
Christian Boltz bee61f329b
Only show password expiration if enabled in config 4 years ago
Christian Boltz 3d0add075a
Add empty $CONF['database_socket'] to avoid warnings
... about reading an undefined config option
4 years ago
David Goodwin 666bb0218a
Merge pull request #324 from smhessenauer/master
fetchmail dovecot delivery
4 years ago
Stefan M. Hessenauer 416a71d604 short documentation added, path to deliver as configuration option 4 years ago
David Goodwin 80a0faa633 specify a default table collation / charset for MySQL - might help fix https://github.com/postfixadmin/postfixadmin/issues/327 4 years ago
David Goodwin cabd97ff17
Merge pull request #325 from Slamdunk/php_74
[Travis] Test against PHP 7.4
4 years ago
David Goodwin 036245063e drop references to magic_quotes; see: https://github.com/postfixadmin/postfixadmin/pull/325 4 years ago
Filippo Tessarotto fc3cd79f21 [Travis] Test against PHP 7.4 4 years ago
Stefan M. Hessenauer 352ae80395 fetchmail dovecot delivery 4 years ago
David Goodwin 5f772afe14 dev improvements
bump minimum php variant to 7.0
 update phpunit.xml
 switch to shardj/zf1-future rather than unsupported zf1
 try running tests by default in github
4 years ago
David Goodwin 1ad184641d php7.4 / psalm fixes 4 years ago
David Goodwin 882b6835ed just wondering 4 years ago
David Goodwin 038a08d838 touch config.local.php perhaps 4 years ago
David Goodwin c0bd763c53 another replacement of string{x} with string[x] 4 years ago
David Goodwin 55661a80c6 see ticket:318 - try and fix IT translation issue 4 years ago
David Goodwin aa37ab57e6 stop using { } for string character access (use [ ] instead) - see https://www.php.net/manual/en/language.types.string.php#language.types.string.substr 4 years ago
David Goodwin 79c2e77a00 should fix: https://github.com/postfixadmin/postfixadmin/issues/323 4 years ago
David Goodwin d0f254faee mkdir templates_c 5 years ago
David Goodwin 6582678173
test 5 years ago
Adrian 47618bf5a3 POSTFIX_CONF.txt: Add transport map support 5 years ago
David Goodwin 52e0d3e4b0 work around nano highlighting - see https://github.com/postfixadmin/postfixadmin/issues/320 5 years ago
David Goodwin 4b0b6904ca
Merge pull request #317 from alexandregz/master
Added galician language
5 years ago
Alexandre Espinosa Menor 48e07e7a5f
Added galician language 5 years ago
David Goodwin d6bbecaf45 change row to r everywhere; see : https://sourceforge.net/p/postfixadmin/discussion/676076/thread/616c1d25/?limit=25#7da0 - hopefully removing "row" which might be a reserved keyword for some databases etc 5 years ago
David Goodwin 6a4b7ec163
Merge pull request #316 from koenr/patch-1
Update nl.lang
5 years ago
koenr 8828d28bbc
Update nl.lang
typo in change password mail subject line
5 years ago
Christian Boltz 06f57767bd
DOVECOT.TXT: update user_query for postgresql and some cleanup
- update postgresql user_query to include quota_rule
- drop partial user_query without quota_rule
- some whitespace fixes
5 years ago
Christian Boltz 125113d83c
POSTFIX_CONF.txt: make queries pgsql-compatible
... by changing WHERE ...=1 to WHERE ...='1' which should work with both
mysql and postgresql.

Reported by xpoint on IRC.
5 years ago
Christian Boltz 115ff22761
INSTALL.TXT: mention an Alias as alternative for a symlink
See also the question on
https://sourceforge.net/p/postfixadmin/discussion/676076/thread/1074971cc8/
5 years ago
David Goodwin c1bdfe5432 fix travis / autoloading smarty etc 5 years ago
David Goodwin bcae218cbb composer format time 5 years ago
David Goodwin 87824ef970 psalm fixes/workarounds; require PHP 5.6+ 5 years ago
David Goodwin 1df7f15d40 require PHP 5.6+ 5 years ago
David Goodwin 4aa3110712 phpdoc/psalm fixes 5 years ago
David Goodwin ccd74cc506
Merge pull request #308 from dsamoshin/icon_ru
Favicon config and ru_lang
5 years ago
gotty 13549cea0f Favicon config and ru_lang:
1. Favicon configuration of the project:
  a. Fixed incorrect link to favicon from the subfolder /users/
  b. Added ability to set favicon via config
2. Completed translation of all string constants into Russian language.
5 years ago
David Goodwin 61cb429845 revert psalm; fix issues later 5 years ago
David Goodwin b8d7c0513f psalm fix 5 years ago
David Goodwin e20b2cacdb psalm fix 5 years ago
David Goodwin 174b874c56 allow psalm to update
phpdoc fix
5 years ago
David Goodwin 9526e68e3e perhaps this will help https://github.com/postfixadmin/postfixadmin/issues/305 5 years ago
David Goodwin 907bd7ee46 update Smarty to v3.1.33 - "This release does cover security issue CVE-2018-16831, other bug fixes (see changelog.txt) and adds a new feature of the {capture} tag (see NEW_FEATURES.txt)." 5 years ago
David Goodwin 7360407b73 see: https://github.com/postfixadmin/postfixadmin/issues/302 - check if the session key exists; and if not show something that may help 5 years ago
David Goodwin 58b064f1c8
Merge pull request #298 from leitmedium/master
remove double libmime-encwords-perl install call in virtual vacation …
5 years ago
Caspar Clemens Mierau 9c4caf1045 remove double libmime-encwords-perl install call in virtual vacation howto 5 years ago
David Goodwin c66755a0da remove test for code that probably does not work 5 years ago
David Goodwin cd8cf289b4 more empty tests 5 years ago
David Goodwin a03317e088 drop codecov 5 years ago
David Goodwin f61cb513ae might fix pg failing test? 5 years ago
David Goodwin 0e9a1ff0ff emptyish tests 5 years ago
David Goodwin f4a5155f7a codecov removed 5 years ago
David Goodwin a485a2d861 cleanup after test 5 years ago
David Goodwin 946c47dd66 postgres requires fkeys exist 5 years ago
David Goodwin 2742849e7b reformat 5 years ago
David Goodwin 958df260ec mostly empty test 5 years ago
David Goodwin 7965a83aff tighten psalm checks even more 5 years ago
David Goodwin 34e6f7829e tighten psalm checks; fix errors 5 years ago
David Goodwin 034a50836c tighten psalm checks 5 years ago
David Goodwin a603d36224 format 5 years ago
David Goodwin 29d990f5f4 fix page browser test for sqlite; see #87 and #161 5 years ago
David Goodwin 71e7859c91 see #161 and #87 - unit test that seems to trigger this bug 5 years ago
David Goodwin f36ba9b4c2 format 5 years ago
David Goodwin 28bef9e136 output $sqlite file .... 5 years ago
David Goodwin 4081267cb2 fix phpdoc; throw exception on error within phpunit - helps testing 5 years ago
David Goodwin f7c7e35b34 fix formatting 5 years ago
David Goodwin f8713651cc explode if $run_dir is not specified; make a config setting and perhaps shift the onus onto the user rather than having to deal with tmpfiles.d etc
See: https://github.com/postfixadmin/postfixadmin/issues/78
5 years ago
David Goodwin 80418e6412 try and avoid hitting : https://github.com/postfixadmin/postfixadmin/issues/51 5 years ago
David Goodwin 17a50c51f1 drop some dies; use Exception and catch after dispatch() - see #197 5 years ago
David Goodwin 2ff05bc737 typo 5 years ago
David Goodwin 9cd7dac187 initial attempt at trying to return an exit value within the cli 5 years ago
David Goodwin 284d4b2eb0
Merge pull request #295 from Corvan/platform-independent
Update postfixadmin-cli
5 years ago
Lars Liedtke 0c94760828
Update postfixadmin-cli
Make this script platform independent to be usable under e.g. FreeBSD, where bash is located in /usr/local/bin/bash and thus the script fails.
5 years ago
David Goodwin 758ccb9a19 add note in config for mailbox subdir creation requiring imap extension 5 years ago
David Goodwin 34cf66110e see https://github.com/postfixadmin/postfixadmin/issues/251 - avoid things breaking if imap_open is not present 5 years ago
David Goodwin 3551710b82
Merge pull request #294 from wuuuduu/vacation_from_mx_get_smtp_server
Find MX record of receiver and use it
5 years ago
wuuuduu 86852b3dbd Find MX record of receiver and use it 5 years ago
David Goodwin 60c44a3ca3
Merge pull request #290 from akhilin/master
a small mistake in user_query with quota
5 years ago
Akhil Jalagam 53cefa1107
[NEW BADGE] freenode irc badge at #postfixadmin 5 years ago
Akhil Jalagam 3295334dd7
[NEW BADGE] repo size added 5 years ago
Akhil Jalagam 0f64f22a7e
a small mistake in user_query with quota
mistake in user_query with quota enabled for dovecot 1.2+
It took two days for me to find this issue.

Thank you,
Akhil
5 years ago
David Goodwin bc273a97e4 Revert "apply patch for vacation body encoding - see #288"
This reverts commit c3d3a9dbc8.

See comment at: https://github.com/postfixadmin/postfixadmin/issues/288#issuecomment-522495422
5 years ago
David Goodwin e8fb276c2f
Merge pull request #289 from akhilin/master
Update DOVECOT.txt
5 years ago
Akhil Jalagam 1941f970bd
Update DOVECOT.txt
a small mistake in documentation for imap quota.
5 years ago
David Goodwin 6a89b9a363 composer format 5 years ago
David Goodwin bee5fcbe24 improve setup form - only display "add superadmin account" if setup password is configured; change verbs depending on context etc; see https://github.com/postfixadmin/postfixadmin/issues/263 5 years ago
David Goodwin fa27c7c8b7 reindent/reformat 5 years ago
David Goodwin 7b18d0386c
Merge pull request #287 from gabrielfin/fix-pagination
Fix pagination
5 years ago
David Goodwin 296fc2f48e silence psalm error - cast $show_password_fields to an int in model/MailboxHandler.php lines 33/34 5 years ago
David Goodwin c3d3a9dbc8 apply patch for vacation body encoding - see #288 5 years ago
David Goodwin a0b4e690b2 only load random_compat if PHP_VERSION is < 7.0 5 years ago
David Goodwin d788c6ac99
Merge pull request #285 from Nutomic/ssl-sendmail
Use TLS to send emails
5 years ago
Felix Ableitner 8ba1cf20a7 use config::bool instead of read_string 5 years ago
David Goodwin 55bf13298e
Merge pull request #286 from gabrielfin/master
Use percentage for quota levels
5 years ago
Unknown 88587f4cd3 Fix pagination 5 years ago
Unknown 7583decbcb Use percentage for quota levels in bootstrap theme 5 years ago
Gabriel c3065bdace Use percentage for quota levels 5 years ago
Felix Ableitner a46245eecc Add config option for TLS 5 years ago
Felix Ableitner 61ede42800 Send emails with TLS 5 years ago
David Goodwin 8b19ef21cf add default value for password_expiry (default to one year)
should fix: https://github.com/postfixadmin/postfixadmin/issues/280
5 years ago
David Goodwin c53d17fff7 support TRUE orFALSE strings just incase 5 years ago
David Goodwin 01477f0009
Merge pull request #277 from Nutomic/admin-smtp-password
Add option to use smtp password when sending admin emails (fixes #272)
5 years ago
Felix Ableitner 600248e955 Add option to use smtp password when sending admin emails (fixes #272) 5 years ago
Christian Boltz 55858bf3a0
Fix table names in gen_show_status()
... by using table_by_key() instead of reading $CONF directly.
Otherwise, $CONF['database_prefix'] gets ignored and the query tries to
use a wrong table name.

This fixes a bug introduced in d809e0fbf7
5 years ago
David Goodwin 651688c802 if we are generating passwords, there will only be one password value; so reduce the fields we check before deciding whether to update password_expiry - see https://github.com/postfixadmin/postfixadmin/issues/266 5 years ago
David Goodwin 1d1960a476 if CONF['generate_password'] == 'YES' then do not display password fields
Given we autogenerate a password ....
5 years ago
David Goodwin ae476950f2 try and avoid smarty complaining about no variable $conf - see https://github.com/postfixadmin/postfixadmin/issues/266 5 years ago
David Goodwin 3ff2436f2f try a bit harder to avoid non-numeric argument issues with $multiplier
(see https://github.com/postfixadmin/postfixadmin/issues/266 )
5 years ago
David Goodwin 8e2e4eb189 run: composer format 5 years ago
David Goodwin 03b9483204 default to providing a password_expiry datetime value - even if password_expiry is turned off - this should fix https://github.com/postfixadmin/postfixadmin/issues/280 5 years ago
David Goodwin 95429a6963 reindent, remove comment 5 years ago
David Goodwin 3322b43bb6 see: https://github.com/postfixadmin/postfixadmin/issues/282 - try and ensure local_part contains an @ on creating a mailbox 5 years ago
David Goodwin 78764578db update languages to include the mailbox local_part string 5 years ago
David Goodwin d64eadf609 try and stop $_SERVER[REQUEST_SCHEME] not being defined - see https://github.com/postfixadmin/postfixadmin/issues/279 5 years ago
David Goodwin cc19870923 drop function: db_connect_with_errors(); just throw from db_connect() if something goes wrong 5 years ago
David Goodwin 87746e6de8
Merge pull request #281 from Nutomic/db-exceptions
Dont swallow database connection exceptions
5 years ago
Felix Ableitner 5d0a587fe7 Dont swallow database connection exceptions 5 years ago
David Goodwin 31de6c6d66
Merge pull request #278 from HeavyThumper/master
list.tpl - fix lowercase typo for $CONF variable reference for quota …
5 years ago
HeavyThumper 16bf5cab7f
list.tpl - fix lowercase typo for $CONF variable reference for quota handling 5 years ago
David Goodwin 71402e9051 comment 5 years ago
David Goodwin ad858592f4 remove password_expiry logic from generic db_update function; the various *Handler classes should fix the password_expiry field already and this just breaks PgSQL; see #264 5 years ago
David Goodwin 7ed4df5459
Merge pull request #265 from r0l1/master
Allow Top-Level-Domain with 1 char
5 years ago
Roland Singer 23a7f1bfda allow TLD with 1 char 5 years ago
David Goodwin 3fc5c74040 drop old / invalid postfix paramaeters - see #262 5 years ago
David Goodwin d4d47e02cc .deb packaging: move php-imap from being a dependency to a suggestion - see https://github.com/postfixadmin/postfixadmin/issues/251 5 years ago
David Goodwin 684cf3d829
Merge pull request #255 from csware/quota-level
Make quota levels configurable
5 years ago
Sven Strickroth 56395709f3 Make quota levels configurable
Signed-off-by: Sven Strickroth <email@cs-ware.de>
5 years ago
David Goodwin 852a09f138 move version string output to only be shown to logged in users - see #252 5 years ago
David Goodwin dcef888587 token test coverage 5 years ago
David Goodwin 045a19ae33 re-format 5 years ago
David Goodwin 7ed57a0cda assume the db updates work if no exception was thrown 5 years ago
David Goodwin 9024dddf46 move password_expiration code into the MailboxHandler. 5 years ago
David Goodwin b8ee437169 add throw_exceptions parameter to db_update and db_insert. 5 years ago
David Goodwin df99e66b2d try and stop "A non-numeric value encountered in ..."; see #239 5 years ago
David Goodwin 4a084d91b5
Merge pull request #249 from mtdcr/scram-sha-1
pacrypt_dovecot: Don't blacklist SCRAM-SHA-1
5 years ago
Andreas Oberritter 000416c401 pacrypt_dovecot: Don't blacklist SCRAM-SHA-1
Actually it doesn't include the username at all. Fixes commit f444de4.
5 years ago
David Goodwin e9ed15143e add token MailboxHandler test 5 years ago
David Goodwin de5b739d4a drop unnecessary common.php 5 years ago
David Goodwin 28e687ff5b sqlite does not support NOW(), use a string comparison 5 years ago
David Goodwin 7718ca808d try adding code coverage things 5 years ago
David Goodwin 2a0f708529 relax version check for php-cs-fixer so it will work with php7.3 as well 5 years ago
David Goodwin 215daecf29
Merge pull request #248 from Slamdunk/patch-1
[Travis] Build also against PHP 7.3
5 years ago
Filippo Tessarotto 361f0ccb22
[Travis] Build also against PHP 7.3 5 years ago
David Goodwin 9ccf5250cd remove config dump 5 years ago
David Goodwin 81fed601a2 remove var_dumps 5 years ago
David Goodwin 06513c2a14 remove quotes around table name which is not necessary as table_by_key does this 5 years ago
David Goodwin 079462bb29 wrong password variable/key 5 years ago
David Goodwin 496657aa5d echo something helpful on db error when testing 5 years ago
David Goodwin d6fc337272 dump mysql config things; lets fumble about in the dark once again and see... 5 years ago
David Goodwin 2e87464fc8 initial attempt at connecting to mysql socket file through pdo 5 years ago
David Goodwin d30c122f37 possible handling of mysql socket file 5 years ago
David Goodwin 018f5d9e05 check output / travis fun 5 years ago
David Goodwin fe48b35cfd split multiple queries into single ones to keep pdo/prepared statements happy 5 years ago
David Goodwin 4cb36857da possibly better defaults/output 5 years ago
David Goodwin f52aa9929a re-format 5 years ago
David Goodwin 9cc04df973 move the password expiry date to be php generated so it works fine on all databases 5 years ago
David Goodwin 8632cbd1a9 improve documentation around the various crypt functions 5 years ago
David Goodwin 17a420152c use pdo/prepared statement for list-virtual + page browser 5 years ago
David Goodwin d95ee79b9a reformat 5 years ago
David Goodwin 69b9d9671c fix PaCrypt test 5 years ago
David Goodwin dcb60a670c try adding mysql + postgres support to tests 5 years ago
David Goodwin 4d7ac16bfb bump install instructions to 3.2.2 tag 5 years ago
David Goodwin 730a05cdd3 phpcs fix 5 years ago
David Goodwin ed99a46ec4 log if no mechanisms were used for password recovery 5 years ago
David Goodwin db4aecd23c typo fix 5 years ago
David Goodwin 237f34d38f
Merge pull request #246 from 8ctopus/master
updated installation instructions
5 years ago
8ctopus 47bbb7c2a3 updated: git checkout version 3.2.1 instead of 3.2 5 years ago
David Goodwin a05f87723f reformat 5 years ago
David Goodwin 28870e4b45 explode if there is no db connection made 5 years ago
David Goodwin 0afdb5619b fix tests 5 years ago
David Goodwin b4564958a1 phpdoc; touch sqlite file before trying to use it in tests 5 years ago
David Goodwin a71669fba8
Merge pull request #245 from 8ctopus/master
db_connect_with_errors() improvements for SQLite databases
5 years ago
8ctopus b37e3c859d added: installation instructions for SQLite 5 years ago
8ctopus 637220a3fb fixed: typos 5 years ago
8ctopus 5528d8be30 added: line break so $error_text is on its own line 5 years ago
8ctopus 4f2dab357c the directory the SQLite database is in must be writeable 5 years ago
hawk ceae3caa37 sqlite3 databases: check that the file exists and is writeable 5 years ago
David Goodwin 92d6259cd0 possibly fix PGSQL PDO DSN to be unicode aware; see #243 5 years ago
David Goodwin 76e30d1dd3
Merge pull request #244 from 8ctopus/master
fix setup db_connect_with_errors PDO exceptions were not caught
5 years ago
hawk c71dd25afa fix setup db_connect_with_errors PDO exceptions were not caught 5 years ago
David Goodwin 888524af99
Update INSTALL.TXT
add chcon note for centos etc.
5 years ago
David Goodwin 4d24ab7171 possibly update language files 5 years ago
David Goodwin 2cf73f704a $0 may not be in $PATH 5 years ago
David Goodwin 93a127d7f2 see https://github.com/postfixadmin/postfixadmin/issues/236 5 years ago
David Goodwin 63f63a58b7
Update INSTALL.md
add 1; for vacation.conf file
5 years ago
Christian Boltz 5bc85bec44
fix error message in Config::read_array(() 5 years ago
Christian Boltz acf20bbc9e
move comments to the beginning of upgrade.php 5 years ago
David Goodwin a2e2cdce8c
Update CHANGELOG.TXT 6 years ago
David Goodwin 66747337f9 fix formatting 6 years ago
David Goodwin 583b8958c7 psalm 6 years ago
David Goodwin 7f8fd5ec1a Merge branch 'master' into feature-try-pdo 6 years ago
David Goodwin 83a4ee39b0 more phpdoc 6 years ago
David Goodwin 26d769740c silence some psalm warnings 6 years ago
David Goodwin e9d12bf918 silence some psalm warnings 6 years ago
David Goodwin 7838e85ff0 fix formatting 6 years ago
David Goodwin 5db463b35c improve docs 6 years ago
David Goodwin 6225899863 Merge remote-tracking branch 'origin/master' into feature-try-pdo 6 years ago
David Goodwin e6666e0af0 attempt to improve installation instructions 6 years ago
David Goodwin cef2ba5598 Merge remote-tracking branch 'origin/master' into feature-try-pdo 6 years ago
David Goodwin fb1bffbbf9
Merge pull request #232 from volp1s/patch-1
Fix for MySQL 8
6 years ago
Luca e347b4677b
Fix for MySQL 8
The keyword ROW became reserved in MySQL 8.0.2
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-R
6 years ago
David Goodwin 570972944d Merge remote-tracking branch 'origin/master' into feature-try-pdo 6 years ago
David Goodwin 10446a0cad avoid: Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(. from psalm 6 years ago
David Goodwin 5d47b85b9d remove attribute that is in parent class 6 years ago
David Goodwin 5a9efc18f0 just disable psalm caching 6 years ago
David Goodwin 3da5b64677 stab in the dark 6 years ago
David Goodwin 9bb00499c7 stop caching vendor 6 years ago
David Goodwin 18312a8aaa formatting... 6 years ago
David Goodwin cc079b773f fix formatting 6 years ago
David Goodwin 020343999a
Merge pull request #221 from SuperVirus/fetchmail_different_source_port
Allow different port for fetchmail
6 years ago
David Goodwin 98536f03e8 fix sqlite upgrade check; remove test database between runs; ignore lib/array_column.php from linting 6 years ago
David Goodwin e26877f2f9 add almost forgotten file: array_column.php 6 years ago
David Goodwin 803e2342f8 fix psalm issues; reformat; rename new db functions 6 years ago
David Goodwin 1176c9ce78 reformat; fix some transition bugs 6 years ago
David Goodwin ea33d9951a try migrating to pdo 6 years ago
David Goodwin eb61141d2f
Merge pull request #230 from 8ctopus/setup-warning
add warning on setup over http connection
6 years ago
hawk 51320919fc add warning on setup over http connection 6 years ago
David Goodwin ccb000467d
Merge pull request #229 from 8ctopus/update-translation-fr
Update fr.lang
6 years ago
hawk 67010c86e3 Update fr.lang 6 years ago
David Goodwin a500d2557e fix indentation 6 years ago
David Goodwin d78fb1fbbd move to Shell 6 years ago
David Goodwin e5cacbec90 add missing attribute 6 years ago
David Goodwin 78276534d9 remove error log prefix; use db_mysql 6 years ago
David Goodwin 7e7f644952 skip this check if unit test 6 years ago
David Goodwin 897893f3ce fix indentation 6 years ago
David Goodwin 8a59c9548a reformat 6 years ago
David Goodwin e8eea39b9d reformat; try and persuade people to move off use of "mysql" (to mysqli); add php version warning 6 years ago
David Goodwin 2b31e71d5c improve error message 6 years ago
David Goodwin 8798a65a06 remove db_array() function (not in use); use Config::read_string(..) more 6 years ago
David Goodwin cdacb5697f improve formatting of error message; remove use of db_array (to be removed). 6 years ago
David Goodwin 2ea829eb7a fix postgresql compatability - see #227 6 years ago
David Goodwin b91c7a4ef8
Update README.md 6 years ago
David Goodwin 4b990ff330 fix sql for notification resend; see #226 6 years ago
David Goodwin d4e5470f7c try and improve README.md markup 6 years ago
David Goodwin 4d6cb9c328 touch config.local.php in build 6 years ago
David Goodwin 63ca48eb6b work around templates_c not existing in git 6 years ago
David Goodwin 5441295e25 phpcs? 6 years ago
David Goodwin d4ef211a19 only build with php7.2; run composer build etc (travis) 6 years ago
David Goodwin b2e814967f try and get working under travis ... 6 years ago
David Goodwin 590c80f0bc add more unit tests; re-enable random_int warning in functions.inc.php for old php versions etc etc 6 years ago
David Goodwin e8acb609c2 reformat 6 years ago
David Goodwin 20b1eb842e fix sqlite display of password expired check for mailboxes 6 years ago
David Goodwin 1dfb03ea32 fix sqlite query for mailbox password_expiry 6 years ago
David Goodwin e949e76acd add check-format to build step 6 years ago
David Goodwin 4fcdba9cf4 run php-cs-fixer (code reforamt) 6 years ago
David Goodwin 5eba76ac36 add composer build target 6 years ago
David Goodwin 19cda31849 remove psalm warnings from code; fix password_expiry behaviour when enabled/disabled on MySQL 6 years ago
David Goodwin d74b276192 ignore more 6 years ago
David Goodwin 9c476be17f move into DOCUMENTS 6 years ago
David Goodwin 93967030c7 remove composer.lock 6 years ago
David Goodwin 5d6dde7bff psalm fixes 6 years ago
David Goodwin 76ec4bc84d token psalm fixes 6 years ago
David Goodwin 5bc6e93347 fix query fields etc 6 years ago
David Goodwin 77b87107f9 improve composer behaviour for psalm; bump dev dependencies and add sqlite3+mysqli 6 years ago
David Goodwin 59dc05d746 use newer method (return type is consistent) 6 years ago
David Goodwin 766c947190 fix case of $conf; improve comments 6 years ago
David Goodwin 166574efae add {IF_NOT_EXISTS} for sqlite tables - see #225 6 years ago
David Goodwin 5d74ff4cc7 only require language if non-empty 6 years ago
David Goodwin 01c8b14a44 PFASmarty class 6 years ago
David Goodwin d146f51feb remove duplication of PFASmarty class 6 years ago
David Goodwin 74002bbf57 psalm fixes 6 years ago
David Goodwin 8d2a592aa9 bump psalm version; autoload config and functions files 6 years ago
David Goodwin 029c4ffe47 psalm fixes 6 years ago
David Goodwin 7408a3b30a fix safepost doc 6 years ago
David Goodwin 173d5775cd psalm fixes 6 years ago
David Goodwin 97528f3ebd remove var_dumps; fix assertEqual -> assertEquals and other random psalm findings 6 years ago
David Goodwin 93cc4d9e8c update phpunit tests to use different parent class 6 years ago
David Goodwin 9b8c067515 bump phpunit to stop countable warning with php7.2 6 years ago
David Goodwin 8cf7947f15 move function into the only place it is used 6 years ago
David Goodwin cecfe6b215 see #217 - should solve looking in /etc/postfixadmin ... 6 years ago
Christian Boltz 18be203039
add new texts to all language files 6 years ago
Christian Boltz 878e4d7f11
Merge pull request #220 from SuperVirus/updated_german_translation
Updated german translation
6 years ago
SuperVirus 3ee8b497f1
Update de.lang 6 years ago
Christoph 'SuperVirus' Heitkamp d35e66808b Allow different port for fetchmail 6 years ago
Christoph 'SuperVirus' Heitkamp 1fea1f8c3b Updated german translation 6 years ago
David Goodwin dda0302cdf
Merge pull request #218 from cweiske/specific-login-error
Change login failure message to show the login type (admin or user)
6 years ago
Christian Weiske 3960f6fdad Change login failure message to show the login type (admin or user) 6 years ago
David Goodwin 55790f9835
Merge pull request #215 from ChoiZ/patch-1
Update INSTALL.TXT
6 years ago
François LASSERRE 9598c63fc0
Update INSTALL.TXT
Missing `cd postfixadmin`
6 years ago
David Goodwin a53165d3d8 update CHANGELOG - see https://github.com/postfixadmin/postfixadmin/issues/176 6 years ago
David Goodwin 69e234f668
Merge pull request #200 from doktoil-makresh/master
Support for password expiration, managed in PostFix Admin
6 years ago
Damien Martins 78a461f07e Accepts incoming emails for active mailboxes, even if password is expired 6 years ago
David Goodwin b4a16a0313 quote shell vars 6 years ago
David Goodwin 435d97c282 try looking for alternatives to maildirmake etc - see #213 6 years ago
Christian Boltz 056e8af99b
Change $PALANG['password_no_characters'] to new text if untranslated
That's better than a TODO note next to the old english text ;-)
6 years ago
Christian Boltz bd847e38e6
add translation notes for updated $LANG['password_no_characters'] 6 years ago
Damien Martins 9e4d64ef78
Merge pull request #1 from DavidGoodwin/doktoil-master
updates to password expiry feature
6 years ago
David Goodwin 3a8762d785
Merge pull request #210 from inkVerb/master
Change "characters" to "letters" in EN language file
6 years ago
Jesse Steele 9e8ce47849
Change "characters" to "letters"
A "character" includes letters and numbers. The requirement triggered by line 355 is for "letters". This created confusion in the past.
6 years ago
David Goodwin 87472af5ba add Date header into smtp_from(...) function - see #203 6 years ago
David Goodwin b1795ab596 phpdoc 6 years ago
David Goodwin 1e158245d6 try and fix #30 - cope with timestamp and numeric field number comparison better for PostgreSQL. 6 years ago
David Goodwin afd418675c pointless comment 6 years ago
David Goodwin a8b02cfc05 Default to default values 6 years ago
David Goodwin 77d1b6c2e7 rename sql fields to just have mailbox.password_expiry and domain.password_expiry 6 years ago
David Goodwin 27c2842cd2 remove duplication of sql, remove use of functions (hopefully unnecessary) 6 years ago
David Goodwin a455916a6b add password expiry stuff to the db schema upgrade script 6 years ago
Damien Martins 8115d8d047 Reverting unexpected changes 6 years ago
Damien Martins 12ce418f79 No need to have password expiration value in config file 6 years ago
Damien Martins 84533224ba Adds colored indicators for password expired, account disabled and vacation enabled accounts 6 years ago
Damien Martins b33d79125c Merge branch 'master' of github.com:doktoil-makresh/postfixadmin 6 years ago
Damien Martins d809e0fbf7 Adds colored indicators for password expired, account disabled and vacation enabled accounts 6 years ago
Damien Martins 72dddbc93b Adds colored indicators for password expired, account disabled and vacation enabled accounts 6 years ago
Damien Martins ce60b9fa59 Now password expiration is managed through Postfix Admin GUI 6 years ago
Damien Martins ab10c9b49a Better arguments management 6 years ago
Damien Martins 9be8c8082f More details in README file 6 years ago
Damien Martins 29a993e6fd Better (aka safer) way to deal with authentication 6 years ago
Damien Martins e786609aa9 Adding support for password expiration. Please read README.password_expiration for more details 6 years ago
David Goodwin c3d3898eb2
Merge pull request #167 from csware/recipient_delimiter
vacation: Correctly process mails with recipient_delimiter
6 years ago
David Goodwin cde3d7530d
Merge pull request #194 from cantoute/patch-1
libmime-perl => libemail-mime-perl on debian 9
6 years ago
Antony 61011619a8
libmime-perl => libemail-mime-perl on debian 9 6 years ago
David Goodwin ba14535489
Merge pull request #172 from abonanni/bootstrap
Bootstrap Integration
6 years ago
David Goodwin a981ff8172 list.php csv export: implode array values, suppress fields with empty label after trimming (html status) 6 years ago
Christian Boltz 77670f36f6
revert CSV separator to ";"
This reverts c5c42cfbe8 ("remove custom
field separator; just go with the default php behaviour").

That change didn't improve anything on
https://sourceforge.net/p/postfixadmin/bugs/386/ - it "just" changed the
CSV file format which might break existing workflows and/or tools of our
users.
6 years ago
David Goodwin 39bb2dbcd6 see remove outdated doc links - see #191 6 years ago
David Goodwin c5c42cfbe8 remove custom field separator; just go with the default php behaviour 6 years ago
David Goodwin 00877885cf update installation instructions - see #189 and #188 6 years ago
David Goodwin 6d328795cb remove windows code; remove array_merge (seems to just break parsing) 6 years ago
David Goodwin 563b8c7636 phpdoc fixes (psalm) 6 years ago
David Goodwin 45fd1bf08b silence psalm a little; bump parallel-lint version 6 years ago
David Goodwin 532eb09f1f possible readability improvement 6 years ago
David Goodwin 76ee147375 phpdoc fix 6 years ago
David Goodwin aa38d0090d token fixes; code looks incomplete anyway 6 years ago
David Goodwin 97c48a0fc9 fix phpdoc 6 years ago
David Goodwin 299735773e fix phpdoc 6 years ago
David Goodwin ec085b668b missing class property 6 years ago
David Goodwin 9c0e1dd575 phpdoc fixes 6 years ago
David Goodwin 318ac048d5 psalm fixes 6 years ago
David Goodwin c44e82cc2d phpdoc fix 6 years ago
David Goodwin b6f75c9c2c try and require Phar extension through setup if we are using php_crypt and PHP version < 7 6 years ago
David Goodwin 1f643a052f see #185 - try putting the session_ recreation stuff in an else { ... } 6 years ago
David Goodwin a787c0fc1e
Merge pull request #181 from Sopsy/master
Add support for difficulty setting for php_crypt
6 years ago
Aleksi Kinnunen 2df4348f09
Typo fix 6 years ago
Aleksi Kinnunen 48c19a1cbd
Combine encrypt CONF-keys
Went through the old PR #25, updated the encrypt rounds/cost setting to be in the encrypt -configuration key as per suggestion from @cboltz
6 years ago
Aleksi Kinnunen c1b5e66e27
Add missing global
... you should never edit with the GitHub web GUI, lazy me.
6 years ago
Aleksi Kinnunen b676e8337f
Allow empty $CONF['encrypt_difficulty'] for defaults 6 years ago
Aleksi Kinnunen 7b16e8a1c2
Add info about php_crypt and encrypt_difficulty to sample config 6 years ago
Aleksi Kinnunen 9c2161a549
Added support for password generation cost/rounds
$CONF["php_crypt_difficulty"], only for php_crypt:BLOWFISH, php_crypt:SHA256 and php_crypt:SHA512
6 years ago
David Goodwin 6100ca4cf9 try and fix #177 (add missing fields to sqlite db) 6 years ago
David Goodwin 1c4a6080d7 make phar loading optional depending on the extension being present or not 6 years ago
David Goodwin 9c7f60fa76 possible fix for sqlite schema/upgrade issues; see #177 and and #176 6 years ago
David Goodwin 3754381f0e
Merge pull request #175 from racerxdl/master
'row' is a reserved word in MySQL 8.0
6 years ago
Lucas Teske 11f9680963
'row' is a reserved word in MySQL 8.0 6 years ago
Christian Boltz 05bf2d2013
if unconfigured, recommend to edit config.local.php
... instead of config.inc.php

(idea based on comments on
7c38bdd871 )
6 years ago
Christian Boltz 2eb5a7ed60
simplify function_exists() checks for random_int()
It's easier to define a compat function than to have function_exists()
checks all over the code.
6 years ago
root bd85b3725f Bootstrap TPL for user interface 6 years ago
root 5dcd203d8f Gestion des dates de vacation 6 years ago
root fb3e968cfc Bootstrap template integration 6 years ago
David Goodwin 603c5195df update debian changelog (v3.2) 6 years ago
Christian Boltz 9044bed288
re-order some changelog entries and adjust date 6 years ago
David Goodwin b4849b8431 bump minimum db version 6 years ago
David Goodwin 4c6bcdbc39 update version 6 years ago
David Goodwin a510981350 update with notes on php_crypt and smarty 6 years ago
David Goodwin 5b7f4cda48 add phpdoc comments, default php_crypt hash to use SHA512 rather than MD5 6 years ago
David Goodwin 7282928e6d update generate_password() to allow length to be specified; update test 6 years ago
David Goodwin 7388a7ca62 remove notice about additional plugin - lost with time, does not seem to be used 6 years ago
Christian Boltz a3feba7c73
change default for php_crypt to SHA512
(+ a few whitespace changes)
6 years ago
David Goodwin bd5ac21398 update debian dirs etc to cope iwth smarty->lib/smarty 6 years ago
David Goodwin 1308c52355 refresh debian patch 6 years ago
David Goodwin b48f99d4c6 reformat (phpcs) 6 years ago
David Goodwin e7f9d536d9 change default salt method with php_crypt 6 years ago
David Goodwin f7ba904800 see #171 6 years ago
David Goodwin f1a15b2269 phpunit.xml file 6 years ago
David Goodwin 2f2730ffa0 add more tests 6 years ago
David Goodwin f543c7d403 use random_int() if available 6 years ago
David Goodwin 94f05bf9e4 switch to store $config internally within an array 6 years ago
David Goodwin 7c0cb82be8 use random_int if it is available 6 years ago
David Goodwin 0d211949c9 skip tests unless configuraton updated 6 years ago
David Goodwin b97decb7c2 add a lib directory; move smarty into it; add random_compat phar (for random_bytes() on PHP < 7) 6 years ago
David Goodwin a4760ef53c
Merge pull request #170 from snuggeman/php_crypt
multiple hash algorithms using crypt (pfa 3.2)
6 years ago
snuggeman 11f0ceb615 added php_crypt scheme 6 years ago
David Goodwin b25a04a43f
Merge pull request #169 from abonanni/master
Update french language
6 years ago
Aurélien BONANNI 3ea4f80e34 Update french language 6 years ago
Christian Boltz 24ad5cc3d8
Set $reset_by_sms even if password reset is disabled
... to avoid an "undefined variable" warning
6 years ago
Christian Boltz 7c38bdd871
add a big notice about using config.local.php 6 years ago
Sven Strickroth f0f6c16afa vacation: Correctly process mails with recipient_delimiter
Signed-off-by: Sven Strickroth <email@cs-ware.de>
6 years ago
Christian Boltz 7f19cae57e
Add a index.php showing a note about the "public" directory
This avoids that users get a 403 error (if DirectoryIndex is disabled)
or a directory listing after updating to 3.2.

This is what likely happened in
https://github.com/postfixadmin/postfixadmin/issues/30 (see the comment
from Apr 24, 2018)
6 years ago
David Goodwin f05f118d4d bump smarty version (doc) 6 years ago
David Goodwin 2ba2802774 bump Smarty to v3.1.32 (possible security fix, numerous bugs listed at https://github.com/smarty-php/smarty/blob/master/change_log.txt 6 years ago
David Goodwin 9a07772626 remove commented out echo 6 years ago
Christian Boltz 11ded0a4d8
Changelog for 3.2 6 years ago
Christian Boltz 3f1866d041
display phone number field only if $CONF[sms_send_function] is set
Without a way to send a SMS, asking users for their mobile number is
pointless.
6 years ago
Christian Boltz cdf3c9acb9
initStruct(): use multiopt for 'id' 'dont_write_to_db'
This also means we can drop the 0 for not_in_db because this is the
default.
6 years ago
Christian Boltz 30c61e81b3
better comment for pacol() parameter 6 years ago
Christian Boltz cd0a718d52
add config.local.php to .gitignore
It should never be commited to git
6 years ago
Christian Boltz d2588a4de2
Fix phpcs whitespace breakage in initStruct etc. 6 years ago
David Goodwin 5e4e0bb426
Merge pull request #158 from ondrej-zary/master
Update Slovak language
6 years ago
Ondrej Zary 957657c853 Update Slovak language 6 years ago
Christian Boltz 9bd230cd46
fix syntax error in ja.lang 6 years ago
Christian Boltz c7201afa6c
drop unused shells/mailbox.php 6 years ago
Christian Boltz 12c4a4f29e
move shells/shell.php to model/Shell.php
... and drop a few lines in postfixadmin-cli.php that became superfluous
by this move (thanks autoloader!)
6 years ago
Christian Boltz 71d61a1d8a
drop superfluous Config::read('all') call 6 years ago
Christian Boltz 48a3709041
postfixadmin-cli: get rid of empty/unused initialize() 6 years ago
Christian Boltz 36fe1f6ccc
remove deleted functions from $protectedCommands
If grep -r doesn't find a function, we don't need to keep it in
$protectedCommands ;-)
6 years ago
Christian Boltz 5e93dfe604
postfixadmin-cli: drop (undocumented) -webroot etc.
Dropping the -webroot parameter (which basically means hardcoding that
../common.php has to exist) allows to do quite some cleanup.

Also unconditionally require_once('../common.php') to ensure that
everything we expect in the global namespace (like the 'Conf' class) is
there.

This allows even more cleanup. We get rid of __bootstrap() and some
constants, and can simplify parameter handling.
6 years ago
Christian Boltz 500c847fe0
re-add lost comment 6 years ago
Christian Boltz 91c07c9eae
VacationHandler: re-enable and fix code in validate_new_id()
Note that vacation.php doesn't use this function yet, so it's not
surprising that users didn't notice the broken code.
6 years ago
David Goodwin 4f1dd314e7
Merge pull request #154 from Jan-Kruis/master
Update nl.lang
6 years ago
Jan Kruis 04b73c1879
Update nl.lang 6 years ago
David Goodwin 4fb4d406ee phpdoc; disable function init() - seems invalid 6 years ago
David Goodwin fef2591335 phpdoc fixes 6 years ago
David Goodwin 59a220d8d2 add psalm 6 years ago
David Goodwin bf840f93cd
Merge pull request #148 from csware/autoresponders
Don't reply to known autoresponses
6 years ago
Sven Strickroth 6c12800a78 Don't autorespond to Outlook autoresponses
Signed-off-by: Sven Strickroth <email@cs-ware.de>
6 years ago
Sven Strickroth 7cb36bc0b2 Don't autorespond to Communigate autoresponses
Signed-off-by: Sven Strickroth <email@cs-ware.de>
6 years ago
David Goodwin 2f7d3d9534 remove (possibly) unnecessary Config::read(all) calls ... see #144 6 years ago
David Goodwin f8d7844767 reduce some nesting of the code loops 6 years ago
David Goodwin 898a8145f2
Merge pull request #143 from Seitanas/master
Making virtualmaidel.php remove Sieve filters if they exist
6 years ago
Tadas Ustinavičius 9ab2eaedc6 Only delete Sieve directory if it really exists 6 years ago
Tadas Ustinavičius d986e26be8 Making virtualmaidel.php remove Sieve filters if they exist 6 years ago
David Goodwin b64e202508
Merge pull request #142 from racerxdl/master
Fixed "Incorrect integer value: 'Array' for column" error in updates.
6 years ago
Lucas Teske 50ac4c7597
Fixed "Incorrect integer value: 'Array' for column" error in updates. 6 years ago
David Goodwin d57aa46eb5 remove explode() 6 years ago
David Goodwin 2a1d8daeba remove unused variables 6 years ago
David Goodwin 3228fa1fcb
Update README.md 6 years ago
David Goodwin b79ad2ae28 composer format ... 6 years ago
David Goodwin 6446f3f6cc split up pacrypt() into different functions; add some minimal test coverage 6 years ago
David Goodwin 6ed1527497 fix phpdoc 6 years ago
David Goodwin 12242b0893 add ZF1 as a dependency and phpunit; remove require/include calls from tests/ 6 years ago
David Goodwin 9462c0cb7b composer magic 6 years ago
David Goodwin cb34da4f46 phpcs reformat 6 years ago
David Goodwin 2dc502e684 add postfix postgresql dovecot example to DOCUMENTS - see #136 6 years ago
David Goodwin 68a42dd331
add docker image link to README.md
Add link to Docker images
6 years ago
David Goodwin 152975d05c move to use db_assoc() rather than db_array() (code assumes assoc. array) 6 years ago
David Goodwin c147eb053b move to use db_assoc() rather than db_array() (code assumes assoc. array) 6 years ago
David Goodwin 43a2493876 remove unused code. 6 years ago
David Goodwin 4dec9cd24e refactor (reduce nesting) 6 years ago
David Goodwin d088651fd6 Drop db_commit(), db_rollback(), db_begin() functions (unused). 6 years ago
David Goodwin 0b66cd6bd2 Do not try to db_escape() an SQL field. 6 years ago
David Goodwin 4e9d166765 use db_assoc() rather than db_array() as we're depending on an assoc array afterall. 6 years ago
David Goodwin 45a1073b97 change to use foreach($a as $k => $v) { ... } 6 years ago
David Goodwin 8ac94394cb improve phpdoc 6 years ago
David Goodwin e2b1233269 Use filter_var($x, FILTER_VALIDATE_EMAIL) as an extra check if we can in check_email(...) 6 years ago
David Goodwin 5e1855632a allow local aliases - see #134 6 years ago
David Goodwin 2615b6fece see #132 - better broadcast mail format, perhaps 6 years ago
David Goodwin 2b8e6ff5b4
Merge pull request #131 from cygery/fix-user-logout
Destroy session when loading user login page
6 years ago
Erwin Goslawski d0897f625d
Destroy session when loading user login page
Fixes #130
6 years ago
David Goodwin 9bef45aed5 remove logout behaviour from common.php (never used); try and fix logout in login.php - see #130 6 years ago
David Goodwin d305374568 make the html slightly more html5 like; remove possibility of smarty.session.lang being undefined and erroring 6 years ago
David Goodwin 220f8289c7 see #129 - add hint 6 years ago
David Goodwin 68934539bf see #129 - be consistent over mail root dir 6 years ago
David Goodwin 828e3b2290 yet another datetime in the future that needs changing a little... 6 years ago
David Goodwin aad433eceb stop undefined error on CONF[sendmail_all_admins] 6 years ago
David Goodwin c3b87ebb11 phpcs fixes 6 years ago
David Goodwin 06f6c71c56
Merge pull request #127 from Ecodev/reformat
Reformat everything with PHP-Cs-Fixer
6 years ago
Adrien Crivelli 15df6c1d7b
Reformat everything with PHP-Cs-Fixer 6 years ago
David Goodwin 943c5a94ee
Merge pull request #121 from J0WI/split-docker
Move docker to dedicated repo
6 years ago
J0WI 5e8e1dd5f0 Move docker to dedicated repo 6 years ago
David Goodwin f0be0ebf62 remove more incpath usages 6 years ago
David Goodwin 2bb583a86a remove specifying MYISAM as our default db table format; use whatever the db server wants to default to 6 years ago
David Goodwin d259544515 ignore config.local.php too 6 years ago
David Goodwin d5c40453ac update debian things, fix patch, move backup.php to public, fix lighttpd config 6 years ago
David Goodwin 63f44c9b2d update INSTALL.TXT to mention public/ etc 6 years ago
David Goodwin 104561c419 change to public/ in apache alias 6 years ago
David Goodwin 3d63d8b9af update debian things to perhaps cope with public/ 6 years ago
David Goodwin 99147d51eb move public facing stuff into public/, this allows us to stop exposing templates_c/ etc to the world 6 years ago
David Goodwin 436bbe87a8 change DATEFUTURE to 2038-01-18 ... - see #126 6 years ago
David Goodwin e1d42ed7d3 rename script commands 6 years ago
David Goodwin 2fc3af0b73 composer.lock 6 years ago
David Goodwin 80d30d81e9 add parallel-lint 6 years ago
David Goodwin d9f66eca4c minimal php_cs.dist file - PSR2 with braces for class opening on the same line 6 years ago
Adrien Crivelli 6f7e75dc63 Introduce PHP-CS-Fixer and Travis to enforce code style
Commands `composer check` and `composer fix` can be used to respectively
check and automatically fix code style in the entire project.
6 years ago
David Goodwin 3593d23c6f remove undefined variable _SERVER[REQUEST_METHOD] when running from the cli 6 years ago
David Goodwin 772a882c74
Merge pull request #124 from sitilge/master
Password reset  - fix invalid DB query (double backtick)
6 years ago
Martins Eglitis 97f0fa2c3d Fix invalid DB query (double backtick) 6 years ago
David Goodwin 938e7dcb7d
Merge pull request #122 from dryware-fr/patch-1
Typo correction
7 years ago
dryware-fr e4bfae260b
Typo correction
There was a typo in the script, rendering a TCP connection to MySQL or Postgres impossible.
7 years ago
Christian Boltz 75bcf3091b
Fix instructions for templates_c directory in UPGRADE.txt
Also add instructions for SELinux, and fix the version number describing
since when templates_c is used.

Fixes: https://github.com/postfixadmin/postfixadmin/issues/119
7 years ago
Christian Boltz 3bd7ef2b0a
adjust pgsql $row['v_active'] only if vacation is enabled
This avoids an "Undefined index" warning if vacation is disabled.

Fixes: https://github.com/postfixadmin/postfixadmin/issues/118
7 years ago
David Goodwin 9982783481
Merge pull request #117 from mzch/ja_fix
Remove '# XXX'
7 years ago
Koichi MATSUMOTO 70c839cbc6 Remove '# XXX'
Removed '# XXX' comments
7 years ago
David Goodwin a52eeaf020
Merge pull request #116 from mzch/ja_fix
Ja fix
7 years ago
Koichi MATSUMOTO 9aeec2147e Update ja.lang
Update ja.lang with the latest
7 years ago
Koichi MATSUMOTO 9b7cfdf807
Update ja.lang
in progress...
7 years ago
David Goodwin a320b67508 possible fix for issue in #112 - PostgreSQL does not like backticks (only do them for MySQL) 7 years ago
Christian Boltz 977f335a0f
Fix quoting in table_by_key()
This fixes a regression introduced by
https://github.com/postfixadmin/postfixadmin/pull/112
which became only visible when using a $CONF['database_prefix']
7 years ago
Christian Boltz d04c82fbcb
change default for vacation.activeuntil to 2038
When adding the activeuntil field during the upgrade, it got set to
2000-01-01 which is a bad idea for existing vacation entries - the new
vacation.pl will consider them as outdated.

Introduce a new {DATEFUTURE}, and set the default value for activeuntil
to 2038 (that's the limit in MySQL for 'timestamp' columns, we'll have to
switch to 'datetime' in 20 years ;-)

Note that sqlite doesn't support changing the field default, so sqlite
users will have to live with the wrong default.

Also note that this fix does not change existing vacation entries if you
already have the activeuntil column.

Reported by Christoph Lechleitner on the mailinglist
7 years ago
Christian Boltz ddb94e24ee
rename upgrade_1838_mysql() to upgrade_1839() to keep all databases in sync
better fix for https://github.com/postfixadmin/postfixadmin/issues/89
7 years ago
Christian Boltz 1c0cd61fff
Add texts for password recovery to all languages 7 years ago
Christian Boltz ab666b6b7f
Fix microtime() usage
By default, microtime() returns a string :-/ which unsurprisingly causes
a warning when doing math on it.
7 years ago
Christian Boltz 8fb67e6fbf
Fix broken table names caused by doubled table_by_key() calls
The high-level db_*() functions (like db_update(), and also
_db_add_field() in upgrade.php) call table_by_key() internally, which
also means the unwrangled table name needs to be handed over to them.
If handing over an already table_by_key()'d table name, it gets modified
again and results in something like prefix_prefix_mailbox.
7 years ago
David Goodwin a27f80c01d
Merge pull request #113 from er1cs/patch-2
Update upgrade.php
7 years ago
David Goodwin 24b447f8e5
Merge pull request #112 from er1cs/patch-1
Update functions.inc.php
7 years ago
er1cs a4467a7e0b
Update upgrade.php 7 years ago
er1cs 7b8626ca81
Update functions.inc.php
I found that Mysql 8 don't like table names without `` in requests. So i make changes in function table_by_key in functions.inc.php and in upgrade.php . Now it works.  FreeBSD 11.1 Apache/2.4.29 (FreeBSD) PHP/7.1.11 Mysql 8
7 years ago
David Goodwin e478eb8b9f
Merge pull request #110 from Erwane/syslog-ident
#109 : syslog ident set to "vacation"
7 years ago
Breton Erwane 37d4279c52
syslog ident set to "vacation" 7 years ago
David Goodwin 43fb0bde77 log IP address for failed logins as well - see #105 7 years ago
Christian Boltz b06d25de8f
Merge pull request #108 from HLFH/master
favicon within images folder
7 years ago
HLFH 0972df8243 favicon within images folder 7 years ago
David Goodwin 768d29623e patch from https://github.com/bofh16/postfixadmin/blob/master/bg.lang.patch - thanks! 7 years ago
David Goodwin 7afb26fcc8 variables for docker 7 years ago
David Goodwin bdade520f4
Merge pull request #85 from julywind/master
fix invalid value for token_validity
7 years ago
houmingtao 5f1ac12d72 use current time as default token_validity value 7 years ago
David Goodwin 8bd435039b
Merge pull request #92 from leeclemens/feature-91/mysql-ssl
Add support for MySQL connections over SSL
7 years ago
Lee Clemens ebbd9025e4 Add support for MySQL connections over SSL 7 years ago
David Goodwin dbbc40b327 add example docker compose settings 7 years ago
David Goodwin ba47f2df2a update docker entrypoint - require db connection params; default to sqlite; revert to using upgrade.php as we do not need the setup.php checks 7 years ago
David Goodwin 72f32f0b3d
Merge pull request #90 from pbkwee/patch-1
singular correction.  Update en.lang
7 years ago
pbkwee f217524524
Update en.lang
"Your email address or password are not correct".  Message indicates one thing is wrong.  So use is not are.
7 years ago
David Goodwin 5720e73732 + cd docker 7 years ago
David Goodwin a77d08a92c initial Docker readme 7 years ago
David Goodwin 699267a915 fall back to sqlite for docker image 7 years ago
David Goodwin 356ca84144
Merge pull request #64 from J0WI/docker
[WIP] add Dockerfile
7 years ago
David Goodwin 0f09b8c176 _db_add_field() calls table_by_key - so avoid calling it twice ... 7 years ago
David Goodwin 17e347de7f Add id autoincrement field to log table; ought to fix #89 7 years ago
David Goodwin 90d3a0ded7 see #86 - remove unnecessary config user/group 7 years ago
David Goodwin 56e1215994 upgrade.php: output current/target version 7 years ago
root 4670182d79 fix invalid value for token_validity 7 years ago
Christian Boltz fe5e256b6d Merge pull request #79 from Ecodev/harden-password-reset
Harden password reset process
7 years ago
Sylvain Tissot ffb84283c2
Harden password reset process
The improvements are:

- Die with an explicit message when a user is trying to reset his lost password and the option is disabled in config
- Redirect user to main page after password change using relative URL
- Don't leak info whether user exists or has recovery info defined
- Throttle password reset requests to prevent brute force attacks
- Show phone/alt email fields in mailbox/admin edit form only when the password reset option is enabled
- Make database upgrade code compatible with other databases types
- Use the existing password generator to generate OTP. It is now stored in database, unique to each user, valid only for 1 hour and can only by used once.
7 years ago
David Goodwin 8bb6000072 Merge pull request #60 from Vilican/master
Security fixes
7 years ago
David Goodwin db06ac919c Merge pull request #82 from evaryont/sqlite-v1837
Upgrade SQlite db to v1837
7 years ago
Colin Shea f568309ef5 Upgrade SQlite db to v1837
Includes a TODO for v1836. Not sure if it's needed... Haven't ran into
any issues yet.
7 years ago
jowi 39dca79879 Add SQLite and PDO support 7 years ago
David Goodwin c5136c408d improve config file loading when installed from a debian package 7 years ago
jowi ec2cc0041e fix postgres dependency 7 years ago
Christian Boltz ae56c2b700
Fix syntax error in viewlog.php
Reported in issue #74
7 years ago
David Goodwin dd06aa75e0 attempt at fixing various .deb issues - link templates_c to /var/cache/postfixadmin; add postfixadmin-cli to deb and symlink into /usr/bin 7 years ago
David Goodwin 252d42dcc0 fix perms (executable) 7 years ago
David Goodwin 5c2e3d1e00 possible changes for deb package to include postfixadmin-cli in /usr/bin 7 years ago
David Goodwin 6258cc669d update quilt patches 7 years ago
David Goodwin 2fc36e82ad see #74 - fix undefined $CONF[page_size] 7 years ago
David Goodwin 4b999b3f6b improve mysqli connection settings - see https://github.com/postfixadmin/postfixadmin/issues/73 7 years ago
Matyáš Koc 3c95ec4a09 Add CSRF token 7 years ago
Matyáš Koc 9f30aa5ff4 Handle logout in a new way (user login) 7 years ago
Matyáš Koc 74c29f8a10 Handle logout in a new way (admin login) 7 years ago
David Goodwin 82e7bdfda3 fix surname typo 7 years ago
David Goodwin 9dbeb68f9a add TODO 7 years ago
David Goodwin 2b04b72072 remove unnecessary nesting, reindent, make it print out what it might do before breaking stuff etc 7 years ago
David Goodwin 9b16645c0f Merge pull request #70 from Seitanas/master
virtualmaildel.php with PHP mysqli extension.
7 years ago
Seitanas 72288b8402 Updated to use PHP mysqli extension. 7 years ago
David Goodwin 0b70b5c686 resync debian/control with debian stretch 7 years ago
jowi dbe8475ed2 pgsql support (wip) 7 years ago
David Goodwin 9841c7c86b bump file 7 years ago
David Goodwin c476a61ec4 clear stat cache so the is_writeable() result will eventually change with subsequent page reloads if the user has actually fixed the dir 7 years ago
David Goodwin 14ec596cbf bump Smarty to v1.3.31 (various fixes); add custom modifier.needle.php 7 years ago
David Goodwin a40e99c8ed renamed to INSTALL.md 7 years ago
Christian Boltz 2251c00fb8
disable password reset until it is secure
For some unknown reason, the insecure version of pull request 18 (which
uses easily guessable reset codes) was merged. This commit disables the
password reset until someone makes it secure.

See the comments in https://github.com/postfixadmin/postfixadmin/pull/18
for details.
7 years ago
David Goodwin f3b2fe68f1 Merge pull request #18 from Ecodev/password-reset
#75 Enable users to reset their passwords
7 years ago
Sylvain Tissot 7a0b3b3750 Fix typo in french language file #18 7 years ago
Sylvain Tissot 9c9ba64a7f Allows a user or admin to reset his/her forgotten password with a code sent by email/SMS #18 7 years ago
David Goodwin 25f50f262d update for https://github.com/postfixadmin/postfixadmin/issues/66 7 years ago
David Goodwin 1f63a9df89 update Install.txt -> Install.md 7 years ago
David Goodwin da9f674611 better now? 7 years ago
David Goodwin 8d2223acfa better now? 7 years ago
David Goodwin 6442c8aff4 better now? 7 years ago
David Goodwin ba8a4ab659 better markup 7 years ago
David Goodwin 76f0387313 try this 7 years ago
David Goodwin 7f2ea1a20a make github friendly, perhaps 7 years ago
David Goodwin c3a4a6ed8d remove some comments from the top of vacation.pl; add links to file(s); remove unnecessary index.php 7 years ago
David Goodwin d98e83e624 Merge pull request #61 from tkempf/Email-Sender
Replace Deprecated Mail::Sender by Email::Sender
7 years ago
tkempf 066a22cb42 Added forgotten use Statement for MIME:EncWords 7 years ago
tkempf f2d4e6dbcc Subject with non ASCII-chars still needs to be encoded 7 years ago
tkempf 34474a20e5 set default value for $no_vacation_pattern 7 years ago
tkempf 4660d65679 Renamed $novacation_pattern to $no_vacation_pattern + codestyle changes 7 years ago
J0WI 33db684562 add Dockerfile 7 years ago
David Goodwin 466bd6834c Merge pull request #63 from Callidior/viewlog-page_size
Fix unquoted string array index in viewlog.php
7 years ago
Björn Barz 3786ebc33e Fixed unquoted string array index in viewlog.php
`$CONF[page_size]` was working, but throwing E_NOTICE, so I propose changing it to `$CONF['page_size']`.
7 years ago
tkempf c5dcbeb48d Removed unused libraries MIME::Encwords and MIME::Base64 7 years ago
tkempf 79f8a63a46 Bugfix in Encoding of vacation mail. UTF-8 header was missing and the
mailbody is already utf8, so no need to recode
7 years ago
tkempf cc3d5b13e8 Add Example for $novacation_pattern 7 years ago
tkempf e5e9ce7674 When using STARTTLS the SSL_verifycn_name must be set to prevent SSL
Errors
7 years ago
tkempf 1653e58398 Bump Version to 4.1
Sending Mail now works at least without encryption
7 years ago
Matyáš Koc e903484692 Links with target="_blank" should have rel="noopener" 7 years ago
Matyáš Koc 3486a5c593 Updated comment-documentation 7 years ago
Matyáš Koc 019209abab Added CSRF check to user login 7 years ago
Matyáš Koc 7de653db58 Added CSRF check to admin login 7 years ago
tkempf b781195526 Replace deprecated Mail::Sender by Email::Sender
Add searchpath for local vacation.conf
7 years ago
Christian Boltz bfaea973bd Merge pull request #59 from lamby/correct-equals-plus-to-plus-equals-typos
Correct some "=+ 1" -> "+= 1" typos in setup.php.
7 years ago
Chris Lamb e318b940ce Correct some "=+ 1" -> "+= 1" typos in setup.py.
This probably wasn't causing a problem as we were setting $error to +1
and we only ever check whether it is non-zero.
7 years ago
tkempf 27e336cd2c Added novacation_pattern regexp to prevent sending vacation messages for
specific recipient addresses
7 years ago
Christian Boltz db4b38ecad Merge pull request #56 from Vilican/patch-1
Updated Czech language
7 years ago
Matyáš Koc 1ea38f9c43 Updated Czech language
Corrected typos and mistakes, translated new strings
7 years ago
Christian Boltz f18f16c004
move $CONF['edit_alias'] next to $CONF['alias_control'] 7 years ago
Christian Boltz 4d9a0717d0 Merge pull request #26 from medarion/master
added config option to disable "edit_alias" function for users
7 years ago
David Goodwin e498a16da6 Merge pull request #55 from dresken/master
Fixed: php 5.4 array shortcut syntax errors on 5.3
7 years ago
Aaron Howell cf72bf1dcc Fixed: php 5.4 array shortcut syntax errors on 5.3 7 years ago
Christian Boltz be3b7412ca
update requirements and links in INSTALL.TXT
- add mariadb and sqlite to requirements
- add link to github
- several small changes
7 years ago
Christian Boltz d4e77e7da6
Update/remove outdated information
- wiki link was outdated, fixed
- remove outdated note about SVN
- some whitespace fixes
7 years ago
David Goodwin 0951629a48 config.inc.php: debian has doveadm in /usr/bin not /usr/sbin 7 years ago
David Goodwin 5036b83ac2 fix debian changelog 7 years ago
Christian Boltz be5fafa9fb
changelog update etc. for 3.1 release 7 years ago
Christian Boltz 7bb688121f
don't display database name and user in setup.php 7 years ago
Christian Boltz c2ce2518e8
setup.php: check for and recommend config.local.php 7 years ago
Christian Boltz e3a701ba24
drop fallback for templates_c, die() instead
Using /tmp/ as fallback is insecure (predictible filenames in a
world-writeable directory enable symlink attacks). Better die() with an
useful error message.
7 years ago
Christian Boltz 0ec24885e6
Non-empty ;-) favicon
We have to ship a favicon (see #44), so we can also include our logo
in it ;-)
7 years ago
Christian Boltz 4eaf0d98b9
Fix broadcast-message queries to work with postgresql
This is a follow-up fix as discussed on
https://github.com/postfixadmin/postfixadmin/pull/50
7 years ago
Christian Boltz 40a11c0186 Merge pull request #50 from danmdm/patch-1
Update broadcast-message.php to send broadcast message to active users only
7 years ago
Christian Boltz a366654757
Better use Config::Lang instead of global $PALANG 7 years ago
David Goodwin 8508b8e119 global PALANG 7 years ago
Dan 3e4ac2ab73 Update broadcast-message.php
Send broadcast message to active users only. 
Without "active=1" condition in WHERE will clause a lot of "Recipient address rejected: User unknown in virtual mailbox table."
7 years ago
Christian Boltz 64f1593818
revert "support unicode domain names - see #47"
Unicode support is a much bigger can of worms (see the discussion in #47),
and having just a little part of unicode support in is a bad idea.

You can of course use the xn--whatever notation for unicode domains ;-)
7 years ago
David Goodwin d2d066d13a empty favicon - see #44 7 years ago
David Goodwin a09a3fa3b0 support unicode domain names - see #47 7 years ago
David Goodwin 3b481082c4 Update README.md 7 years ago
David Goodwin 8bb1c4f459 update squirrelmail plugin 7 years ago
David Goodwin 27b835c161 remove php4 constructor; hide some cNav_bar variables and rename some variables 7 years ago
Martin Oemus 6a6e1c8352 use Config-class, check auth first, fixed redirect 7 years ago
Christian Boltz 7833ac9ab7 Merge pull request #24 from Janfred/broadcast_improvements
Broadcast improvements:
- allow to send to mailboxes only
- allow to send to only some domains
- allow domain admins to send to their domains - new config option $CONF['sendmail_all_admins']
7 years ago
Jan-Frederik Rieckers 54532e7cee
Fix issue with checkbox in broadcast 7 years ago
Jan-Frederik Rieckers 5712a35f71
Fix some Language issues in broadcast 7 years ago
Christian Boltz 8aecf3eae3 Merge branch 'master' into broadcast_improvements 7 years ago
Christian Boltz 88bd9bfd19
drop $db_conn parameter from escape_string()
Connection caching is now done in db_connect() which is a much better
place.

This reverts most of c253ef7dbd
7 years ago
Christian Boltz 6ee85ac6cc Merge pull request #41 from froonix/mysqli-connect
Better static DB connection cache

(+ lots of whitespace fixes)
7 years ago
Christian Boltz 9df6de65af
Finally get rid of variables.inc.php
Initialize $error and $tMailbox where needed.

The other variables in variables.inc.php are already initialized
everywhere.
7 years ago
Christian Boltz 1ec2ec1199
Move initialization of $fDomain to viewlog.php
The other files using this variable (vacation.php and list-virtual.php)
initialize it properly.
7 years ago
Christian Boltz f4f2d1b0f4
Get rid of most variable definitions in variables.inc.php
variables.inc.php is an old hack to save having to declare variables
before using them in pages.

Lots of the variables there are unused (leftovers from the old
create-*.php or edit-*.php scripts) or properly initialized in the file
using them, so there's no need to keep them in variables.inc.php.

The remaining variables in this file should also be dropped after
further investigation.
7 years ago
Tjebbe Westendorp b3b87385e0 Fix for PHP 7+ (#43)
Removed $fDomains as it's not used anymore and produced a PHP 7+ warning
7 years ago
Christian Schrötter 846dcb756c
Remove unnecessary code 7 years ago
Christian Boltz f7f3781770
Fix default for $CONF[create_mailbox_subdirs_hostoptions]
array('') means to include an empty item, and that results in an invalid
remote specification with a trailing "/"

Using an empty array() fixes this.

Reported by oftc_ftw on IRC.
7 years ago
Christian Schrötter e28f3f5959
Fix for mysqli_connect() 7 years ago
Christian Schrötter 2dea9fadd4
Remove whitespace 7 years ago
Christian Boltz 0b82dec825
Fix filename for *.menu.conf.php in gitignore
Looks like svn:ignore was wrong or outdated ;-)
7 years ago
Christian Boltz c5564c2af9 Merge pull request #36 from isleshocky77/git-ignore
Add a .gitignore file which follows the svn:ignore
7 years ago
Stephen Ostrow a3e08dd2f8 Adding a .gitignore file which follows the svn:ignore for now 7 years ago
Christian Boltz 7edbfb045b Merge pull request #33 from acs-ferreira/patch-1
Update French language
7 years ago
Carlos Ferreira 83836a2477 Update fr.lang 7 years ago
Carlos Ferreira 1b9fa66493 Small fix 7 years ago
Carlos Ferreira 061f950661 Update French language 7 years ago
Jan-Frederik Rieckers 797da4f694
Fix typo 7 years ago
Jan-Frederik Rieckers 7ee587bb87
[Broadcast] Use db_in_clause instead of a foreach loop 7 years ago
Christian Boltz 67a6d0e27a
use $CONF[page_size] in viewlog.php
This replaces the hardcoded "LIMIT 10" with "LIMIT <page_size>".

Patch by Dan <dannyro @SF>, https://sourceforge.net/p/postfixadmin/patches/133/

Additional change on top of Dan's patch:
- wrap $CONF['page_size'] in intval() to avoid that a broken config
  setting can break or exploit the query
7 years ago
Christian Boltz 29364b4734
ensure some fields are really latin1
The previous commit changed vacation_notificatoin.notified,
alias_domain.alias_domain and alias_domain.target_domain to latin1, but
did this only in their original upgrade function.

upgrade_1836_mysql() also applies this change to existing databases.
(It's unlikely that these fields are not latin1 - creating them as utf8
or utf8mb4 would break at the index length, but better safe than sorry ;-)
7 years ago
Christian Boltz ba94c3a75e
fix problems with utf8mb4 as default charset
When trying to create a new database with utf8mb4 as default charset,
upgrade.php fails at various places because of too long indexes.

- no longer run upgrade_1_mysql, upgrade_2_mysql and upgrade_3_mysql
  which all affect updates from pre-2.1 database layout
- add {LATIN1} to vacation_notificatoin.notified,
  alias_domain.alias_domain and alias_domain.target_domain

Thanks to martinx who reported this on IRC and helped to debug it.
7 years ago
David Goodwin 7e496094e0 fall back to sys_get_temp_dir() if we cannot write to a templates_c like place 7 years ago
David Goodwin c253ef7dbd allow escape_string() to take a db connection as a parameter; should improve performance when there are a large number of things to escape 7 years ago
David Goodwin 1a7b2df81f fix undefined variable 7 years ago
Martin Oemus 9aba43ee48 added config option to disable "edit_alias" function for users 7 years ago
David Goodwin 71e412f6c2 make error messages red; fix slightly invalid html; remove templates_c check (unnecessary); note we want php5+; add label tags to input elements 7 years ago
David Goodwin 8c2d447421 remove silencing of @include_once - fixes #20 7 years ago
Jan-Frederik Rieckers 2e92eb5cd1
Fix small syntax bug 7 years ago
Christian Boltz 04e54508e5 Merge pull request #19 from rmcaninch/rmcaninch-patch-1
add css id #update-check to footer.tpl

This allows to hide the "check for updates" link using a custom CSS with '#update-check { display:none; }'
7 years ago
Jan-Frederik Rieckers 3c360f646f
Switch config item for broadcast.
The new config item is now `sendmail_all_admins`
7 years ago
Jan-Frederik Rieckers eb871de916
Add new broadcst message language keys 7 years ago
Jan-Frederik Rieckers 3c3d844130
Improve the broadcast message tool
* Make it possible by config option that non global admins can send
  broadcast messages to their domains.
* Allow the sender to select the domains the broadcast message should be
  delivered to
* Allow the sender to decide if the broadcast message should just be
  delivered to mailboxes
7 years ago
Christian Boltz ace8597bb3 3.0.2 again - this time with correct SVN revision
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1895 a1433add-5e2c-0410-b055-b7f2511e0802
7 years ago
Christian Boltz 28703935b3 3.0.2 release
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1894 a1433add-5e2c-0410-b055-b7f2511e0802
7 years ago
David Goodwin 7ddac2ac4b evil hack to make vacation work while we are using Mail::Sender - see also https://sourceforge.net/p/postfixadmin/patches/136/
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1893 a1433add-5e2c-0410-b055-b7f2511e0802
7 years ago
Christian Boltz 0ec8064fe6 changelog update
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1892 a1433add-5e2c-0410-b055-b7f2511e0802
7 years ago
David Goodwin f2a9131938 bump debian/changelog
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1891 a1433add-5e2c-0410-b055-b7f2511e0802
7 years ago
Christian Boltz 80d381f644 Make VacationHandler compatible with MySQL strict mode again
The MySQL database layout includes a 'cache' column for historical
reasons, the PostgreSQL database never did.

r1883 removed the 'cache' column from VacationHandler to unbreak
PostgreSQL, and at the same time broke MySQL in strict mode.

This patch re-adds the 'cache' column only for MySQL to fix this
regression.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1890 a1433add-5e2c-0410-b055-b7f2511e0802
7 years ago
Christian Boltz bf9ec09829 Merge pull request #23 from Janfred/bugfix_aliasdelete
Security fix: don't allow to delete protected aliases (CVE-2017-5930)
7 years ago
Jan-Frederik Rieckers 800f07816a
Fix wrong way of check for can_delete 7 years ago
Jan-Frederik Rieckers 03f4bad49c
Add Language-Key for protected_alias_cant_be_deleted 7 years ago
Jan-Frederik Rieckers 7bb36d0bbc
Fix security hole in AliasHandler
Without this fix it is possible to delete a protected alias via editing
the request parameter of the alias to delete.
7 years ago
David Goodwin e56727fe09 Merge remote-tracking branch 'svnexport/master' 7 years ago
Christian Boltz e3ade3e4b2 Set alias domain-related smarty variables only if alias domains are enabled
This avoids "undefined variable" warnings.

Reported by Kalavera on IRC.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1888 a1433add-5e2c-0410-b055-b7f2511e0802
7 years ago
David Goodwin 061a96fea3 Merge remote-tracking branch 'svnexport/master' 8 years ago
David Goodwin 2bbf6c63d4 see https://sourceforge.net/p/postfixadmin/bugs/376/ - remove any old templates_c/ files
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1887 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin b8051515db check whether we can use templates_c (this seems a better idea than falling back to using something in /tmp)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1886 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin b434f7070a possibly improve debian dependencies
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1885 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 491df198cc Merge remote-tracking branch 'svnexport/master' 8 years ago
David Goodwin 2f2db5949a fix date formatting in non-english languages, thanks to uz@musoftware.de
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1884 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin bd8e0e3ae3 apparently dead columns - thanks to uz@musoftware.de
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1883 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 9ba7118d7b AliasHandler: restrict mailbox subquery to requested domains
set_is_mailbox_extrafrom() restricts the domain list to the domain that
needs to be checked (in normal list-virtual listing one domain), and is
then used to restore the default extrafrom.
This improves the performance for most usecases even for superadmins.

Note: Search mode might still be slow because by default it searches in
all domains available to the admin.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1882 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
rmcaninch 137c9ac9d1 css id update-check added to footer.tpl
Simplify hiding the software update check from display. Not really for security. More for aesthetics; and keeping the more basic users from questioning it. Add #update-check {display: none;} to your custom css. See related feature patch: https://sourceforge.net/p/postfixadmin/patches/134/
8 years ago
Christian Boltz 516f1c68f4 upgrade_1835_mysql: fix defaults for both date fields at once
Doing it in two steps fails, see comment by Gabor 'Morc' KORMOS on
https://sourceforge.net/p/postfixadmin/bugs/5/

Note: This is an exception from the "never change an existing
upgrade_*() function" rule because
a) the result doesn't change for people where it worked and
b) it will continue here anyway for people who had upgrade problems


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1881 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 74130b478c list-virtual.tpl: add missing "download as CSV" for mailboxes
Reported by Dan <dannyro @SF> in
https://sourceforge.net/p/postfixadmin/patches/135/

Note that I'm using a completely different patch to fix it.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1880 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 40b4fdf61c beautify alias list search parameters
AliasHandler:
- initStruct(): handle __mailbox_username as separate field (needed to
  make it searchable)
- split off a condition_ignore_mailboxes() function (used in getList()
  and getPagebrowser()) to add '__mailbox_username IS NULL' to the search
  condition array. Also, make sure $condition can be an array (preferred)
  or a string with a raw query

list-virtual.php:
- hand over a search array instead of a raw query


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1879 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 16e1407621 db_where_clause(): allow NULL and NOTNULL searchmodes
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1878 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz bd28fcb194 AliasHandler: restrict __is_mailbox subquery to allowed domains
This improves performance on setups with lots of mailboxes.
Well, except for superadmins because restricting to "all domains"
doesn't really help ;-)

Thanks to gygy for reporting this on IRC, and for testing the patch.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1877 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 4c2ff84d52 upate wiki links
mediawiki -> SF wiki


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1876 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz bbec3e9f0e pacrypt(): allow switching between dovecot:* password schemes
Dovecot password hashes include a {SCHEME} prefix, so it's possible to
switch the scheme while still accepting passwords hashed using the
previous dovecot:* scheme.

This patch adds the code needed to find out the used hashing scheme
from the hash and ensures it gets used to validate the password.

Patch by Aaron Lindsay <aaron AT aclindsay com> (sent to the ML)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1875 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 17d1cce041 Merge remote-tracking branch 'svnexport/master' 8 years ago
Christian Boltz 62b872491f config.inc.php: add pointers between $CONF[encrypt] = 'authlib' and $CONF[authlib_default_flavor]
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1874 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz c909d4a71e FetchmailHandler: use a valid date as default for 'date'
This fixes an invalid query when using mysql strict mode.

Reported by Martin Kenney, https://sourceforge.net/p/postfixadmin/bugs/380/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1873 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin f77309fd62 try and improve debian dependencies - see https://sourceforge.net/p/postfixadmin/bugs/382/
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1872 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz cade17f777 update CHANGELOG.TXT:
- add section about 3.0.1 Debian packages
- import 2.3.8 CHANGELOG section from 2.3 branch


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1871 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 6e6da819d1 Merge remote-tracking branch 'svnexport/master' 8 years ago
David Goodwin b44459c016 sigh....
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1868 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin fbd4b5ebe9 bump debian/changelog
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1866 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 35ce6a61e6 add configs/ directory to debian packages - is used by smarty
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1865 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 124354aa19 fix missing smarty/ dir - see https://sourceforge.net/p/postfixadmin/discussion/676076/thread/00134b8a
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1864 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin ef6a1ecdbb Merge remote-tracking branch 'svnexport/master'
Postfixadmin v3.0
8 years ago
Christian Boltz 6eda18fcde prepare PostfixAdmin 3.0 release
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1861 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 3a21583f3a Merge remote-tracking branch 'svnexport/master' 8 years ago
Christian Boltz f210a3346c update CHANGELOG.TXT to include changes up to r1859
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1860 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 2a680d22c6 Add Romanian translation
Thanks to Dan <dannyro @SF> for providing this new translation!
https://sourceforge.net/p/postfixadmin/patches/132/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1859 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin b2504c70f7 Merge remote-tracking branch 'svnexport/master' 8 years ago
Christian Boltz 2a6247a6d9 db_connect(): drop unused variable $succes(s)
One of the variable names had a typo [1], and since those variables are
unused, the best way is to drop them.

[1] reported by tfarina, https://github.com/postfixadmin/postfixadmin/issues/15


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1858 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 054d0a4c0e vacation.pl: mime-decode original subject
Reported by czbg, https://sourceforge.net/p/postfixadmin/bugs/366/

Note that the original subject will keep the encoding specified in the
mime header (for example iso-8859-15) while we assume it to be utf8
(see "%mail =...").

Nevertheless, a broken character still looks better than having
=?ISO-8858-1?Q?Gr=DFe?= in the subject ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1857 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 483bb83edc see #377 - looks like the pg+mysql check is partly the wrong way around - mysql only has ints....
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1856 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 3d28caf759 change error message depending on whether templates_c is present or not
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1855 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 1bdf85b728 Merge remote-tracking branch 'svnexport/master' 8 years ago
David Goodwin b6453c8d1e try and improve dependencies; mention sqlite and allow eg mariadb
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1854 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 13cdd50d0a Add checks to login.php and cli to ensure database layout is up to date
- add check_db_version() to functions.inc.php
- add $min_db_version (needs to be updated at least before the release)
- call check_db_version in login.php, users/login.php and CLI - they'll
  error out if the database layout is outdated
- change setup.php to use check_db_version()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1853 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 1fc6f3b03e update patches - they appear to now apply...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1852 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin a3b19ed23e update debian/README.txt to include debian/rules prep step
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1851 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin f780176070 add in prep rule for make so we have a .tar.gz to trick dpkg-buildpackage with...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1850 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin bc5917c0ef drop admin directory; no longer required
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1849 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin cf47c8c5de Merge in Debian's /debian so we also support Apache 2.4 and PHP7 in our debs.... see: http://http.debian.net/debian/pool/main/p/postfixadmin/postfixadmin_2.3.7-2.debian.tar.xz and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821643
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1848 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 386f37dfdb Don't decode b64p (base64-encoded password) fields.
This is not supported in MySQL < 5.6.
Besides that, we don't display the content of b64p fields anywhere, so
the easiest way is not to decode it.

Note: Currently, the only user of b64p is FetchmailHandler.

Fixes https://sourceforge.net/p/postfixadmin/bugs/357/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1847 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 431bd3d810 rename session cookie
With the default PHPSESSID cookie name, there are some rare (and hard to
debug) cases that break logging in if a different application on the
domain also uses a PHPSESSID cookie. See
https://sourceforge.net/p/postfixadmin/bugs/314/ for details.

Using 'postfixadmin_session' as cookie name should fix this.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1846 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 1d76c5af88 VacationHandler: Fill 'cache' field on INSERT
The 'cache' field is a leftover from PostfixAdmin 2.2 and unused (except
if someone still uses an ancient vacation.pl). However, MySQL in strict
mode errors out if isn't included in INSERTs because it doesn't have a
default value.

Fixes https://sourceforge.net/p/postfixadmin/bugs/345/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1845 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 98659f4005 translate several german texts
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1844 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 694d13f6db delete suprefluous whitespace
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1843 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 52a7df2b3a Add CSRF protection for POST requests
Add the CSRF token to all forms, and validate it when those forms are
submitted.

https://sourceforge.net/p/postfixadmin/bugs/372/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1842 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin f843f49f51 Merge remote-tracking branch 'svnexport/master' 8 years ago
David Goodwin 2bed4110a5 update Smarty to 3.1.29
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1841 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 4d77bff96e Merge remote-tracking branch 'svnexport/master' 8 years ago
David Goodwin 54603b0968 reforamt cli commands; update code to php v5 syntax; remove regexp and use filter_var for email validation; use private/protected/public
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1840 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 6bc747ba9b Merge remote-tracking branch 'svnexport/master' 8 years ago
Christian Boltz a00e8a811d functions.inc.php:
- check_domain(): someone had the great idea to allow punicode
  even in TLDs, so we better allow it.
  https://sourceforge.net/p/postfixadmin/feature-requests/93/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1839 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz a0151bd5a1 functions.inc.php:
- pacrypt(): don't stripslashes($pw) because this breaks passwords with
  backslashes. This stripslashes() existed since forever, but probably
  became harmful with all the rewrites in the last years.
  https://sourceforge.net/p/postfixadmin/bugs/349/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1838 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 5dac4295a4 postfixadmin-cli.php:
- whitelist '-1' as valid value instead of misinterpreting it as option
  https://sourceforge.net/p/postfixadmin/bugs/369/
- don't remove quote chars (") from parameter values


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1837 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 8ad849e7b6 default.css:
- set z-index 101 for submenus to ensure quota usage bars don't hide them


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1836 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 336d7a8e28 upgrade.php:
- change default date for 'created' and 'updated' columns from
  0000-00-00 (which causes problems with MySQL strict mode) to
  2000-01-01. This is done with a new {DATETIME} marker to reduce
  code duplication.
- add upgrade_1835_mysql() to apply the same change to existing
  databases

This fixes
  https://sourceforge.net/p/postfixadmin/bugs/5/ and
  https://sourceforge.net/p/postfixadmin/bugs/373/
(which are effectively duplicates)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1835 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 9335232024 functions.inc.php:
- fix db_quota_text() for postgresql (concat() vs. ||)
  https://sourceforge.net/p/postfixadmin/bugs/370/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1834 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz a46720c8c8 config.inc.php:
- add more detailed notes about unsupported dovecot:* encryption types
  (after hunting them down with r00t^2 on IRC)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1833 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 6ba267a5be Merge remote-tracking branch 'svnexport/master' 8 years ago
David Goodwin d3ca74af0d merge github pull request into svn manually - 3e62d3975a - adding configurable smtp helo (CONF["smtp_client"])
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1832 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
David Goodwin 3b0d971d73 merge svn into github; fix conflict in config.inc.php's require_once config.local.php line 8 years ago
Christian Boltz ac43e1ad2a update changelog with changes up to r1830
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1831 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 6ee6574076 include_once(config.local.php) instead of include()ing it
This should avoid problems with endless include loops like in
https://sourceforge.net/p/postfixadmin/bugs/367/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1830 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 530c489ec4 editform.tpl:
- add {if} block for description column to make customization for
  special fields/cases easier


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1829 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Pale Purple Ltd 3e62d3975a Merge pull request #11 from captainark/master
Adding an option to configure the hostname in HELO when sending email from Postfix Admin
8 years ago
CaptainArk 21c4ec0dd8 smtp_client variable empty by default 8 years ago
CaptainArk 7778c0b9c6 Adding an option to configure the hostname in HELO when sending emails from Postfix Admin 8 years ago
David Goodwin 16b3615fcd Merge remote-tracking branch 'svnexport/master' 8 years ago
Christian Boltz a9bb4b83ad cs.lang:
translation update by updated by Jan Laufik (jlaufik @ sf)
https://sourceforge.net/p/postfixadmin/patches/130/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1828 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 2102c1baa8 list.tpl:
- 'itemkey' escaping again. I found another corner case that was broken
  with |escape:"html". Therefore switch to the exact htmlentities() call
  that we use in smarty.inc.php.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1827 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 48dde6468a list.tpl:
- getting the key from $RAW_item.$id_field turned out to be broken in
  corner cases, leading to empty output. The better (and simpler) fix is
  to just let the foreach loop set 'itemkey'.
- the example for special handling of a specific table and field
  contained a superfluous </tr>




git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1826 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz 80e99e1b54 tw.lang language update by Wally LEE <Wally @SF>
https://sourceforge.net/p/postfixadmin/bugs/362/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1825 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Christian Boltz b261db86c7 Merge pull request #9 from phyrog/master
Add sqlite backend option (thank you @phyrog for doing this)

(imported from github)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1824 a1433add-5e2c-0410-b055-b7f2511e0802
8 years ago
Pale Purple Ltd ce53a81683 Merge pull request #9 from phyrog/master
Add sqlite backend option (thank you @phyrog for doing this)
9 years ago
Tom Gehrke 92f1dbdf39 Add sqlite backend option 9 years ago
David Goodwin c817c56bac Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin 4b37a249c7 remove incorrect advice; see bug report:359
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1823 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin 88e1239115 Merge remote-tracking branch 'svnexport/master' 9 years ago
Christian Boltz ba46282f92 use smarty html_options instead of select_options()
list-virtual and viewlog were the last users of select_options()

smarty.inc.php:
- drop (now unused) select_options()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1822 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin b7c6bc1399 Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin 96a89889a2 apparently a typo - thanks marcin-github - see d93c56e34a
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1821 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin d1dad8a31c merge patch from 54a77ecb9c - thanks lisergey - encode message body with wide-chars UTF8
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1820 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin a71d0b2fa1 Merge remote-tracking branch 'svnexport/master' 9 years ago
Christian Boltz 085e7e4bfb list.tpl:
- base edit, editactive and delete links on $RAW_item to avoid double
  escaping ($items is already html-escaped, and we url-escape it for
  links). This fixes the remaining part of
  http://sourceforge.net/p/postfixadmin/bugs/356/
- simplify displaying "html" fields by using $RAW_item. This also fixes
  problems with funny[tm] item names that differ when html-encoded (like
  the ' char)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1812 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 680e96b590 list-virtual_alias_domain:
- also assign RAW_items (from $RAW_tAliasDomains)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1811 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 129a65b8c5 functions.inc.php:
- gen_show_status(): escape mail addresses in query.
  Fixes https://sourceforge.net/p/postfixadmin/bugs/356/
  (mostly - the edit/delete/... links in list-virtual are double-escaped)
  In theory this could allow SQL injection, in practise the mail address
  regex limits this issue to a DOS (creating a mail address with ' caused
  an invalid query that broke list-virtual)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1809 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin 1c9a8575ab Merge remote-tracking branch 'github/master' 9 years ago
David Goodwin bfcbb18a8b Merge remote-tracking branch 'svnexport/master' 9 years ago
Christian Boltz dd652974e0 refresh debian/patches/db_credentials
Also update the changelog once more - let's hope this is really the
beta3 release now ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1801 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 9636fe9de3 3.0 beta3 (= 2.93) release - update $version and changelog
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1799 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Pale Purple Ltd c78c70a314 add link to cboltz's presentation pdf 9 years ago
David Goodwin b3c442c1f8 Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin dbc8204ab1 try and support older versions of PHP (e.g 5.3) which do not support closures etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1798 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin a190ca8f3b Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin 2a0720d93c fix https://sourceforge.net/p/postfixadmin/bugs/320/ - allow mariadb to be used instead of mysql
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1797 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz c9b43879de config.inc.php:
- mention MariaDB as another option for 'mysqli' database type
  https://sourceforge.net/p/postfixadmin/feature-requests/103/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1796 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 73ffaad7e8 upgrade.php:
- change fetchmail.date from DATECURRENT to date
  https://sourceforge.net/p/postfixadmin/bugs/351/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1795 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz faed3a47d3 Changelog update (up to r1793)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1794 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz d401139d24 sv.lang translation update
by Thomas Karlsson, https://sourceforge.net/p/postfixadmin/patches/128/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1793 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin e0caa236e9 Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin 9c022f7e01 merge patch from https://sourceforge.net/p/postfixadmin/bugs/347/ (thank you Eugene Grosbein) - explictly set session_cache_limiter to nocache
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1792 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin cd0df0a287 Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin 15648b7d1c merge in from github - thanks to marcin-github
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1791 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin d5279e487d Merge remote-tracking branch 'github/master' 9 years ago
David Goodwin 0cc235ac3d Merge remote-tracking branch 'svnexport/master' 9 years ago
Pale Purple Ltd 98265365b8 Merge pull request #3 from marcin-github/master
Update of polish translation
9 years ago
Marcin 208f3b7f9f Update of polish translation 9 years ago
Christian Boltz 5307cfe48a functions.inc.php check_domain():
Measure time needed for the nameserver queries, and error_log a warning
if the queries need more than 2 seconds in total.

Inspired by a question from t-ask on IRC, who suffered from a slow
nameserver and had some "fun" to debug it ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1790 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Pale Purple Ltd 3526819b90 Merge pull request #2 from smeinecke/patch-1
Fixed typo in INSTALL.TXT
9 years ago
David Goodwin 0da2bcd463 Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin 1cca7bf54a a2b8705ad4 (git pull request from smeinecke - typo fix
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1789 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Stefan Meinecke a2b8705ad4 Fixed typo in INSTALL.TXT 9 years ago
David Goodwin dee024bfeb Merge remote-tracking branch 'svnexport/master' 9 years ago
Christian Boltz 7a873cc22a setup.php:
- after creating a superadmin, display a note that the setup is done and
  it's possible to login now (idea by t-ask on IRC)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1788 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin ee7514c1ca Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin 7bd492ef1e include only once 9 years ago
Christian Boltz a89bd5f573 config.inc.php:
- remove unused $CONF['users_domain_controle'] 



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1787 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 7f87d130d7 upgrade.php:
- split upgrade_1763() into mysql and pgsql versions because pgsql
  doesn't support SUBSTRING_INDEX
  (reported by darix on IRC)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1786 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz b3750272e4 postfixadmin2.xcf:
- add white background for the mailbox (as separate layer)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1785 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 3640a1b804 postfixadmin-cli.php:
- add fetchmail to module list


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1784 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz c837eac20a DomainHandler:
- initStruct(): in 'aliases_quot' and '_aliases_quot_percent', use
  coalesce(__mailbox_count,0) - without, we always get _0_ aliases if
  a domain doesn't have mailboxes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1783 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz e14bb9038e editactive.php:
- drop unused $values
- some whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1782 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 23bdd02dcb broadcast-message.php, sendmail.php, MailboxHandler, *.lang:
- include mailbox name in pSendmail_result_error and
  pSendmail_result_success



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1781 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 7cf10f81a7 list*.tpl
- display the "Go" button only if javascript is disabled (the dropdowns
  have an onchange event defined, which makes the "Go" button superfluous)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1780 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 993c0ec2b6 list.tpl:
- improve headline:
  - in search mode, display the search term instead of the last selected
    domain (which isn't useful at all when displaying search results)
  - display number of aliases and mailboxes only in domain mode (they
    are useless/wrong in search mode)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1779 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz d2a80adedc list-virtual.tpl:
- update/fix search part of subnav links (all/mailboxes/aliases/alias domains)
  for $search[_]


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1778 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 37bba15625 Use list.tpl to display the alias list
list-virtual.php:
- use list.tpl for aliases
- move show_gen_status handling for aliases to AliasHandler

AliasHandler:
- initStruct():
  - add 'status' column (hidden by default)
  - hide 'created'
  - move 'active' after 'modified' to match old list-virtual.php layout
- initMsg: add list_header
- webformConfig(): if $CONF[show_status], set display_in_list for
  'status' column. Also set a (whitespace) label to make sure it's
  displayed
- db_read_from_db_postprocess(): if 'status' column is requested, call
  gen_show_status() for each row

list-virtual.tpl
- remove alias table header and create alias button (which should have
  been in list-virtual_alias.tpl)

list-virtual_alias.tpl:
- replace code to generate the alias table with {include 'list.tpl'}
  (and some variable assignments)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1777 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz adc038e218 list.tpl:
- add support for list_header (like ":: Alias" in list-virtual)

PFAHandler:
- add empty default for $msg['list_header']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1776 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 35fad174f7 smarty.inc.php:
- assign(): additionally provide the unsanitized values as RAW_$key

PFAHandler.php:
- document 'html' field type (used for raw html), including a big warning

list.tpl:
- add handling to display raw html fields

This is a preparation to use the status markers with list.tpl without
introducing too big changes.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1775 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 3a72203de4 AliasHandler:
- initStruct(): replace (wrong) 'editable' with '_can_edit' and '_can_delete'
- read_from_db_postprocess(): disable _can_edit and _can_delete for
  default aliases if special_alias_control is off and not superadmin

list.tpl:
- use $item._can_edit instead of $check_alias_owner

list-virtual.php:
- drop $check_alias_owner variable and check_alias_owner() call
  (replaced by the code added in AliasHandler)
- drop unused $sql_domain

functions.inc.php:
- delete no longer used check_alias_owner() function



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1774 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 8043515fdf migrate search input field to use search[_], and use list.tpl for alias domains
User-visible changes:
- alias domain list can be downloaded as CSV
- no more search highlighting for alias domains

list-virtual.php:
- expect $search to be an array
- change alias domain handling to use list.php instead of
  list-virtual_alias_domain.tpl, and move some logic from the template
  to list-virtual.php. (The template file is kept as list.tpl wrapper.)
- adopt mailbox and alias search to $search[_]
- adopt pagebrowser to $search[_]

list-virtual_alias_domain.tpl:
- replace custom output generation with {include 'list.php'} and some
  variable assignments

PFAHandler.php:
- add $this->id_field to $this->msg (avoids another smarty template
  variable)

configs/menu.conf:
- change input name to search[_]

list-virtual_alias.tpl, list-virtual_mailbox.tpl:
- adopt to $search[_] by setting $search in a backwards-compatible way

list.tpl:
- add special handling for aliasdomain.target_domain linking



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1773 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz cc598d0f3f PFAHandler:
- build_select_query(): add support for $search['_'] (searching if one
  of the $this->searchfields contains the search text)
- getList(): make sure '_' is kept in the search parameters

functions.inc.php:
- db_where_clause(): slightly relax checks - if $condition is empty,
  only error out if $additional_raw_where is also empty


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1772 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 31006928b4 AliasdomainHandler:
- initStruct(): Adjust columns to match list-virtual.php layout:
  - make 'alias_domain' a link
  - move 'active' after 'modified'
  - don't display 'created'



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1771 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 4ce0a57e83 PFAHandler:
- add protected $searchfields = array(); - list of fields to search by
  default, if just a search term is given. This will be done with
  $search['_'], but that code is not implemented yet.
- add $this->msg['show_simple_search'] (true if $searchfields is non-empty)

list.tpl:
- display search input box and search overview only if $searchfields is
  not empty

AliasdomainHandler:
- add 'alias_domain' and 'target_domain' to $searchfields

MailboxHandler:
- add 'username' to $searchfields

AliasHandler:
- add 'address' and 'goto' to $searchfields

This effectively means that the search input box is no longer displayed
in list.php for admin, domain and fetchmail listings.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1770 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 6e5c8f8054 add 'can_create' flag
PFAHandler:
- add $msg['can_create'] (true by default)

DomainHandler:
- set $msg['can_create'] based on is_superadmin

list.tpl:
- display 'create' button only if $msg['can_create'] is true

Note: This is only an optical improvement, not a permission check.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1769 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 3f451371e3 PFAHandler:
- set(): if errormsg is set for a field, assume it's invalid (even if
  the validator functions did not (or forgot to) return False)

In theory this should never happen, but it's a nice safety net against
programming errors in validator functions that don't have an explicit
    return False;


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1768 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 25356ede71 upgrade_1767: fetchmail.active field was just added. Make sure all
existing fetchmail jobs are active.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1767 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 8bad929a44 fetchmail.pl:
- add active=1/t to SQL query


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1766 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 4322486b21 delete fetchmail.php and templates/fetchmail.tpl
(replaced by FetchmailHandler)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1765 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz a12f7affba menu.conf:
- change fetchmail links to list.php and edit.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1764 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 9ca7ae050e Two upgrades for FetchmailHandler:
- upgrade_1762: add 'domain', 'active',  'created' and 'modified' fields
  to fetchmail table (used by FetchmailHandler)
- upgrade_1763: fill fetchmail.domain based on mailbox



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1763 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 27bdba3ba2 Add FetchmailHandler.php
- uses list.php and edit.php instead of the fetchmail-specific template
- replaces fetchmail.php and its template

config.inc.php:
- add $CONF['fetchmail_struct_hook']



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1762 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 22e2bc7c89 *.lang:
add 'must_be_numeric_bigger_than_null', 'fetchmail_already_exists' and
  'fetchmail_does_not_exist' (as preparation for FetchmailHandler)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1761 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 0bba68e1bc edit.php:
- for not-set bool values, set $values instead of the (wrong) $inp_values


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1760 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 56b3f11d35 edit.php:
Newer PHP versions (noticed with 5.6.6) don't include empty fields in
$_POST, which means changing a field to empty was broken.

Change edit.php to make sure all !isset() fields are set to ''.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1759 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 9f2ae72f08 DomainHandler:
- initStruct(): re-enable total_quota - MailboxHandler needs it


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1758 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 313270c00a PFAHandler.php:
- add getPagebrowser() (returns an array of pagebrowser keys)

AliasHandler.php:
- change getList() to work with empty $condition
- add getPagebrowser() to filter out mailboxes

list-virtual.php:
- replace $alias_pagebrowser_query and the create_page_browser() call
  with $handler->getPagebrowser()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1757 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 28fe7042e8 PFAHandler.php:
- split off build_select_query() from read_from_db() as preparation for
  using build_select_query() to generate the pagebrowser query



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1756 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 46d807c83d DomainHandler.php:
- initStruct():
  - don't display domain_quota if $CONF[quota] == NO or $CONF[domain_quota] is NO
  - drop 'total_quota' column which seems to be unused (and had a non-existing label)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1755 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz dd43f12e9b delete list-admin.php and its template, use list.php instead
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1754 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz add12b9fb4 AdminHandler.php:
- initStruct():
  - link username to domain list
  - hide superadmin, domain list and created columns in list view
  - add label to domain_count to make it visible in list view
- read_from_db_postprocess(): if user is a superadmin, replace domain
  count with "superadmin"



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1753 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 63d9b45dc7 list.php:
- the 'simulate admin' dropdown doesn't make sense for superadmin-only
  modules, therefore don't fill/display it in this case
  (usecase: AdminHandler)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1752 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 64c6e9f0a0 list.tpl:
- fix displaying list and txtl fields


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1751 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz eb7e40cf94 PFAHandler, editform.tpl:
- add support for 'b64p' fields (passwords stored base64-encoded)
  as preparation to migrate fetchmail.php to FetchmailHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1750 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz cc2b157d59 *Handler:
- add $msg['confirm'] (confirmation message when attemping to delete an
  item, displayed by list.php)

*.lang:
- add various confirm_delete_* texts needed by *Handler
- rename confirm_domain to confirm_delete_domain


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1749 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 86dc74fd86 menu.tpl:
- display "view log" menu entry only if logging is enabled
  https://sourceforge.net/p/postfixadmin/patches/127/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1748 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin 59686db0fe Merge remote-tracking branch 'svnexport/master' 9 years ago
Christian Boltz 6e82a41121 delete list-domain.php and its templates
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1747 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz a154c65c47 list-virtual.php:
- replace redirects to list-domain.php with list.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1746 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 1d35ba80ab model/DomainHandler.php:
- initStruct():
  - add optical quota indicators for aliases, mailboxes, domain quota
  - some adjustments to get nice output with list.php (mostly following
    list-domain.php)
- webformConfig(): switch listview to list.php

configs/menu.conf, templates/adminlistadmin.tpl:
- switch list-domain.php to list.php?table=domain



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1745 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 5605561ca8 functions.inc.php:
- better formatting in db_quota_text() and db_quota_percent() results
  (for example, infinity sign instead of / 0 for unlimited)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1744 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 4bc2d5f691 list.tpl, default.css:
- format unlimited/disabled quota similar to x/y, but no border


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1743 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz aea450625f de.lang:
- fix typo


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1742 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 6051729458 list.tpl:
- make "active" a link only if the record is editable


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1741 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin ac59da1cd9 Merge remote-tracking branch 'svnexport/master' 9 years ago
David Goodwin feb2424188 stop relying on subversion keyword for database upgrades; just iterate over all user defined functions and find the largest numeric one
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1740 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
Christian Boltz 39f9d3ac98 cs.lang:
- translation updates by Jan Laufik (jlaufik @ sf)
  http://sourceforge.net/p/postfixadmin/patches/126/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1739 a1433add-5e2c-0410-b055-b7f2511e0802
9 years ago
David Goodwin aae00bc0d4 Merge remote-tracking branch 'svnexport/master' 10 years ago
David Goodwin 75861f40eb debian/control - change to depend on php5-mysql | php5-mysqlnd | php5-pgsql
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1738 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 5706f146d6 MailboxHandler:
- storemore(): store maildir in the correct variable to fix running
  mailbox_postedit script
  Fix by bit-jockey @SF,
  https://sourceforge.net/p/postfixadmin/bugs/342/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1737 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 087dc34b01 MailboxHandler:
- check_quota(): deny creating an unlimited mailbox if domain quota is set
  (reported by idaho7 in IRC)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1736 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 7bf5b74a47 MailboxHandler, AliasHandler:
- initStruct: set "display in list" to 1 to allow searching for domain
  with list.php (nevertheless, the domain won't be displayed because
  it doesn't have a column label set)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1735 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin c3c12de58e Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz 3916ae4104 *.lang:
- add 'edit_not_allowed' (needed by PFAHandler)
- add 'searchparams' (needed by list.tpl)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1734 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz eee25272a6 delete.php:
- allow users (non-admins) to use delete.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1733 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 03b0c869dd list.php:
- add search support:
  - new parameters:
    - search[$field] - value to search for
    - searchmode[$field] - search mode (=, <, > etc.)
    - reset_search - if given, empty $search and $searchmode
  - remember $search and $searchmode via session
  - display errormsg and infomsg from $handler, if any
 
list.tpl:
- display current search parameters and a "[x]" link to remove all
  search parameters

This change doesn't add a search form, but you can use ?search[field]=
and ?searchmode[field]= URL parameters


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1732 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 13f1a28b6e PFAHandler:
- read_from_db(), getList(): 
  - add $searchmode parameter (_before_ $limit and $offset!) to be able to 
    use query different query modes, not only "="
  - add a warning that $condition will be changed to array only in the future
- getList(): filter $condition for fields that are available to the user
  to avoid information leaks by using search parameters
  (filter is only applied if $condition is an array!)

functions.inc.php: 
- db_where_clause():
  - add $additional_raw_where parameter for additional query parameters
  - add $searchmode parameter to be able to use query different
    query modes, not only "=" (see $allowed_operators)
  - check for allowed operators in $searchmode
  - split query into WHERE and HAVING (if a parameter has
    $struct[select] set, HAVING is used)

list-virtual.php:
- adopt getList() call to the new syntax

AliasHandler:
- adopt getList() definition and call to the new syntax

 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1731 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz b76511628d PFAHandler:
- add $this->order_by to allow ordering by any field(s)
  (defaults to $this->id_field)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1730 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 6bfe6706ba PFAHandler:
- add $this->label_field and $this->label (defaults to $this->id_field 
  and $this->id) to allow nicer messages
- use $this->label in various messages



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1729 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz ca76b0fb6e PFAHandler:
- add getMsg() function (needed by list.php)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1728 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz d2490f6153 list.tpl:
- add support for $struct[linkto]



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1727 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 7a23b3cda8 list.tpl:
- add handling for quota fields (visual quota indicator)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1726 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz a826564962 list.php:
- add CSV export

list.tpl:
- add "export as CSV" link

*.lang:
- new text 'download_csv'


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1725 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 50357d276a list.php:
- allow usage for users, not only admins


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1724 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 1e35c579b6 list.php, list.tpl:
- use smarty-style dropdown for admin dropdown instead of select_options()
- only display admin dropdown if more than one admin is available
  (which basically means hiding it for domain admins)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1723 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz b5a6417a6e add list.php and list.tpl - generic files to display lists
(will replace list-admin, list-domain etc.)

list.php:
- generic list view, select *Handler with ?table=

list.tpl:
- display list view
- columns based on $struct (every column with display_in_list and 
  non-empty label will be displayed)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1722 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 1ad0d6832b editform.tpl:
- display cleartext value instead of key for readonly enma fields


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1721 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 3d58d1f092 editform.tpl:
- add handling for 'enma' fields (see PFAHandler r1711)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1720 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 786a7d665e functions.inc.php:
- pacol():
  - add $linkto parameter (if list mode should link to something)
  - replace $not_in_db with $multiopt - the remaining parameters can
    now be specified as associated array (backwards-compatible)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1719 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz a4085d287f DomainHandler:
- initStruct: 
  - set column write permissions depending on superadmin status
  - add _can_edit and _can_delete (also depending on superadmin status)
- webformConfig(): reduce required permissions to 'admin'
- add beforestore() - aborts writing for non-superadmins
- delete: allow deletion only for superadmins

*.lang:
- new text 'no_delete_permissions'



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1718 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 1edc38a798 edit.php:
- add user (non-admin) mode


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1717 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz e39d13aa52 PFAHandler:
Add $can_edit and $can_delete flags. This makes it possible to make 
some, but not all items non-editable or non-deletable (based on a 
database column/query or read_from_db_postprocess())

- add $can_edit and $can_delete
- after initStruct, check if $struct contains _can_edit and _can_delete.
  If not, fill with default values (allowed)
- init(): set $this->can_edit and $this->can_delete (only in view/edit mode)
- set(): abort if !$this->can_edit



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1716 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 3fe75c117d PFAHandler:
- add handling of users (non-admins), including permission checks



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1715 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 72d9d42601 PFAHandler:
- add protected $is_superadmin = 1;
  will be set to 0 if $admin_username is set and is not a superadmin



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1714 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz f07281cdc1 PFAHandler:
- automatically skip quot, vnum and vtxt fields in store()
  (as if dont_write_to_db == 1)
- document new field types vtxt and quot and mark field types that will
  never be stored in db



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1713 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 9093a946b4 functions.inc.php:
- add functions db_quota_text() and db_quota_percent() to generate
  queries for used quota ("x/y" and percentage)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1712 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 647aa39218 PFAHandler:
- add validation for "enma" field type - list of options, must be given
  in column "options" as associative array (value => displayed value)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1711 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz d9e30fb41b Add CliScheme.php:
- displays the database scheme (for usage in upgrade.php)

PFAHandler:
- add "Scheme" to the list of available tasks

postfixadmin-cli.php:
- add "scheme" to help

This is the first patch of a series sponsored by 
    Bund der Deutschen Landjugend (german rural youth)
	http://bdl.landjugend.info/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1710 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 22839d3695 Cli*.php:
- add SVN $Id header


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1709 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz e8b0198512 2.92 (aka 3.0 beta2) release
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1706 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin e4230a808a Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz 49be08c9fe update Smarty to 3.1.21
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1704 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 62b575d645 Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz 6ec360b0b7 AliasHandler:
- finally fix alias deletion when using MariaDB. The workaround is
  to add another field from the subquery to the outer SELECT so that
  MariaDB can't optimize the subquery to "always 1"
  http://sourceforge.net/p/postfixadmin/bugs/325/
  (I'll open a MariaDB bugreport and add the link to the bugtracker)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1703 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 46a632ec02 AliasHandler:
- initStruct(): revert the MariaDB workaround because PostfixAdmin now
  "thinks" none of the aliases belong to a mailbox (and displays all of
  them in the alias list, even the mailbox aliases)
  - reverts r1699 + the CHANGELOG entry (part of r1700)
  - reopened https://sourceforge.net/p/postfixadmin/bugs/325/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1702 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 0ca4c62d6d CHANGELOG.TXT:
- update for r1690..1700


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1701 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz d9ff7ece05 AliasHandler:
- initStruct(): use "SELECT COUNT(1)" instead of "SELECT 1" as workaround
  for a MariaDB problem (bug?)
  https://sourceforge.net/p/postfixadmin/bugs/325/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1700 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 584a85216d INSTALL.TXT, ADDITIONS/squirrelmail-plugin/INSTALL
- add required version of Zend Framework (1.12.x) and a warning that 2.x
  won't work (reported by seboulba on IRC)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1699 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin efa607cf1f Merge remote-tracking branch 'svnexport/master' 10 years ago
David Goodwin f436a0d17c fix typo in model/CliHelp.php as per ticket 332
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1698 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin d8795f9b77 Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz 4d0ebd7e1b vacation.php:
- check that $tActiveUntil >= today and $tActiveUntil >= $tActiveFrom
- update header comments
- display "vacation is active" notice also to admins
(based on a patch by J.Kruis @SF,
https://sourceforge.net/p/postfixadmin/patches/122/ )

*.lang:
- add 
  - pVacation_until_before_today
  - pVacation_until_before_from
  - reply_once_per_day
- change pUsersVacation_welcome_text to 'Auto response for %s is active!'
- remove "obsolete" marker from pUsersVacation_activefrom and
  pUsersVacation_activeuntil, they are still used

nl.lang:
- translation update by J.Kruis @SF
  https://sourceforge.net/p/postfixadmin/patches/122/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1697 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Pale Purple Ltd 11bdb2068f Update README.md
Make irc channel more obvious if irc:// doesn't work for the browser.
10 years ago
David Goodwin 6ade796829 Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz 06c1125e19 broadcast-message.php:
- remove raw HTML ("<br />") from flash_info()/flash_error() calls


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1695 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz fb4af233af config.inc.php:
- add note that $CONF[vacation_domain] can't be used for "normal" mails

model/DomainHandler.php:
- validate_new_id(): 
  - error out when trying to add $CONF[vacation_domain]
  - some whitespace fixes
- remove superfluous comment on initStruct()

*.lang:
- add 'domain_conflict_vacation_domain' error message



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1694 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz b30292c420 MailboxHandler.php:
- storemore(): 
  - fix undefined variable if creating subfolders fails (bug#328)
  - remove some outdated TODO notes
- create_mailbox_subfolders(): add $this->id to error_log


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1693 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 76b4e498a2 VIRTUAL_VACATION/INSTALL.TXT:
- change instructions to use /usr/lib/postfixadmin to avoid vacation.pl
  has write access to itsself
- replace instructions for /var/spool/vacation/ with instructions for a
  log file or directory
- various other changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1692 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 2e6f20a473 *.lang:
- add pViewlog_action_delete_admin (needed to avoid an error when 
  deleting an admin)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1691 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz d80816ad86 DomainHandler:
- $CONF[default_aliases] can now use the new domain as alias target
  http://sourceforge.net/p/postfixadmin/patches/124/

config.inc.php:
- update comment for $CONF[default_aliases]



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1690 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 986cc30224 Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz 5b1ab56dac small clarification in changelog entry about vacation.pl sql
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1689 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz e826a01663 changelog update
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1688 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz bf620f5b5f fetchmail.php:
- change error_reporting() to exclude E_NOTICE.
  This is a workaround for
  https://sourceforge.net/p/postfixadmin/bugs/322/
  until fetchmail.php is converted to FetchmailHandler



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1687 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz a26e25a03a language-update.sh:
- add a hint about --forcepatch to --patch help
- some whitespace fixes in help


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1686 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 6595a0a501 upgrade.php:
- upgrade_1685_mysql()/upgrade_1685_pgsql:
  Fix existing log entries broken by 
  https://sourceforge.net/p/postfixadmin/bugs/317/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1685 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz c5de88390e PFAHandler.php:
fix logging - log the domain instead of $this->id
- add protected $domain (used for logging)
- add function domain_from_id()
- http://sourceforge.net/p/postfixadmin/bugs/317/

AliasHandler.php:
- add function domain_from_id()

MailboxHandler.php:
- add function domain_from_id()
- init(): use $this->domain instead of splitting $this-id again



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1684 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 3f62a577a4 CliHelp:
- remove help text about "password" command (not implemented)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1683 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin a98a582bc7 Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz 1a22118453 POSTFIX_CONF.txt:
- add note that active=1 needs to be changed to active='t' when using 
  PostgreSQL
  https://sourceforge.net/p/postfixadmin/discussion/676076/thread/016fe62e/
- move around note about concat() vs. PostgreSQL


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1682 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 297b029bf2 Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz 7055209d8a fetchmail.pl:
- fix ssl extra options (cert check, cert path, fingerprint)
  Patch by Silvan Calarco <mambasoft @SF>


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1681 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz a933aa1cd8 INSTALL.TXT:
- change tar command to postfixadmin-$version.tar.gz (instead of 2.2)
- recommend usage of config.local.php (including a basic example how it looks)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1680 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 0f55fb4351 fr.lang:
- translation update by Francois Grange (rumbaya @SF)
  https://sourceforge.net/p/postfixadmin/patches/123/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1679 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 8e5a4551cb AliasHandler:
- fix query in getList(), which caused an empty list on some systems
  https://sourceforge.net/p/postfixadmin/bugs/313/
  Fix by VERSATECH SRL, versatechsrl @SF


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1678 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin d89475c39e Merge remote-tracking branch 'svnexport/master' 10 years ago
Christian Boltz a22fe1c4be edit.php:
- check for $new instead of $edit == '' / != '' to make the code
  easier to understand


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1677 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz c2d6034cc0 vacation.pl:
- fix two queries for postgresql
  Patch by Christoph Kuchenbuch,
  https://sourceforge.net/p/postfixadmin/bugs/315/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1676 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 566f2845bd AliasHandler:
- setmore(): use old goto values if no new value is given. Fixes
  'Making alias inactive cleans "goto" field'
  https://sourceforge.net/p/postfixadmin/bugs/316/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1675 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz e670bcd5b8 list-virtual_mailbox.tpl:
- fix: display quota if $CONF[used_quotas] == NO
  https://sourceforge.net/p/postfixadmin/bugs/307/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1674 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz d3964f600e functions.inc.php
- db_get_boolean: error_log invalid values


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1672 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Pale Purple Ltd 70c98cfb7f add note about github/svn etc. 10 years ago
Pale Purple Ltd f8ea5a32b0 first version 10 years ago
Christian Boltz 0b116c1605 version 2.91 aka 3.0 beta1
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1670 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 7f07e7e59a fix to work with debian/trunk etc (mysql->mysqli)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1669 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin cc2d9bdd04 beta release
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1668 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 1c011806c1 this might fix the permissions on templates_c
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1667 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 4b4461c48a update - remove admin reference
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1666 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 1d520423a9 login.php, users/login.php:
- trim() $fUsername - MySQL thinks "foo" == "foo  " (and therefore allows
  login as "foo@example.com " - but later we'll get funny "undefined index"
  problems in PFAHander->view()) when an admin wants to change the password


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1665 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 3b19dfeff6 default.css:
- fix path to quota background image


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1664 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz a8b79b4548 MailboxHandler:
- validate_new_id(): make sure mailbox creation still works if the 
  alias limit for the domain is hit


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1663 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 619a419611 users/password.php:
- include the username in messages containing %s


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1662 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz bbd7c3af77 CliEdit.php:
- execute(): call __handle_params() also if empty args[0] is given
- __interactive(): only ask for id if $id_field is editable

This fixes two issues with a non-editable auto_increment id field


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1661 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz da14ddf6d7 postfixadmin-cli.php:
- __parse_params(): only check for first character if $params[$i]
  is not empty (avoids PHP warning)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1660 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 2289096ccc Config.php:
- do not error_log() 'undefined config option' for deprecated options



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1659 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 8e04104b20 functions.inc.php:
- db_log():
  - replace $action_list with $LANG["pViewlog_action_$action"]
  - drop unused $table_log variable


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1658 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz f1c6566667 finally delete admin/ (redirect to /login.php)
We dropped admin/ in 2007 - if someone still didn't notice it, well, 
then I'm looking forward for a bugreport I can close as invalid ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1657 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 9913a446fc header.tpl:
- add page-{$smarty_template} and page-{$smarty_template}-{$table} 
  classes to allow more targeted CSS styling


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1656 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 5fcade96d5 MailboxHandler:
- read_from_db_postprocess(): avoid warning if quota is disabled in $struct


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1655 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 5abc5d2b38 CHANGELOG.TXT:
- include 2.3.7 changelog
- update with major changes since r1617


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1653 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 2858fdb61e remove empty entries from the array before sending to the remote server; ensure $tMessage is defined
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1649 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 547996c8c2 improve installation instructions
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1648 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin 261e17ec97 check for Zend Framework, explode if it is not obviously found
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1647 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin c6a25c828d fix exception logging; fix filter_var usage
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1646 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin ff1f9d2142 fix include path
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1645 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin e91ddf50a6 add node about XMLRPC stuff
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1644 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin add9e5b7af fix xmlrpc function call (non-static method being called statically); fix method docblock which is read by Zend_XmlRpc_Server etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1643 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin eb2ccbc2e5 typo fix
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1642 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin e5417c2371 remove explicit reliance on plugin name being postfixadmin
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1641 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin b7ce498cc7 add missing { }
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1640 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
David Goodwin b3074644ff alias can contain a ' - as in email.o'connor - need to therefore escape this...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1639 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz e7fe6e16ef functions.inc.php:
- check_domains(): raise TLD limit to 13 chars - even if I seriously
  doubt someone wants to use such a long TLD ;-)
  ( https://sourceforge.net/p/postfixadmin/bugs/310/ again)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1637 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz 9bcc57cd88 functions.inc.php
- check_domain(): update regex for new, longer TLDs like .photography
  https://sourceforge.net/p/postfixadmin/bugs/310/
 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1635 a1433add-5e2c-0410-b055-b7f2511e0802
10 years ago
Christian Boltz c2752782a2 header.tpl:
- remove isset() - this re-introduces the risk to produce an "undefined"
  notice if someone uses an outdated config.inc.php, but also avoids 
  <link ... href=""> (notice the empty href) if $CONF[theme_custom_css]
  is set, but empty


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1634 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ad64560a43 edit.php:
- if the id_field is not displayed in form and not editable,
  it's probably an auto_increment. Set it to '' in this case.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1633 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f14d7d09a5 upgrade.php:
- change {BOOLEAN} to include "default false"
- revert the r1626 changes in upgrade_1283
  (BTW: "by default, every admin is a superadmin" is not a good idea ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1632 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 4bbc223804 edit.php:
- if values[$key] is not set, use the field's default value for smarty->assign
  (also avoids an "undefined" warning with read-only fields)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1631 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz bf170f043b edit.php:
- add error message if $handler->init() fails without error message
  (indicates a bug in $handler->init())


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1630 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 0cf9d7e53c templates/editform.tpl:
- change all field names to "value[$key]" instead of just "$key"
  to keep the main "namespace" clean

edit.php:
- adjust POST handling code to changed form field names ("value[$key]")



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1629 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
David Goodwin 5db370fdb3 add sasl auth listener config, a few more comments etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1628 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
David Goodwin a0d07df3db typo fix
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1627 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
David Goodwin fa984a5b5f upgrade.php : fix postgres complaining about addition of boolean not null field when existing data exists and no default is specified
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1626 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
David Goodwin c7bceb77cb smarty.inc.php : use !empty to avoid php moaning
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1625 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
David Goodwin c2cfd6fe04 templates/header.tpl : check for existance of thing before trying to use it
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1624 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
David Goodwin e39510726a use !empty to avoid error
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1623 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz a0cf264976 update smarty from 3.1.5 to 3.1.16
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1621 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 4a653e0da6 footer.tpl:
- do not escape $CONF.footer_text - it is already escaped


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1620 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
David Goodwin 7f40cc071c DOVECOT.txt: update configuration for dovecot for version 1.2.x (Debian Wheezy)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1619 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 7236333587 default.css:
- apply the same font family and size to input, textarea and select
  https://sourceforge.net/p/postfixadmin/bugs/40/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1618 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 861dfc084d setup.php:
- recommend PHP >= 5.2.3
- beautify some mysql/pgsql messages

CHANGELOG.TXT
- add vacation.pl "$SUBJECT"
- remove TODO for setup.php
- add "Changes since 2.3.6 release" (from 2.3 branch)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1617 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 657617d637 vacation.pl:
- disable TLS by default due to a bug in Mail::Sender 0.8.22
  (https://rt.cpan.org/Public/Bug/Display.html?id=85438)
  Actually, due to a bug in Mail::Sender 0.8.21, it was never enabled ;-)
- add new config option $smtp_tls_allowed to allow enabling TLS


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1615 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2e3998c14c vacation.pl:
- Add capability to include the subject of the original mail in the 
  subject of the vacation message.
  A good vacation subject could be: 'Re: $SUBJECT'
- corrected log entry about "Already informed ..." to show the 
  $orig_from, not $email

Patch by Christoph Lechleitner <christoph.lechleitner@iteg.at>
http://sourceforge.net/p/postfixadmin/patches/117/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1614 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c4e723b355 config.inc.php:
- remove unused config options:
  - $CONF['vacation_replytype_control']
  - $CONF['vacation_allow_user_reply'];
  - $CONF['vacation_autoreplydelay_default']
  - $CONF['vacation_intervaldelay_default']

CHANGELOG.TXT
- update with vacation changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1613 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 23ec3da059 vacation.pl:
- whitespace fixes
- update vim: line to 4 spaces tab (which seems to be used everywhere already)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1612 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ba4ccfdcf9 setup.php:
- add hint about SELinux and AppArmor if templates_c is not writeable
  https://sourceforge.net/p/postfixadmin/feature-requests/112/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1611 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 8c139c95d6 vacation:
restrict reply type to a list of options ($CONF[vacation_choice_of_reply]),
remove input field for custom interval


config.inc.php:
- change $CONF['vacation_choice_of_reply'] to [seconds] => [$PALANG label]
  (note: reply to every mail is commented by default because it can be
  annoying. Admins will have to explicitely add/enable it in their config.)
- remove $CONF[vacation_replytype_default]
- update comment about dovecot:* for $CONF[encrypt]

*.lang:
- add texts for reply types

VacationHandler.php:
- remove reply_type at various places
- set_away(): remove reply_type from list of function parameters

templates/vacation.tpl:
- update reply type dropdown for the changed $CONF['vacation_choice_of_reply']
- remove the input fields for custom reply delay

vacation.php:
- restrict reply type to a list of options ($CONF[vacation_choice_of_reply])
- if vacation is disabled, but old values are stored in the database,
  change the activeFrom and activeUntil date to today to avoid users
  have to scroll through the calendar a lot

xmlrpc.php:
- update set_away() call to match the removed parameter

upgrade.php:
- comment out upgrade_1345_mysql() which created the reply_type and 
  interval_time fields in the vacation table in mysql
- add upgrade_1610() to add the vacation.interval_time field


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1610 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
David Goodwin 99f871d45d spelling fixes; make $friendly_name a configuration option (From: Nice Name <someone@domain.com> control)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1609 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 31467479b5 CHANGELOG.TXT:
- whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1608 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz fbfd7beb1d CHANGELOG.TXT:
- big update with all changes since 2.3.x (about 300 lines!)
- starts with a TL;DR summary ;-)
- still includes some details that need to be checked or finetuned
  (search for "***")


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1607 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 77c0fbcb22 upgrade.php:
- upgrade_729 - add comment about r1605 changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1606 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 975956b73e upgrade.php:
- change {BIGINT} to include "NOT NULL DEFAULT 0"
- add {INT} (not used anywhere yet)
- upgrade_729:
  - quota2 table: change "{BIGINT} NOT NULL DEFAULT 0" to "{BIGINT}" to 
    match the above change
  - note: quota table created with old versions of upgrade.php will not 
    have explicit "NOT NULL DEFAULT 0" for the "current" field 
    (shouldn't hurt)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1605 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 8d99a8a9fb DomainHandler:
- initStruct(): set valid bool default for backupmx


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1604 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 635eed201f xmlrpc.php:
- setAway(): remove superfluous $reply_type
  (https://sourceforge.net/p/postfixadmin/patches/113/)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1603 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz cf8ccc167f xmlrpc.php:
- setAway(): add (optional) new parameters for reply_type, 
  interval_time, activeFrom and activeUntil
- change $_SESSION['username'] to $_SESSION['sessid']['username']
  (that's what postfixadmin expects)

Based on a patch from Norm Brandinger,
https://sourceforge.net/p/postfixadmin/patches/113/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1602 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 252ae047d5 various files:
- get rid of global $table_* variables, use table_by_key() instead



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1601 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 9f062cf181 login.php, users/login.php
- error_log() failed login attemps
  https://sourceforge.net/p/postfixadmin/feature-requests/111/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1600 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz a9e0638d82 postfixadmin-cli.php:
- update help()
- comment out commands() - it's outdated and now unused


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1599 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz e2658394a1 vacation.pl:
- encode subject
  https://sourceforge.net/p/postfixadmin/bugs/272/
  https://sourceforge.net/p/postfixadmin/patches/119/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1597 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz beffb3ec85 r1595 accidently included more changed files than it should.
This commit contains some dummy changes to get a proper changelog
attached to those files.

VacationHandler:
- (r1595) rewrite based on PFAHandler (not useable yet)
- (this commit) add a dummy init() function that calls die()

DOCUMENTS/DOVECOT.txt:
- (r1595) TODO note
- (this commit) remove the TODO note again

CHANGELOG.TXT:
- (r1595) include changes of 2.3.4, 2.3.5 and 2.3.6 (copied from 2.3 branch)
- (r1595) update some notes about SVN version (still far from complete)	


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1596 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 57f4ad0b75 functions.inc.php pacrypt():
- for 'system' encryption, use full hashed password as salt 
  https://sourceforge.net/p/postfixadmin/bugs/2/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1595 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz bafd2f1f58 edit.php:
- use prefill values from $_SESSION (if not provided in GET/POST)
- remember prefill values for next usage of the form

list-virtual.php
- set prefill values for edit.php

PFAHandler.php:
- let prefill() store the value in $struct if no prefill_$field()
  function exists

This fixes the remaining parts of
http://sourceforge.net/p/postfixadmin/bugs/298/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1594 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1a35cccf5e list-virtual.php:
- remember domain and page browser offset in $_SESSION
  (fixes 50% of http://sourceforge.net/p/postfixadmin/bugs/298/ )
- various cleanups

functions.inc.php:
- add safesession() (like safeget(), but for $_SESSION)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1593 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c349420210 functions.inc.php
- db_query(): do not print out the failed query, error_log() it instead
  to avoid information leaks.
- update SF forum URL


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1592 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 7bffdc9907 upgrade.php:
- convert TODO to a note


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1591 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 75c2c9cea5 config.inc.php:
- add missing $CONF[*_struct_hook] options
- add empty defails for various $CONF[*_post*_script]



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1590 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b947495b09 (follow-up for r1588)
languages/*.lang:
- add texts for DomainHandler
- delete empty pAdminCreate_domain_defaultaliases_text



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1589 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1688065fca DomainHandler.php:
- better error/info messages
- remove superfluous (and never displayed) success message in storemore()

languages/*.lang:
- add texts for DomainHandler
- delete empty pAdminCreate_domain_defaultaliases_text



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1588 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 801acc6cf2 AliasHandler:
- only allow @domain as target if $this->id is a catchall
- delete commented out version of delete()
- better error messages

languages/*.lang
- add new texts needed for AliasHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1587 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 4e489df526 AliasdomainHandler:
- better error messages

languages/*.lang
- rename pCreate_alias_domain_error3 to alias_domain_create_failed
- add new texts needed for AliasdomainHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1586 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c11932e58c MailboxHandler:
- use better/translateable messages at various places

languages/*.lang
- add texts needed by MailboxHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1585 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 53c28990ad PFAHandler:
- read_from_db(): convert $limit and $offset with (int) to make sure
  they contain a sane value


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1584 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 79274dcedf AdminHandler:
- clear some TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1583 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 20d1ffcafc functions.inc.php:
- new function db_pgsql() to replace lots of
  "if ($CONF[database_type] == 'pgsql')) checks
- delete unused function boolconf()

several files:
- use db_pgsql() instead of checking $CONF[database_type]



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1582 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b11ee57e0e de.lang:
- better translation for "edit" in various texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1581 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 60297e483c *.lang:
- rename pAdminCreate_admin_username_text to email_address
- rename pAdminEdit_admin_super_admin to super_admin

AdminHandler.php - initStruct(): 
- adopt to the renamed $PALANG texts
- remove some TODOs
- whitespace changes

setup.php, adminlistadmin.tpl:
- adopt to the renamed $PALANG texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1580 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2bf5df92ea functions.inc.php, DomainHandler, MailboxHandler:
- move mailbox_postdeletion() to MailboxHandler
- move domain_postcreation() and domain_postdeletion() to
  DomainHandler
- adopt those functions for usage inside the *Handler (replace
  print with $this->errormsg etc.)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1579 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 9decae80e9 some CLI cleanup
postfixadmin-cli.php:
- better error message for unknown modules or tasks
- remove unused variables
- __bootstrap(): require_once() common.php is enough
  (and inflector.php no longer exists)

shells/shell.php:
- remove unused variables
- no longer print the path in _welcome()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1578 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 72f0818391 scripts/postfixadmin-cli.php
- replace usage of Inflector::camelize() with ucfirst() - for our usage,
  it gives the same result with easier understandable code
- remove unused PHP5 define

shells/shell.php:
- remove definition of unused variable $shellKey, which also removes
  the last usage of Inflector::underscore
- remove code that was commented out since a while

scripts/inflector.php:
- delete file, no longer needed


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1577 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 84b160bd8e scripts/postfixadmin-cli.php:
- add myself to copyright header
- whitespace changes in dispatch()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1576 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c65e3293b6 Quite big CLI cleanup (and more)
model/CliHelp.php:
- new class, used for "postfixadmin-cli $module help"
- replaces the PostfixAdmin* classes in scripts/shells/*.php

model/PFAHandler.php
- add public $taskNames with the list of supported CLI commands

scripts/postfixadmin-cli.php - dispatch():
- directly set the classes to load instead of using shell->loadTasks()
- when "postfixadmin-cli $module" is called, display help instead of 
  error message about "invalid command ''"
- make it more readable by moving error checks to the beginning
  (replaces deeply nested if's with return statements)
- remove unused code parts

scripts/shells/*.php:
- remove PostfixAdmin* classes (obsoleted by CliHelp)
- remove $tasks (now in PFAHandler)
- delete alias.php and domain.php because nothing is left
- mailbox.php still contains PasswordTask

scripts/shells/shell.php:
- remove $taskNames (moved to PFAHandler)
- remove loadTasks() (integrated in postfixadmin-cli.php's dispatch())



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1575 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b3dc3f91ae AliasHandler:
- if parent::init() fails, return false early to avoid warnings about
  undefined $this->result


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1574 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 39001c3ba4 DomainHandler.php:
- add some _formatted_*() functions to get a more informative output
  (currently only used in CLI)

MailboxHandler.php:
- add TODO for reading used quota from quota/quota2 table and adding
  a formatted_quota() function



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1573 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 04cd5c5aa4 model/CliView.php:
- new file for CLI 'view'
- based on the ViewTask classes in scripts/shells/*.php
- introduces usage of *Handler->_formatted_$field() to get "pretty" 
  output for a field 
  (not sure if this is the final solution, but it works ;-)

scripts/shells/*.php
- remove ViewTask, obsoleted by model/CliView.php
 
scripts/shells/shell.php:
- use CliView instead of ViewTask



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1572 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f1831975c0 CliDelete:
- execute() and help() must be public


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1571 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 0a71a236c2 model/CliDelete.php
- new file, handles deleting something with the CLI
  (based on DeleteTask in scripts/shells/*.php)

scripts/shells/*.php
- remove DeleteTask, obsoleted by model/CliDelete.php

scripts/shells/shell.php:
- use CliDelete instead of DeleteTask



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1570 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b871b47709 As a side effect of the previous commit (r1568), we can use login.php
for logout.

This means:
- change logout URL to login.php in menu.conf and users_main.tpl
- delete logout.php and users/logout.php



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1569 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz fbc18ff993 login.php, common.php:
- when login.php is requested, logout the current admin/user
  https://sourceforge.net/p/postfixadmin/bugs/284/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1568 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 288ba0e143 DomainHandler.php
- delete(): check if the domain is an alias domain target - if yes, do 
  not allow to delete it
- better error message if domain_postdeletion() fails

*.lang:
- rename pAdminDelete_domain_error to domain_postdel_failed and change 
  the text
- add delete_domain_aliasdomain_target



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1567 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz e079e85461 editactive.php:
- new, small script to change the 'active' status
- also include CSRF protection token

edit.php:
- remove handling of 'active' to make it more readable

*list*.tpl:
- change links to use editactive.php, add CSRF token

configs/menu.conf
- add url_editactive


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1566 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 508d05e1ed AdminHandler.php, AdminpasswordHandler.php:
- initMsg(): better texts for error_already_exists and error_does_not_exist 

*.lang:
- rename pAdminCreate_admin_username_text_error2 to admin_already_exists
  and change the text
- add admin_does_not_exist



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1565 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1a79b2798e delete.php:
- require token for CSRF protection, see
  https://sourceforge.net/p/postfixadmin/bugs/269/

login.php, users/login.php:
- create token and store it in $_SESSION

templates/*:
- add token to all delete.php links

templates/list-virtual_alias_domain.tpl:
- change delete confirmation dialog to contain "from->target"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1564 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 4847173755 delete.php:
- use *Handler for deletion
  (which also means delete.php only has 17 lines of code now - 130 lines 
  less than before :-)

templates/list-virtual_*.tpl:
- remove now superfluous "domain" parameter in delete.php link


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1563 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 3b09562fb8 MailboxHandler.php:
- rewrite and simplify delete()
- also cleanup fetchmail, quota	and quota2 tables

AliasHandler.php:
- update delete() to match the workflow in other classes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1562 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz bcb38c9664 AliasdomainHandler:
- implement delete()
- rename _field_target_domain() to _validate_target_domain()
  (follow-up for r1555)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1561 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2f26624ceb DomainHandler.php, AdminHandler.php:
- implement delete()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1560 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 5871516b47 model/Config:
- read_f(): fix error logging - $var can be an array


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1559 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 6e2e132bac remove "postfixadmin.com" in comments in lots of files
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1558 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 3c59557a6f list-virtual.php:
- make "unknown" translateable

*.lang:
- add "unknown"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1557 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 49573da2d7 PFAHandler:
- make error messages in _inp_*() translateable
- make date format in SQL "translateable"

*.lang:
- add the texts needed for the changes listed above


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1556 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1b74926afb PFAHandler, *Handler:
- rename _field_$field() to _validate_$field() to make the function name
  more obvious
 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1555 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz d900835997 functions.inc.php:
- pacrypt(): fix dovecot:* to work with "old" passwords that don't have 
  the {method} prefix


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1554 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 8df6e37dcf setup.php:
- fix displaying the success message for creating a new admin


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1553 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2dc71b6c9f templates/index.tpl:
- replace {php} usage (which is no longer allowed since switching
  from SmartyBC to Smarty) with $smarty.server

fixes https://sourceforge.net/p/postfixadmin/bugs/303/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1552 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 949d58e5c4 config.inc.php:
- remove unused $CONF['usercontol'] which leaked in with an unrelated 
  patch in r1374
- fixed some typos in comments


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1551 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 462cb6992f AdminpasswordHandler:
- initStruct(): remove description for current password - it doesn't
  exist in $PALANG and we don't really need a description here


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1550 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f748f31137 model/Config.php:
- Config::read(): error_log() attemps to read undefined config options


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1549 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c6ca4f9bae common.php:
- call Config::write() earlier, because check_language() uses it
- later add $PALANG with Config::write(__LANG)

Thanks to <controlcde> for reporting the results of this bug on IRC
(even if I had to hunt it down to find the reason ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1548 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b137e774f6 functions.inc.php:
- check_language(): remove things like ";q=0.8" before checking if 
  a language exists


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1547 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 4785426269 scripts/inflector.php:
- remove unused function variable()

scripts/postfixadmin-cli.php, scripts/shells/shell.php:
- replace user-visible "cake" with "postfixadmin-cli"

scripts/shells/mailbox.php:
- fix/update help text



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1546 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 4fb4ee264a delete some outdated and no longer needed files in snippets/ :
- snippets/baseclass.php
- snippets/fetchmail-class.php
- snippets/fetchmail-remaining.php
- snippets/model.php
- snippets/user_controller.php
- snippets/user_model.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1545 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ee90f4a74e smarty.inc.php:
- move header() calls from index.tpl to smarty.inc.php, which means 
  we no longer need to use SmartyBC class
- use Smarty instead of SmartyBC class
- eval_size(): use Config::Lang instead of $PALANG

templates/header.tpl:
- move header() calls to smarty.inc.php, and drop {php} usage



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1544 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz d4a34b557d login.php:
- use AdminHandler to find out if the logged in user is a superadmin
- add hint about config.local.php in "unconfigured" warning
- move some lines around to match users/login.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1543 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f02b781376 backup.php:
- move "unmaintained" warning to templates/backupwarning.tpl (that's 
  the easiest way to have working HTML tags) 
- remove <p> tag from pgsql error message

templates/backupwarning.tpl
- new file, contains the "unmaintained" warning for backup.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1542 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 8ea4fd6c82 AliasdomainHandler.php:
- better error/success messages
- cleanup TODO notes

*.lang:
- new texts for alias domains: alias_domain_change_failed, 
  alias_domain_changed, alias_domain_to_itsself


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1541 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz e96544e815 model/PFAHandler.php, setup.php:
- use Config::lang_f() for $this->msg['successmessage']

*.lang:
- add %s to all texts used for 'successmessage'


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1540 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 21aea632b7 model/PFAHandler.php:
- use Config::lang_f() for msg['store_error']

*.lang:
- add %s to all messages that are used as store_error


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1539 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz e809d2c651 MailboxHandler.php:
- _missing_maildir(): fix forgotten $CONF usage
- cleanup outdated TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1538 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ff5dbe0099 edit.php:
- fix "undefined index hardcoded_edit" message
  (only set in AdminpasswordHandler)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1537 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 4d9a338eb2 After hunting an "undefined index transport" error in list-domain, I
found out that the 'Config' class is too static - it shares its static
data with the 'Lang' child class. 

This caused a conflict because we have $CONF[transport] and 
$PALANG[transport], and Config::read('transport') returned the $PALANG 
text.

To fix this, all texts are now stored as $CONF[__LANG].
I also dropped the 'Lang' class.


model/Config.php:
- mark the 'Config' class as final to ensure we don't trap into the 
  "too static" problem again.
- bool(): display and log an error message if a $CONF option does not
  contain YES or NO (that would have uncovered this bug much earlier)
- add lang() and lang_f() wrapper functions to get $PALANG texts
- remove unused $__cache and $__objects

model/Lang.php:
- deleted

common.php:
- store $PALANG as $CONF[__LANG]

lots of files:
- replace Lang::read() and Lang::read_f() calls with Config::lang()
  and Config::lang_f()




git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1536 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f2c2b554ac model/PFAHandler.php:
- getList: change return value to be always true (even if the database 
  result is an empty array), and die() if the database result is not an 
  array.
  This avoids some if blocks in various files to implement a fallback
  to array() on empty results.

functions.inc.php:
- list_admins(): simplify after the *Handler->getList() change
- get_domain_properties(): change a forgotten $handler->return to 
  $handler->result() (follow-up for r1534)

list-domain, list-virtual.php:
- simplify after the *Handler->getList() change



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1535 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz bb7a3ff04d model/*Handler.php and various other files
- rename $this->return to $this->result


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1534 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f38b10cd61 PFAHandler.php:
- set(): make "field $key is missing" translateable
- store(): call db_log() even if storemore() failed


MailboxHandler.php
- storemore(): use $this->infomsg instead of flash_info
 
*.lang
- add 'missing_field' = 'Field %s is missing';
- change reate_mailbox_result_success' and
  'pCreate_mailbox_result_succes_nosubfolders'
  to "The mailbox %s ..."

en.lang, nl.lang:
- remove unused texts 'pAdminList_domain_usercontrol',
  'pAdminCreate_domain_usercontrol', 'pAdminEdit_domain_usercontrol'


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1533 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 43f2591d93 functions.inc.php:
- smtp_get_admin_email(), domain_postcreation(), domain_postdeletion(): 
  use Config::read instead of $CONF
- smtp_get_response(): whitespace fixes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1532 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ba7ebe7adb scripts/shells/shell.php:
- disable some unused code


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1531 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ade5fd0c24 AliasHandler:
- initStruct(): set default for 'goto' to empty array()
  This fixes a problem with the cli when --goto was not specified				


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1530 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f444de402b functions.inc.php:
- pacrypt(), dovecot:* method:
  - allow "." in dovecot method (to allow a suffix like ".b64")
  - blacklist SCRAM-SHA-1 (needs -u)
  - check against list of non-salted methods to be backward compatible
    with dovecot < 2.1 again
  Thanks to Szilagyi Jozsef <szjozsef AT yahoo DOT com> for providing
  the list of non-salted methods etc.

functions.inc.php, scripts/postfixadmin-cli.php:
- drop unused global variables $table_admin and $table_alias_domain



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1529 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 6ea8b370c0 CliEdit.php:
- make help text (slightly) different for add vs. update


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1528 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1c27ab9074 postfixadmin-cli.php:
- __initConstants(): substr() is a bad idea to find the parent 
  directory. Use dirname() instead.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1527 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 41a2b72e6d postfixadmin-cli.php
- remove function PostfixAdmin - __construct() is enough ;-)
  and having both caused a redefinition warning


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1526 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 5d4240ce52 functions.inc.php:
- pacrypt: digest-md5 hashes include the username - until someone 
  implements it, let's declare it as unsupported and error out


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1525 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 0d6f9ff99f functions.inc.php:
- pacrypt(): some small changes after Szilagyi Jozsef's patch:
  - comment out unused $crypt_method
  - change $dovecotpw default to "doveadm pw" (unrelated to the patch)
  - set $dovepasstest to "-t $pw_db" instead of having two similar
    command lines, and also shellescapearg() $pw_db
  - use "if (empty($dovepasstest))" instead of "if (empty($pw_db))"



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1524 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 161d387485 - pacrypt(): add support for dovecot *-CRYPT passwords
doveadmin pw now has an option "-t $hash" which allows to verify 
  salted passwords (added in dovecot 2.1 AFAIK)
  Also, the {METHOD} part is no longer removed.

  Patch by Szilagyi Jozsef <szjozsef [at] yahoo.com> - thanks!

  (The schemes which requires also the username -u option is still not supported)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1523 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c2ccffb76c functions.inc.php:
- mailbox_postdeletion(): use Config::read instead of global $CONF


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1522 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b985816baa fetchmail: add sslcertck, sslcertpath, sslfingerprint
ADDITIONS/fetchmail.pl
- add sslcertck, sslcertpath and sslfingerprint to fetchmail config
- some whitespace fixes

fetchmail.php
- add sslcertck, sslcertpath, sslfingerprint fields
  (sslcertpath and sslfingerprint require $CONF[fetchmail_extra_options]
  because they don't have input validation)

languages/*.lang
- add new texts needed for the added fields

templates/fetchmail.tpl:
- add the new fields
- also add extra_options and mda fields - they were not displayed yet

upgrade.php
- fix _db_add_field() to call _db_field_exists() with correct table name
- upgrade_1519(): add sslcertck, sslcertpath, sslfingerprint fields to the
  fetchmail table


Most parts of this commit are based on the work of Lars Engelhard
(modified files sent on the mailinglist 2013-07-30)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1519 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 5f94773ae4 MailboxHandler:
- fix syntax error :-/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1518 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 7b6f3e56cb MailboxHandler.php:
- create_mailbox_subfolders(), check_quota(): 
  use class variables instead of parameters
- create_mailbox_subfolders(): remove check for empty $this-id - this can 
  never happen because it would fail much earlier in the class
- check_quota(), allowed_quota(), mailbox_post_script(), 
  create_mailbox_subfolders(): mark as protected



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1517 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f9506d97b1 MailboxHandler.php:
- new function mailbox_post_script()
  - result of merging mailbox_postcreation() and mailbox_postedit(),
    replaces those two functions
  - drop all parameters, read them from class variables instead
  - store warn message in $this->errormsg[] instead of using print
- changed function calls to use mailbox_post_script()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1516 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 73a793433e moved the following functions from functions.inc.php to MailboxHandler.php:
- check_quota ()
- allowed_quota()
- mailbox_postcreation()
- mailbox_postedit()
- create_mailbox_subfolders()

The code was moved without any changes, except
- added leading whitespace
- removed "TODO: move to MailboxHandler" ;-)


MailboxHandler:
- change function calls for moved functions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1515 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ecc84a1486 functions.inc.php:
check_quota()
  mailbox_postcreation()
  mailbox_postedit()
  create_mailbox_subfolders()
  - use Config::read() / Config::bool() instead of $CONF
  - update comment header
  - some minor changes to make the code better readable



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1514 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 08c9b4e49f *.lang:
- renamed some $PALANG texts:
  - pOverview_button => go
  - pOverview_mailbox_name => name
  - pSendmail_admin => from
  - pAdminEdit_admin_username => admin
  - pEdit_alias_goto => to 
- deleted obsolete or duplicate $PALANG texts:
  - pOverview_alias_goto
  - pCreate_alias_goto
  - pEdit_alias_button
  - pEdit_mailbox_name
  - pEdit_mailbox_button
  - pViewlog_username
  - pViewlog_button
  - pAdminList_admin_username
  - pAdminList_virtual_button
  - pAdminList_virtual_alias_address
  - pAdminList_virtual_alias_goto
  - pAdminList_virtual_mailbox_name
  - pAdminEdit_domain_button
  - pAdminEdit_admin_button
  - pBroadcast_from
  - pBroadcast_send

model/*, setup.php, templates/*, users/edit-alias.php:
- update to use the renamed $PALANG texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1513 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1c16c52086 *.lang:
- remove unused $PALANG texts:
  - $PALANG['pCreate_dbLog_createmailbox']
  - $PALANG['pCreate_dbLog_createalias']
  - $PALANG['pDelete_dbLog_deletealias']
  - $PALANG['pDelete_dbLog_deletemailbox']
  - $PALANG['pEdit_dbLog_editalias']
  - $PALANG['pEdit_dbLog_editmailbox']



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1512 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 76f66ac8db *.lang:
- rename some $PALANG variables once more because smarty breaks when
  using "-"
  - add-alias => add_alias
  - add-alias-domain => add_alias_domain
  - add-mailbox => add_mailbox
  - email-address-already-exists => email_address_already_exists
  - change-password => change_password
  - password-again => password_again

model/*, setup.php, templates/*
- update to use the changed $PALANG variables


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1511 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 9c0004a431 *.lang:
- rename various $PALANG texts:
  - pMenu_create_alias => add-alias
  - pMenu_create_alias_domain => add-alias-domain
  - pMenu_create_mailbox => add-mailbox
  - pOverview_get_mailboxes => mailboxes
  - pPassword_button => change-password
  - pAdminList_domain_description => description
  - pAdminList_domain_aliases => aliases
  - pAdminEdit_domain_transport => transport
  - pAdminEdit_admin_password2 => password-again
- remove duplicate or unused $PALANG texts:
  - pOverview_alias_alias_count
  - pOverview_alias_mailbox_count
  - pOverview_get_aliases
  - pCreate_alias_domain_button
  - pCreate_alias_welcome
  - pCreate_alias_button
  - pCreate_mailbox_password2
  - pCreate_mailbox_quota_text_error
  - pCreate_mailbox_button
  - pAdminMenu_viewlog
  - pAdminMenu_create_alias
  - pAdminMenu_create_mailbox
  - pAdminList_domain_mailboxes
  - pAdminList_domain_transport
  - pAdminList_virtual_welcome
  - pAdminList_virtual_alias_alias_count
  - pAdminList_virtual_alias_mailbox_count
  - pAdminList_virtual_mailbox_username
  - pAdminList_virtual_mailbox_quota
  - pAdminEdit_domain_description
  - pAdminEdit_domain_aliases
  - pAdminEdit_domain_mailboxes
  - pAdminEdit_domain_mailboxes_text
  - pUsersMenu_password

model/*, seetup.php, templates/*
- use changed $PALANG texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1510 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 61c5920c46 *.lang:
- rename $PALANG['pUsersVacation_body'] to $PALANG['message']
- remove duplicate $PALANG['pBroadcast_message']

templates/*:
- use $PALANG['message'] everywhere


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1509 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2c96ba8827 *.lang:
- rename -$PALANG['pSendmail_subject'] to +$PALANG['subject']
- remove duplicate -$PALANG['pUsersVacation_subject'] and
  -$PALANG['pBroadcast_subject'] = 'Subject';

templates/*:
- use $PALANG['subject']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1508 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 7bf10e6b91 *.lang:
- rename $PALANG['pEdit_alias_address'] to $PALANG['alias']
  - remove duplicate $PALANG['pOverview_alias_edit']

model/*, templates/*:
- use $PALANG['alias'] everywhere


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1507 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c70465f0e3 *.lang:
- rename $PALANG['pCreate_alias_address_text_error2'] to 
  $PALANG['email-address-already-exists']
- delete $PALANG['pCreate_mailbox_username_text_error2']

model/*:
- use new $PALANG names


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1506 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 9e2e914c17 *.lang:
- remove unused
  -$PALANG['pCreate_mailbox_password_text_error']
  -$PALANG['pAdminCreate_admin_password_text_error']
  -$PALANG['pAdminEdit_admin_password_text_error']



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1505 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 80591f97bc *.lang:
- add $PALANG['password'] to replace duplicate texts
  -$PALANG['pLogin_password']
  -$PALANG['pCreate_mailbox_password']
  -$PALANG['pAdminEdit_admin_password']
- set $PALANG['pFetchmail_field_src_password']= $PALANG['password']; 
  (needed until fetchmail is migrated into FetchmailHandler)

model/*, setup.php, templates/*:
- use $PALANG['password'] everywhere	  


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1504 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz a1646f84b6 *.lang:
- add $PALANG['active'] = 'Active' to replace various duplicates:
  -$PALANG['pOverview_alias_active']
  -$PALANG['pOverview_alias_domain_active']
  -$PALANG['pOverview_mailbox_active']
  -$PALANG['pCreate_alias_active']
  -$PALANG['pEdit_alias_active']
  -$PALANG['pCreate_mailbox_active']
  -$PALANG['pAdminList_admin_active']
  -$PALANG['pAdminList_domain_active']
  -$PALANG['pAdminList_virtual_mailbox_active']
  -$PALANG['pAdminEdit_domain_active']
  -$PALANG['pAdminEdit_admin_active']

model/*, templates/*:
- use $PALANG['active'] everywhere


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1503 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz bf0a5c02f4 *.lang:
- add $PALANG['domain'] = 'Domain'; which replaces duplicate texts:
  -$PALANG['pOverview_get_domain']
  -$PALANG['pViewlog_domain']
  -$PALANG['pAdminList_admin_domain']
  -$PALANG['pAdminList_domain_domain']
  -$PALANG['pAdminEdit_domain_domain']
  -$PALANG['pAdminCreate_admin_address']

model/*, templates/*:
- update to use $PALANG['domain']  


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1502 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 3fedee3074 *.lang and various templates:
- use PALANG['last_modified'] everywhere
- get rid of various duplicate texts for "Last modified":
  -$PALANG['pOverview_alias_modified']
  -$PALANG['pOverview_alias_domain_modified']
  -$PALANG['pOverview_mailbox_modified']
  -$PALANG['pOverview_get_modified']
  -$PALANG['pAdminList_admin_modified']
  -$PALANG['pAdminList_virtual_alias_modified']
  -$PALANG['pAdminList_virtual_mailbox_modified']
- add a translator note to some *.lang if the texts were not exact duplicates


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1501 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz fcee414740 *.lang and various other files:
- rename $PALANG['pAdminList_domain_modified'] to $PALANG['last_modified']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1500 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c5b8814130 setup.php:
- add TODO note to check for PHP >= 5.2.3 because smarty uses 
  htmlentities with 4 parameters (4th param added in PHP 5.2.3)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1499 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 880e6f50ae setup.php:
- explicitely specify (empty) values for description and transport when 
  creating the "ALL" domain to fix problems with strict SQL mode in MariaDB
  https://sourceforge.net/p/postfixadmin/bugs/288/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1497 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1d94a89424 templates/vacation.tpl:
- replace $PALANG.pUsersLogin_username with $PALANG.pLogin_username

languages/*.lang:
- remove obsolete pUsersLogin_username
- add translator notes in some languages


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1496 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f487017bb0 *.lang:
- $PALANG['pInvalidMailRegex']: add mail address as %s:
  "Invalid email address %s, fails regexp check";


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1495 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz d3d7249ea0 MailboxHandler.php:
- remove a TODO in store_more() (tested, works already)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1494 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 414c05e678 functions.inc.php:
- db_where_clause(): wrap condition in "(...)"


model/PFAHandler.php:
- read_from_db(): wrap condition in "(...)"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1493 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 3b7606b654 users/password.php:
- update to use non-static MailboxHandler->login()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1492 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 00bc5c6553 AdminpasswordHandler.php:
- new file, used for "change password" for admins

configs/menu.conf:
- switch from password.php to edit.php?table=adminpassword

password.php:
- deleted, replaced by AdminpasswordHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1491 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ce233789b9 PFAHandler.php:
- add $skip_empty_pass (default: true) - set to false to
  disable skipping empty password fields in edit mode
  (needed for "change password" form)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1490 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz a2e2a832e3 edit.php:
- handle hardcoded values for 'edit' parameter
  (needed for handling "change password")


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1489 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz e7ea1f167e users/login.php:
- use imported variables instead of $_POST


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1488 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c711467174 users/login.php:
- don't escape_string() username and password


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1487 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 91423b5baf login.php:
- use AdminHandler->login()
- don't escape_string() username and password



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1486 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 7557ed5fae PFAHandler.php, MailboxHandler.php:
- move login() to PFAHandler.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1485 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 8ff856df12 MailboxHandler.php:
- make login() a non-static function
- login: use $this->db_table and $this->id_field instead of hardcoded names

users/login.php, xmlrpc.php:
- adopt to now non-static MailboxHandler->login()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1484 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 9af5a5cc03 *Handler.php:
- set $db_table and $id_field in the class, not inside initStruct()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1483 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz a07b822906 functions.inc.php:
- remove unused functions:
  - authentication_is_admin()
  - authentication_is_user()
  - check_string()
  - admin_exist()
  - domain_exist()
- add various TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1482 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 79403ad709 functions.inc.php:
- delete unused function get_mailbox_properties()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1481 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 703f7a31cf language-update.sh:
- update transtation guidelines


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1478 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 62d4374de1 da.lang:
- translation update by Titanus <titanus AT aptget DOT dk>, via mailinglist


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1477 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b5aeb5a0a6 MailboxHandler:
- fix 'goto' handling
  https://sourceforge.net/p/postfixadmin/bugs/292/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1476 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 96b1c3c7f4 list-virtual.php, smarty.inc.php:
- replace boolconf() calls with Config::bool()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1475 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2cbbac134f functions.inc.php:
- replace boolconf() calls with Config::bool()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1474 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 21494f2a14 Config.php:
- add intbool() - similar to bool(), but returns 1/0 instead of true/false

DomainHandler.php
- initStruct(): use Config::intbool() instead of boolconf()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1473 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 68ae542817 AliasHandler:
- use Config::bool() instead of boolconf()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1472 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz dc8ea753fc Config.php:
- add read_f() - similar to read(), but accepts a second parameter which
  is then included in the text using sprintf
- bool(): change parameter name


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1471 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 71200c1049 functions.inc.php:
- check_email: mention the invalid mail address in errormessage
  (needs text change)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1470 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 29236ffaa4 MailboxHandler.php:
some bugfixes:
- init(): let $domain always base on $this->id (also on $new)
- make mergeId dumber (by removing an error check). This can of course 
  result in an invalid mail address, but this is handled more gracefully 
  than an empty $this->id
- updateMaxquota(): use Lang::read_f instead of sprintf


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1469 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b197e148b3 edit.php:
- refresh $form_fields after ->set(). This fixes a wrong "allowed quota"
  if creating a mailbox ends up with an error message because of invalid
  values.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1468 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b15319c21a functions.inc.php, model/Config.php:
- move boolconf() to Config::bool()
  boolconf() will stay for backwards compability, but new code
  should use Config::bool()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1467 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 3d092324b6 edit-mailbox.tpl:
- delete no longer needed template (handled by edit.php/editform.tpl 
  since some time)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1466 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 9b2daac756 languages/dropspan
- delete no longer used helper script (job done long time ago ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1465 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 6e13314f52 *.lang:
- remove 38 unused texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1464 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 51434a05a6 setup.php
- replace some strings marked as obsolete


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1463 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 0b4f71aab4 *.lang:
- change $PALANG['pCreate_alias_result_success'] to 'The alias %s has 
  been created!' (%s added, less technical wording)

nl.lang:
- removed duplicated $PALANG['pVacation_result_added']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1462 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c53400ec5f MailboxHandler.php:
- validate_new_id(): store error message in 
  $this->errormsg[$this->id_field] instead of $this->errormsg[]
- beforestore(): use first array key instead of [0] to match the
  change in validate_new_id()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1461 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ea7036ae62 AliasdomainHandler:
- delete(): return error message if db_delete fails


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1460 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2d127bdec8 AliasHandler:
- validate_new_id(): store errormessages in 
  $this->errormsg[$this->id_field] instead of $this->errormsg[]


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1459 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 85fb572db7 scripts/shells/alias.php, mailbox.php, domain.php:
- various fixes to make deleting aliases / mailboxes / domains work


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1458 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 7862cca6a2 scripts/inflector.php
- marked camelize(), underscore() and variable() as public static 
  function to avoid PHP warnings with latest PHP (5.4.x)
- removed unused methods humanize(), tableize(), classify() and slug()
- removed unused function __enclose()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1457 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 61dfcb9192 AdminHandler.php:
- implement delete()   (untested!)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1456 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 66ab8fb290 functions.inc.php:
- db_log(): allow delete_admin action


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1455 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 631c6e754f common.php:
- move postfixadmin_autoload() and spl_autoload_register upwards
  (it's needed earlier after using the Config class in more functions)
- call Config::write earlier (as soon as $CONF is complete)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1454 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 9c92eef2ff functions.inc.php:
- remove some unused "global $CONF"
- replace some $CONF usage with Config::read() or boolconf()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1453 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 70978e09a4 functions.inc.php:
- check_domain(), check_email(): 
  use Lang::read and Config::read instead of global variables 
  (global variables, at least $PALANG, don't seem to work with CLI)
- boolconf(): 
  - use Config::read instead of global $CONF
  - drop isset() check - doesn't make sense when using Config::read


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1452 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 871bcbbe2f functions.inc.php:
- check_domain(), check_email(): instead of calling flash_error(),
  return string with error message - or empty string if everything is ok

model/AdminHandler.php, model/AliasHandler.php,
model/DomainHandler.php, model/MailboxHandler.php,
sendmail.php, users/edit-alias.php:
- adopt to changed check_domain() and check_email() return value


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1451 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c64768727d list-virtual_mailbox.tpl:
- replace edit-active.php with edit.php?...&active=

edit-active.php:
- finally unused after the above change -> delete


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1450 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f92a32eae1 PFAHandler.php:
- initStruct(): add some comments
- add calledBy() and protected $called_by - calledBy() should be called if one 
  *Handler class calls another one (to avoid loops etc.)

AliasHandler.php:
- replace $called_by_MailboxHandler / MailboxAliasConfig() with $called_by
  (code moved to PFAHandler->calledBy())

MailboxHandler.php:
- beforestore(): update alias active status on edit
  (contains some whitespace changes - basically I removed "if ($this->new)"
  around most parts of the code)
- use calledBy() instead of MailboxAliasConfig()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1449 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz e3731dc89d scripts/shells/* (alias.php, domain.php, mailbox.php):
- delete AddTask and UpdateTask classes - obsoleted by model/CliEdit.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1448 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 7276276ba2 scripts/shells/shell.php:
- implement "update" for all *Handler classes by using CliEdit class
  (yes, it's really that easy ;-)

This gives us a working *) CLI for "update" in interactive and
non-interactive mode.   

*) TODO: test if everything works ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1447 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz dd2dc60ebf lt.lang:
- translation update by Nerijus Baliunas <nerijus @SF>
  https://sourceforge.net/p/postfixadmin/patches/118/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1446 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 68390b0201 functions.inc.php
- allowed_quota: if $CONF[quota] == NO, just return 0 (unlimited)

list-virtual.php:
- only eval_size($limit['maxquota']) if $CONF[quota] == YES
  ($limit['maxquota'] is not set if $CONF[quota] == NO)

Both issues (which caused PHP warnings) were found by TigerP on IRC


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1445 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2091c50662 vacation.pl:
- fix typo in variable name


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1444 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Valkum acdbd4b5a6 added custom noreply detection
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1442 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1e0225e2c2 model/CliEdit.php:
- help(): generate help output based on $handler->struct
  It shows all available options/fields, but might need some finetuning
  to look better



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1441 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f240e20831 model/CliEdit.php:
- add __handle_params() to implement non-interactive mode. It
  reads, checks and handles the various --* commandline parameters
- __handle():
  - replace $this->error() calls with $this->err()
  - add missing return on failure



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1440 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 74deef8221 functions.inc.php:
- validate_password(): use Config::read and Lang::read instead of 
  $CONF and $PALANG


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1439 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz be84a8b8fc MailboxHandler:
- _field_password(): return true if checks are successful
  (without this, an empty password might have ended up in the database!)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1438 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz eafc2b6222 model/CliEdit.php:
- new class for CLI add and edit
- based on AddTask, but big parts of __interactive()) are rewritten to:
  - use $struct for the user interface (which means it will automatically 
    adopt to changes in the *Handler classes)
  - check all entered data instantly. If an invalid value was entered,
    ask again to give the user a chance to enter valid data.
- CliEdit already replaces all AddTask classes (interactive mode works, 
  commandline parameter mode not implementated yet)
- will also replace all EditTask classes in the future

scripts/shells/shell.php
- loadTasks(): for add, use new CliEdit instead of AddTask class
- in():
  - print additional empty line if $prompt is not empty
  - print error message when invalid option is chosen
  - always return raw $in to avoid '0' vs. ''. vs NULL problems



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1437 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b878f18dcc MailboxHandler:
- _missing_local_part(), _missing_domain(): remove broken if condition


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1436 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 8c3dcf32d7 lt.lang:
- translation update from Nerijus Baliunas (nerijus @SF)
  https://sourceforge.net/p/postfixadmin/patches/118/

en.lang:
- typo fix, also from Nerijus Baliunas (nerijus @SF)
  https://sourceforge.net/p/postfixadmin/patches/118/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1434 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz b4823b9e04 Finally replace create-mailbox.php with edit.php?table=mailbox :-)
configs/menu.conf:
- change url_create_mailbox to edit.php?table=mailbox

templates/list-virtual.tpl:
- replace hardcoded create-mailbox.php with {#url_create_mailbox#}

functions.inc.php:
- delete functions that are now part of MailboxHandler:
  - check_mailbox()
  - multiply_quota()
- add some TODO notes

config.inc.php:
- rewrite a comment that referenced create-mailbox.php

create-mailbox.php:
- delete - no longer needed


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1433 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 13f89e339b MailboxHandler.php:
- add _field_password():
  - compare password / password2 field (error message will be displayed 
    at password2 field)
  - autogenerate password if enabled in config and $new
  - display password on $new if enabled in config or autogenerated

This means MailboxHandler now has all needed features to replace 
create-mailbox.php :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1432 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 47b0ebdec5 config.inc.php:
- fix typo in comment


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1431 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 8d2e570c03 functions.inc.php:
- _flash_string(): move return outside the foreach so that multiple
  messages can be displayed


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1430 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 182485e9d9 POSTFIX_CONF.txt:
- add note about virtual_mailbox_base


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1429 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 227eca6faf PFAHandler.php:
- introduce public array $infomsg[] (for success messages)
- store(): write successmessage to $this->infomsg[]

edit.php:
- display $handler->infomsg instead of hardcoded success message

AdminHandler.php, AliasHandler.php, AliasdomainHandler.php,
DomainHandler.php, MailboxHandler.php:
- move successmsg from webformConfig() to initMsg()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1428 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 268dd5372d edit.php:
- add comment about prefill GET parameters


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1427 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 5a8ee27af3 displaying the available quota on $new is harder than it looks...
edit.php:
- call $handler->prefill for all prefill fields
- refresh $form_fields after handling prefill fields

model/PFAHandler.php:
- add prefill() to handle prefill fields. If $this->_prefill_$field()
  exists, it will be called

model/MailboxHandler.php:
- init(): error out early if parent::init fails (no need to check the
  available quota if $this->id is invalid ;-)
- move updating the allowed quota to updateMaxquota()
- update the available quota based on the prefill domain. If no prefill
  domain is given, default to the first domain.
- new method _prefill_domain()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1426 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 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
12 years ago
Christian Boltz 2e503a3867 MailboxHandler.php:
- initStruct() / $struct:
  - add various labels
  - make local_part and domain editable on $new
  - fill domain option list with allowed_domains
  - add 'welcome_mail' (bool, not in database) for $new
- webformConfig(): 
  - change $struct to display localpart + domain instead of username on $new
  - disable early_init (not needed for mailboxes)
- add function mergeId()
- add function _field_password2 (to compare password/password2)
- drop deprecated function change_pass()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1367 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz b58d398cf2 AdminHandler:
- initStruct(): add explanation what "superadmin" means
  https://sourceforge.net/tracker/?func=detail&aid=1865123&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1366 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 4b7929626a *.lang:
- new text: pViewlog_action_edit_vacation (log entry for "edit vacation")
- new text super_admin_desc (explanation what "superadmin" means)
  https://sourceforge.net/tracker/?func=detail&aid=1865123&group_id=191583&atid=937964



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1365 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz db8c2df6bc PFAHandler:
- set(): call $this->_missing_$fieldname() if a field is not set on $new
- new function set_default_value() - typically called from
  _missing_$fieldname to set the default from $struct

AliasHandler:
- set default values on $new:
  - on_vacation and active from $struct default
  - localpart and domain based on address

scripts/shells/alias.php:
- convert AddTask to *Handler syntax. It was broken before, see
  https://sourceforge.net/tracker/?func=detail&aid=3232719&group_id=191583&atid=937964 



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1364 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 489f7a4155 templates/list-virtual_alias_domain.tpl,
templates/list-virtual_alias.tpl:
- remove limit={$current_limit|escape:"url"} which isn't set anywhere


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1363 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e60ede3fbf list-virtual:
- if used quota is unknown, display "unknown" instead of "undefined index"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1362 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 306c5a9688 PFAHandler:
- add function compare_password_fields() - compares if two fields contain
  the same password (based on _field_password2() from AdminHandler)
  and use pEdit_mailbox_password_text_error as error message because it
  doesn't contain "... or empty"

AdminHandler:
- replace _field_password2() with a call to $this->compare_password_fields()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1361 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 56a8d1c52f MailboxHandler:
- start rewrite based on PFAHandler
- add initStruct(), initMsg(), webformConfig(), validate_new_id(), 
  create_allowed()
- drop old __construct() and view()
- replace $this->username with $this->id
- replace check of old password in change_pw() with $this->login 
 
users/password.php:
- adopt to *Handler syntax

scripts/shells/mailbox.php:
- adopt to *Handler view() syntax
- add TODO - maildir column isn't displayed
  
xmlrpc.php:
- adopt to *Handler syntax

Note: as usual, the changes in xmlrpc.php are untested ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1360 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 19c6748988 VacationHandler:
- move getVacationAlias to AliasHandler (the only code that uses it)

AliasHandler:
- insert (and rewrite) function getVacationAlias()
- change $vh->getVacationAlias() calls to $this->getVacationAlias.
  This also means we don't need to call VacationHandler anymore to get
  the vacation alias.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1359 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e9d8fa1ff9 remove obsolete functions from AliasHandler (part 2/2)
AliasHandler.php:
- remove obsolete functions update(), is_mailbox_alias(), 
  is_vacation_address(), hasAliasRecord()
- updated delete() to use new *Handler syntax (most of it should be
  moved to PFAHandler, but that's another story ;-)

users/edit-alias.php:
- replace $ah->update with $ah->set / $ah->store
- use 0/1 for $fForward_and_store instead of YES/NO
- use safepost instead of isset()

templates/users_edit-alias.tpl:
- use 0/1 for $fForward_and_store instead of YES/NO

xmlrpc.php:
- replace $ah->update with new *Handler syntax

Note: the changes in xmlrpc.php are untested again ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1358 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz fff6654634 AliasHandler:
- remove deprecated functions get() and hasStoreAndForward()

scripts/shells/alias.php:
- ViewTask: switch to *Handler syntax
- ViewTask: display is_mailbox, goto_mailbox and on_vacation status

users/edit-alias.php:
- replace $ah->get() and $ah->hasStoreAndForward() with *Handler syntax
- remove outdated comment in header

xmlrpc.php:
- switch get() and hasStoreAndForward() to *Handler syntax

Note: the changes in xmlrpc.php are untested!


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1357 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e4d5d4574e VacationHandler:
- use new *Handler syntax to add/remove vacation alias
  (implemented as function updateAlias() to avoid code duplication)

AliasHandler:
- setmore(): only use $oldvalues if no new on_vacation value is given
- setmore(): fix "undefined index" warning

edit.php:
- only set $values if a field is editable and displayed in the form
- do not set default values in $values
  (without those changes, the vacation alias was always removed when
  editing an alias)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1356 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 54deb1fb23 list-virtual.php:
- pagebrowser: current page is no longer a link


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1355 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 27ebaa1ce4 list-virtual.php:
- use AliasHandler instead of direct SQL queries

templates/list-virtual_alias.tpl:
- goto is an array now, not a comma-separated string


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1354 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz b99adf6237 PFAHandler:
- add support for LIMIT/OFFSET to getList()

AliasHandler:
- overload getList() to only return non-mailbox aliases


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1353 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz d03e239515 list-virtual.php:
- use AliasdomainHander instead of doing direct database queries
- add search support for alias domains
- display "create alias domain" button only if this is possible
- always assign $tAliasDomains smarty variable (even if empty) to avoid warnings
- always escape $fDomain (even if it comes from $list_domains)
- rename $SESSID_USERNAME to $admin_username

templates/list-virtual_alias_domain.tpl:
- remove reference to non-existing variable $tTargetDomain


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1352 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 50c7044f72 AliasHandler:
- if the alias points to the mailbox, don't display the "empty goto" 
  error message


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1351 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 9aebf298d3 templates/list-virtual_alias.tpl, templates/list-virtual_mailbox.tpl:
- change edit-alias.php links to edit.php?table=alias

edit-alias.php, templates/edit-alias.tpl:
- now obsolete :-) -> deleted



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1350 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz cb0cf81b5a AliasHandler:
- add handling for $CONF[alias_control_admin] in init()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1349 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 9b2da37d84 AliasHandler:
- setmore(): keep/(re-)add vacation and mailbox alias to goto
- hide 'goto_mailbox' if the alias does not belong to a mailbox
  (done in initStruct for $new, otherwise in init())

edit.php:
- set $form_fields and $id_field later (after $hander->init()) - needed
  for AliasHandler to decide if goto_mailbox should be displayed

With this commit, AliasHandler is feature-complete for usage with 
edit.php. We even get a "deliver to local mailbox" checkbox :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1348 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e66bb02b84 AliasHandler.php:
- $struct: add is_mailbox (does the alias belong to a mailbox?)
- $struct: add goto_mailbox (if the alias is a mailbox, does it point 
  to the mailbox or is it forward-only?)
- set goto_mailbox in read_from_db_postprocess()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1347 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 2f3d4bcb9c users/edit-alias.php:
- remove unused variable $USERID_DOMAIN


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1346 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 060b101d69 upgrade.php:
- add \n after "Upgrading database" lines - that makes the output readable 
  if setup.php is called in a console instead a webbrowser


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1345 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 3fc6c84e13 AliasHandler.php:
- initStruct(): add 'on_vacation'
- read_from_db_postprocess(): split off vacation alias from $goto
  and store vacation status in on_vacation (honors the vacation alias
  only, not the details from the vacation table)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1344 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b0277b6c03 functions.inc.php
- new function remove_from_array()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1343 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4e5bd47183 functions.inc.php:
- pacrypt(): escape_string() $salt for mysql_encrypt to be on the safe side


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1332 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e3b242e4d8 flash_error.tpl:
- html-escape flash_info() / flash_error() messages to fix XSS if the
  message contains user-supplied input
  (thanks to Filippo Cavallarin for the report)

Note: This will cause ugly output for some german error messages which
contain &uuml; etc., and the warning message in backup.php (with some
HTML tags included) will also look totally ugly.
Nevertheless, that's still better than XSS attacks ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1331 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 19b9535e43 functions.inc.php:
- PHP around 5.3.8 includes hex2bin as native function - http://php.net/hex2bin
  therefore we have to wrap our function (which fortunately gives the same
  results) with function_exists().
  Reported by MadOtis on #postfixadmin



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1328 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin cb640c87c1 fix sql injection in pacrypt() when mysql_crypt is in use; see previous commits etc esp in the 2.3 branch
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1327 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 1a9104cab4 sql injection fix - ported back to trunk from branches/2.3 ...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1326 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 51ddbd2f2e list-domain.php:
- add missing $condition paramter in DomainHander->getList() call


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1318 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e719c6c4dd create-alias.php:
- deleted, obsoleted by edit.php?table=alias

functions.inc.php:
- drop function check_alias() - it was only used by create-alias.php
  (AliasHandler has a similar function create_allowed(), which is a
  copy of check_alias() with superfluous {...} removed)

configs/menu.conf
- replace create-alias.php with edit.php?table=alias
- append "?" to url_create_mailbox to avoid temporary change in menu.tpl
  (create-mailbox is the only one which still needs ? instead of &)

templates/list-virtual.tpl:
- use {#url_create_alias#} instead of hardcoded create-alias.php

templates/menu.tpl:
- $url_domain: url-escape domain, use & instead of ?



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1317 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 088fef9bdb AliasHandler.php:
- override init() - change '*@domain' -> '@domain', then call parent::init()
- validate_new_id(): allow catchall ('@domain'), check only domain in this case
- create_allowed(): copy of check_alias() from functions.inc.php, with 
  superfluous { ... } removed
- remove forgotten debugging from mergeId()
- _field_goto(): 
  - allow '@domain' targets (domain-wide forward)
  - use an array to collect error messages - that avoids 'uninitialized'
    warnings and allows to easily change the join() glue if needed

Overall status:
- create-alias is now fully supported
- handling of vacation and mailbox aliases is still on my TODO list, which
  means we still need edit-alias for now


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1316 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Norman Messtorff 78c07dbd42 debian/rules:
- New target prep: Create a needed tar.gz file to build a non-nativ .dpkg
 - New target build-package: Call this target to build a shiny new .dpkg file.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1313 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Norman Messtorff a79d0d4c79 postfixadmin.postrm:
- Call wwwconfig scripts only if they are existing.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1312 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d39a802d00 AliasHandler now works with edit.php in many cases
(TODO: catchall handling, mailbox and vacation aliases)

AliasHandler.php
- drop unused $username
- set $domain_field
- initStruct():
  - use correct labels
  - set 'domain' field options to allowed domains
  - add (virtual) 'localpart' field
  - add comments for more virtual fields
- add webformConfig() (note: modifies $struct on $new - otherwise we 
  couldn't use the domain dropdown in the web interface)
- add mergeId to merge localpart and domain to address (called by 
  edit.php _before_ ->init)
- add validate_new_id() (doesn't work for catchall yet)
- add setmore() to 
  - fill 'domain' based on 'address'
  - convert $values[goto] from array to comma-separated string
- add read_from_db_postprocess to split goto to an array
  (TODO: handling of mailbox and vacation aliases)
- add _field_goto() validator
- add empty, commented dummy delete() that will replace the "old" 
  delete function one day
- make hasAliasRecord() private (only used internally)
- mark all "old" functions as obsolete

edit.php:
- add handling of txtl field (convert textarea to array)
- call $handler->mergeId if $id_field is editable, but not displayed 
  in form (usecase: merge localpart + domain to address)

editform.tpl:
- add handling of txtl fields (textarea, filled by array)

PFAHandler.php:
- add setmore() hook function - runs at the end of set()

AdminHandler.php:
- add a comment for 'txtl' (array of one line texts, like alias goto)




git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1311 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz da9a69dd0d AliasHandler.php:
- add initStruct() (not the final version, but works for now)
- add initMsg()
- replace $this->username with $this->id everywhere
- drop __construct() - default __construct will be used now

users/edit-alias.php, xmlrpc.php, VacationHandler.php, scripts/shells/alias.php:
- use default init sequence for AliasHandler (new, then ->init())


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1310 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b8812686aa AliasdomainHandler.php, PFAHandler.php:
- move empty storemore() function from AliasdomainHandler to PFAHandler



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1309 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0c42306267 list-virtual_alias_domain.tpl:
- use edit.php to switch active status for alias domains

edit-active.php:
- remove now superfluous handling of alias domains

configs/menu.conf:
- remove now superfluous url_edit_active (templates for list-mailbox
  and list-alias use hardcoded 'edit-active.php')



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1308 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5416e93e5a adminlistadmin.tpl:
- use edit.php to switch active status for domains

edit-active-admin.php:
- deleted, obsoleted by using edit.php

configs/menu.conf:
- remove now superfluous url_edit_active_admin



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1307 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 91f613db5f adminlistdomain.tpl:
- use edit.php to switch active status for domains
- display backupmx and active status as yes/no instead of 1/0

edit-active-domain.php
- deleted, obsoleted by using edit.php

configs/menu.conf
- remove now superfluous url_edit_active_domain



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1306 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 2beac12971 edit.php:
- implement switching active status using *Handler
  (uses additional 'active' url parameter, which must be 0 or 1)
- document GET parameters


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1305 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Norman Messtorff d73e59fd8f Some more lintian fixes:
- control: added php5-cli dependency
 - rules: some permission fixes to postfixadmin-cli scripts
 - postfixadmin.docs: removed redundant changelog file

Merry christmas!



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1304 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 18b8564b64 Make $struct in the *Handler classes customizeable
config.inc.php:
- add $CONF['*_struct_hook'] to modify $struct in the *Handler classes

PFAHandler.php:
- call $CONF['*_struct_hook'] hook

AdminHandler.php, AliasdomainHandler.php, DomainHandler.php:
- remove now outdated TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1303 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6eb7e9f794 PFAHandler.php:
- encrypt passwords ("pass" fields) with pacrypt()

AdminHandler.php:
- update/remove various TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1302 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ee33647232 setup.php
- add rewritten function create_admin() (now using AdminHandler, 
  which means 25 instead of 80 lines)
- various follow-up changes to match the rewritten function create_admin()

functions.inc.php:
- delete function create_admin() - setup.php was the last file calling it
- honor POSTFIXADMIN_SETUP in authentification_get_username() to avoid
  a redirect to login.php after creating an admin with setup.php and to
  get "SETUP.PHP" for db_log()

model/AdminHandler.php:
- add TODO: implement generate_password


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1301 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f6425e025b Delete the now unused files
- edit-admin.php
- create-admin.php
- templates/admin_edit-admin.tpl

Total: about 300 lines deleted


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1300 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 25abbafd20 configs/menu.conf, templates/adminlistadmin.tpl:
- use edit.php?table=admin instead of create-admin.php and edit-admin.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1299 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b335abf02e functions.inc.php - db_log():
- allow log actions create_admin and edit_admin
- add edit_admin_state and delete_admin as comment/reminder that they 
  should also be logged

*.lang:
- add text for the new "create admin" and "edit admin" log actions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1298 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 23c08bc02e PFAHandler.php:
- store unchecked input values given to set() in $this->RAWvalues before
  running the validation functions. This is needed to make comparing 
  password and password2 possible.
  (uppercase RAW intentional to make usage harder - hopefully hard enough
  to give everybody who wants to use it some time to think over secure
  programming when working with unchecked input ;-)

AdminHandler.php:
- compare password and password2

This commit means AdminHandler is complete :-)

(Note: db_log can't handle the admin-related log actions yet.)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1297 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Norman Messtorff c65c2caa7a - added missing files/dirs (smarty, *.js etc.) into the package
- simplified the DB credential patch and removing ucf registrations on package purge...



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1296 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Norman Messtorff b5397e595c Again some Debian stuff:
- Changed source format to 3.0 (quilt)
 - Added watchfile



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1295 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Norman Messtorff bf92cc3dc6 Updating Debian-Standards-Version:
* debian/rules: added missing build Targets
 * debian/control: removed VCS field, not longer needed.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1294 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3a8a738585 PFAHandler.php:
- fix field type for skipping password fields (must be 'pass', not 'password')
- implement validation of 'pass' fields with validate_password()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1293 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 76befc69ff editform.tpl:
- implement handling of password fields (type=password, and never
  fill the value)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1292 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 300f096025 AdminHandler.php:
- add empty no_domain_field() to disable default die() from PFAHandler
- $struct: 
  - changed 'superadmin' to normal bool field (+ TODO note)
  - changed 'password2' to be an alias of password in SELECT
  - init 'domains' default with array() and options with list_domains(),
- storemore():
  - implement storing domains in domain_admins table
  - implement storing ALL in domain_admins table for superadmins to 
    keep the database backwards-compatible with 2.3.x for now
- add read_from_db_postprocess() to convert the domains list to an array

This makes AdminHandler working with edit.php?table=admin
(Some fine-tuning at various places/files is still missing.)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1291 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 9104b0652a editform.tpl:
- implement handling of 'list' fields (<select> with multiple choices 
  allowed)
- also include alternative implementation with checkboxes (commented out)
- change {$value_{$key}} to $value_{$key} for 'enum' to stay in sync 
  with 'list' ('list' fails with the additional {...} because it converts
  the array to the string "Array") (seems to be new behaviour in Smarty 
  3.1.5 - IIRC 3.0.7 required the additional {...})


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1290 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 06c2d414ef smarty.inc.php: some fixes after the Smarty upgrade:
- use SmartyBC (Backwards Compatible) instead of Smarty class to keep 
  {php} in templates working (do we really need this?)
- remove obsolete allow_php_tag
- config_dir default value is now an array



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1289 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 35d91d4b0c update smarty from 3.0.7 to 3.1.5
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1288 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7773c537cc PFAHandler.php - read_from_db():
- also include column in SELECT if display_in_form != 0
- call read_from_db_postprocess() hook before returning data


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1287 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0f0b7d336c PFAHandler:
- split code to handle domain_field == "" && admin_username != ""
  from __construct() to no_domain_field().
  Default behaviour stays to die(), but AdminHandler will override it


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1286 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3baf1a61c9 functions.inc.php:
- db_delete(): allow to specify additional conditions for the WHERE clause


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1285 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 41d8bcaf0a upgrade.php:
- upgrade_1284(): migrate the ALL domain to the superadmin column
  Note: The ALL domain is not (yet) deleted to stay backwards-compatible 
  for now (will be done in a later upgrade function)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1284 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 48f2a0a94b upgrade.php
- upgrade_1283(): add a "superadmin" column to the admin table
  This is the first step to get rid of the "ALL" dummy domain.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1283 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6f9d520262 list-admin.php:
- use AdminHandler
- move displaying the superadmin flag to the template

templates/adminlistadmin.tpl:
- update to the fieldnames provided by AdminHandler (name->username)
- move displaying the superadmin flag to the template

functions.inc.php:
- delete function get_admin_properties() (was only used by list-admin
  and is not needed anymore) -> 48 lines less :-)
- add TODO to list_admins() to use AdminHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1282 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 36e31b9e23 AdminHandler.php (new file):
- Handler for admins
- list mode works
- edit mode not implemented yet


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1281 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e95dffb55a users/edit-alias.php:
- remove unused $vacation_domain and $vacation_goto


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1280 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 24d9d695ad edit.php:
- whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1279 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz dd21f03616 functions.inc.php - db_log():
- add log action 'edit_alias_domain'
- update outdated comment to point to $action_list instead of 
  maintaining the list as comment _and_ variable

languages/*.lang
- add $PALANG['pViewlog_action_edit_alias_domain']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1278 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 50590a5eea configs/menu.conf:
- move url_edit_domain to global section to avoid warning
- remove unused _txt_list_domain and [main] section


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1277 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8f267c1b7f Use edit.php to create/edit domains
model/DomainHandler.php:
- add webformConfig()

configs/menu.conf:
- change url_edit_domain to edit.php?table=domain
- drop url_create_domain (use url_edit_domain instead)

templates/*:
- replace #url_create_domain# with #url_edit_domain#
- replace ? with &

create-domain.php:
- deleted :-)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1276 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 9cf7c7799a Use edit.php to edit/create for alias domains
(yes, we get edit mode "for free")

model/AliasdomainHandler.php:
- add webformConfig()

configs/menu.conf:
- change url_create_alias_domain to edit.php?table=aliasdomain

templates/list-virtual_alias_domain.tpl
- change ?target_domain to &target_domain 
  (TODO: this is currently ignored by edit.php)
- add edit link (TODO: add log action to avoid the error message)

create-alias-domain.php:
- deleted :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1275 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7ed5f7e471 Several changes to make edit.php a generic edit form
edit.php:
- use ?table= parameter to decide what will be edited
- generate (and validate) Handler classname based on ?table=
- read handler-specific configuration from $handler->webformConfig()
  and use it at various places
- add option to run $handler->init() early. Useful for $new in case
  of AliasdomainHandler which might fail if all domains are already
  aliased.
- always redirect to edit.php?table=$table after adding an item to
  ensure correct initialization for next item

templates/editform.tpl:
- add hidden field "table"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1274 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz bfd4981433 PFAHandler.php:
- fix view() to use associative array key


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1273 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0730cdfc6f copy edit-domain.php to edit.php (exact copy, no changes)
edit.php will be used as generic edit page for everything
(admins, domains, mailboxes, aliases, ...)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1272 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 63f20c28da AliasdomainHandler.php - initStruct():
- if only one alias_domain available, filter it out from target_domain list


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1271 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3f0e77e6ab editform.tpl:
- replace hardcoded $value_transport with {$value_{$key}


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1270 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 06ffffae7d AliasdomainHandler.php:
- set $domain_field to enable permission handling (and to get a list of
  allowed/available domains)
- fill $this->struct['alias_domain']['options'] and 
  $this->struct['target_domain']['options'] with available domains that
  are not yet used as alias domain
- override init() to get "All domains are already aliased" error message
  out as early as possible (and let init() fail in this case)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1269 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 157034d8fe PFAHandler.php:
- read_from_db(): use associative array for database content
  (with $this->id_field as key)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1268 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a0e59f82b9 model/DomainHandler.php:
- set $domain_field to enable domain permission handling

list-domain.php:
- use permission handling of DomainHandler. This means:
  - no need to call list_domains_for_admin() 
  - no longer hand over SQL sniplets
  - much easier handling for superadmins and "simulate admin" mode
  - 14 lines less code for permission handling etc.
- remove superfluous/outdated header comments
- move $smarty_assign('select_options') to global section (it's the
  same code for domain admins and superadmins)

Note: don't try to read the diff of list-domain.php.
Read the complete file instead ;-)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1267 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 68c79b9013 PFAHandler.php:
allow restriction to an admin's domain permissions

- new protected variables:
  $admin_username  - if set, restrict $allowed_domains to this admin
  $domain_field    - column containing the domain
  $allowed_domains - if $domain_field is set, this is an array with
                     the domain list
- __construct: new optional parameter $admin_username to restrict
  allowed domains to this admin's permissions
- read_from_db(): handle $allowed_domains
- read_from_db(): fix query if $condition == ""

PS: Yes, I know some people would like to kill me for including 
    permission stuff in PFAHandler, but it's the best (and shortest,
    only +20 lines) way to handle it.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1266 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 410de7229d functions.inc.php - list_domains_for_admin():
- rewrite to work for superadmins also (will list all domains now
  instead of "ALL"), which means we can drop the admin vs. superadmin
  check at various places
- escape_string $username


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1265 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a4e2e9101b functions.inc.php:
- get_admin_properties(): escape_string $username instead of relying on
  the calling code to pre-escape it


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1264 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e21e843c8d templates/create-alias-domain.tpl:
- use PALANG.pAdminEdit_domain_active instead of 
  PALANG.pCreate_alias_domain_active

languages/*.lang
- mark $PALANG['pCreate_alias_domain_active'] as obsolete



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1263 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d065179993 create-domain.php, templates/editform.tpl:
- move handling of displaying checkboxes to editform.tpl.
  This means: One switch block less in create-domain.php



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1262 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 398ce70132 model/AliasdomainHandler.php:
- new file
- handler class for alias domains
- completely working (except delete)
- some TODOs included


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1261 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz def9c22fb1 create-domain.php, templates/editform.tpl:
- move special handling for enum fields from PHP select_options() to 
  the template using smarty {html_options}


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1260 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 161c9b1ed2 scripts/shells/domain.php:
- AddTask:
  - use $values[$field] instead of a short variable name for input
  - hand over $values array to __handle as array instead of dozens of variables
- ViewTask: use $struct for printing the output

model/DomainHandler.php:
- use 'created' as label for created



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1259 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4010127bf7 language-update.sh:
- delete *.orig files on cleanup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1258 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 46a475a75f *.lang:
- new text $PALANG['created'] = 'Created';


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1257 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8dda511cd5 scripts/shells/domain.php / AddTask:
- read transport options from $handler->getStruct
  (instead of $handler->getTransports())
- convert selected transport to to transport name directly
  (instead of using $handler->getTransport)

model/DomainHandler.php:
- init_struct: read transport options with Conf::read directly
  (instead of using $this->getTransports()
- delete no longer used functions getTransports() and getTransport()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1256 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e4fc3623cc PFAHandler.php:
- add/update several comments



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1255 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ae52f243e5 PFAHandler.php, DomainHandler.php:
- move definition of public and protected variables to DomainHandler.php
- move lots of functions from DomainHandler.php to PFAHandler.php:
  - __construct()
  - init()
  - set()
  - store()
  - read_from_db()
  - view()
  - getList()
  - getStruct()
  - getId_field()
  All functions and comments were moved without any modification.
  See the history of DomainHandler.php if you need to find out something 
  about the history of the functions listed above.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1254 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7a236d401c DomainHandler.php:
- rename $this->username to $this->id
- rename function validate_id() to validate_new_id()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1253 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7ac37cfbff templates/editform.tpl:
- new file
- generic edit form template that uses $struct to render the form

templates/admin_edit-domain.tpl:
- deleted, obsoleted by editform.tpl

create-domain.php
- use new editform.tpl
- use $errormsg array instead of join't $errortext
- store/move errors related to a display_in_form field in $fielderror
  (they will be displayed next to the field)
- display remaining error messages (not related to a field) with 
  flash_error()
- use "value_$key" instead of "t$Key" as smarty variable name for field 
  values

model/DomainHandler.php
- store error messages in $this->errormsg[$field] (instead of $this->errormsg[])
- fix label for default_aliases

model/PFAHandler.php:
- store error messages in $this->errormsg[$field] (instead of $this->errormsg[])



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1252 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5ba826b067 create-domain.php, templates/admin_edit-domain.tpl:
- move some logic to select the correct labels to create-domain.php



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1251 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 102d4c8c32 DomainHandler.php:
- whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1250 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz eac2564c40 DomainHandler.php:
- initStruct(): fix alias_count ("something - NULL" is always NULL, now 
  enforces integer 0 for each JOINt in field with NULL value)
- set() now checks if $this->_field_$fieldname exists and calls it as
  additional validator
- split store() into store() (stores $this->values in the database) and
  storemore() (stores additional things and/or calls scripts)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1249 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz eba59ffd73 functions.inc.php:
- get_domain_properties(): use DomainHandler (function result mostly 
  unchanged, only difference: instead of quota_sum in bytes it now
  returns total_quota in MB)
- allowed_quota(): adopt to slightly changed return value of
  get_domain_properties()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1248 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a03a020095 MailboxHandler.php:
- delete(): use escaped $E_domain instead of $domain in some queries


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1247 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ab050cb340 list-virtual.php:
- display everything by default, not only mailboxes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1246 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 55cf795c81 ru.lang:
- translation update by Pavel Usischev (pusischev@SF),
  https://sourceforge.net/tracker/?func=detail&aid=3428382&group_id=191583&atid=937966


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1245 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a8e626fe7f functions.inc.php:
- pacol(): new parameter $dont_write_to_db - needed to skip JOINt in 
  columns which (of course) aren't available on INSERT or UPDATE

model/DomainHandler.php:
- initStruct(): mark JOINt in columns with the dont_write_to_db flag
- store(): skip columns with the dont_write_to_db flag set (not_in_db
  columns are also/still skipped)

In non-technical terms: create-domain works now :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1244 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 46c7455a12 en.lang:
- changed pVacation_result_removed from 'Auto response for %s has been 
  removed!' to '... has been disabled!'

*.lang:
- add %s in pVacation_result_removed and pVacation_result (+ translator note)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1243 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a1dba20aff model/DomainHandler:
- read_from_db(): provide a working $colformat['ts'] for postgresql
  _and_ mysql (the only mysql/pgsql-specific code in DomainHandler,
  everything else works with both)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1242 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 3c880aa0c6 if we are going to write out an sql error message we might as well include the full query
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1241 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 5a18a1e48b postgresql fixes for DomainHandler perhaps
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1240 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin ecf7757981 Remove getInstance calls; not needed as we use ::write
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1239 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 25675e9377 use isset to check existance of a variable
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1238 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 89f66053a9 fix undefined var check before login - sessid is not set etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1237 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 563e401c92 make Config.php a php5 compatible object; remove strict standards warnings
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1236 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 72441d7dd6 create-domain.php:
- assign smarty values only for fields that have the display_in_form flag

model/DomainHandler.php:
- initStruct(): make default_aliases display_in_form dependant on $this->new
  (it's useless in edit mode)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1235 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7b15c4b47d functions.inc.php:
- pacol(): use Lang::read instead of global $PALANG (which is undefined
  when called from a *Handler class)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1234 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 40dfc881c2 es.lang:
- updated translation for pCreate_mailbox_mail

Patch by Jordi Llonch (llonchj@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3427631&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1233 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a1fdd87360 MailboxHandler.php:
- add comment about forcing $CONF['domain_in_mailbox] = YES if 
  $CONF['domain_path'] == NO. 
  
Without this comment, the code might look buggy - confirmed ;-) in
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3427498&group_id=191583



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1232 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3a419a3246 list-domain.php:
- use DomainHander->getList()
  - line count: 126 -> 85 = 41 less :-)
- preselect correct username in admin dropdown



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1231 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7f9d947e8f model/DomainHandler.php:
- use a new SELECT query syntax (sub-SELECTs) that gets all needed
  information (including alias count, mailbox count and total quota)
  in one query and is fast as light.
  Better don't ask how long it took me to write this query, and I
  seriously hope it works with postgresql. Otherwise...!
- add alias_count, mailbox_count and total_quota (including the required
  SQL magic) to $struct
- add support for funny[tm] query tricks in $struct:
  - replacement for field name in SELECT statement
  - additional SQL after the FROM xy clause - useful for JOINs
- new function getList($condition) to get a list of domains
- order SELECT results by $this->id_field (needed for getList)
- add comment about the values used in $struct[*][type]

functions.inc.php:
- add two more optional parameters to pacrypt(): $select and $extrafrom

scripts/shells/domain.php:
- display number of existing aliases and mailboxes
- display quota sum



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1230 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 532712303a model/DomainHandler.php:
- split view() into 
  - read_from_db (with param $condition, can also be used with other 
    conditions than "domain = $this->username")
  - view() - fetches one row
  (as preparation before implementing a function to list all domains)
- read_from_db():
  - replace $bool_fields with $colformat['bool'] - now the database
    results for bool fields are always 0/1 (by using CASE in the query),
    and have an additional _$field with yes/no
  - resultset is now an array of rows (instead of a single row)
  - use db_assoc() instead of db_array()
- view(): use read_from_db()
- store(): change a comment that confused vim autofolding



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1229 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 429ef27031 functions.inc.php:
- new function db_where_clause($condition, $struct) to create a WHERE clause.
  bool values are converted with db_get_boolean() based on $struct

model/DomainHandler.php - view():
- build WHERE clause with db_where_clause()
- new array $colformat for columns which need special handling in the field list
  (that's more readable than tons of elseif on the long term, and allows easier
  customization (hook/$CONF value?))



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1228 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7ed7c67fbe functions.inc.php - smtp_mail():
- error_log() the error message if fsockopen() fails


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1227 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 2f52a8402d edit-domain.php:
- deleted (obsoleted by create-domain.php)

create-domain.php:
- fixed wrong variable name that broke saving an edited domain

configs/menu.conf, templates/adminlistdomain.tpl
- changed to use create-domain.php?edit= instead of edit-domain?domain=



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1226 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 24836cf3ad Add edit mode to create-domain.php
create-domain.php:
- add edit mode (use ?edit=example.com)
- use $id_field instead of hardcoded 'domain'
- redirect to list-domain after saving in edit mode
- rename some variables

edit-domain.php:
- rename some smarty variables

templates/admin_edit-domain.tpl:
- rename some smarty variables
- add two hidden fields "edit" and "domain", both contain $tDomain
  (only in edit mode)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1225 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7a237c98f4 DomainHandler:
- new function getId_field()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1224 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz c87a0b97f4 DomainHandler.php:
- store() can now handle INSERT and UPDATE (depending on $this->new) :-)
- store some texts in $this->msg[] (replaced several $this->variable)
  to make functions easier reuseable
- new function initMsg to fill $this->msg[] (can depend on $this->new)
- convert values to a DB-understandable format in store(), not in set()
  (affects only bool for now, another candidate is pacrypt()ing passwords)
- check if all fields are set (on new)
- unset all not_in_db fields in $db_values in foreach loop



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1223 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 53d720a569 functions.inc.php:
- db_get_boolean(): allow 0 and 1 as parameters, not only boolean true/false


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1222 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7fd57740cd create-domain.php:
- assign $values to smarty in a foreach loop

edit-domain.php, templates/admin_edit-domain.tpl:
- rename some smarty variables to match column name


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1221 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 95bf0161c6 Make create-domain.php even shorter (109 -> 89 lines) ;-)
create-domain.php
- replace old $form_fields with $handler->getStruct()
- rewrite handling POST data to make it easier to understand
  - move reading POST input to the section handling POST
  - remove condition on POST (we are in the POST block now)
  - check if editing of a field is allowed (use default value if not)
- move validation of 'enum' fields to PFAHandler
- allow changing the "active" state (instead of hardcoding it)

model/PFAHandler.php:
- add check for 'enum' fields

model/DomainHandler.php:
- change default for "active" and "default_aliases" to 1

templates/admin_edit-domain.tpl:
- don't hide the "Active" checkbox on new


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1220 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f8fb724dcf model/DomainHandler.php:
- split __construct to
  - __construct($new=0) - init $struct etc.   and
  - init($username) - validate $username
  This allows reading of $struct before doing any check on the username,
  and will also avoid problems when I implement a function to list all
  domains
- init(): use direct return values instead of $this->return

scripts/shells/domain.php, create-domain.php
- update to use new DomainHandler->init()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1219 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5c5c79e8a9 Make create-domain.php shorter (164 -> 109 lines) ;-)
create-domain.php:
- rename "fField" form fields to just "field" to match the column names 
  in the database
- remove list of template and POST variables in the header - the code is
  self-documenting on this, one useless comment block less to maintain ;-)
- rename $default to $field - matches the usage better
- use $values[$key] instead $$key (this also avoids the need to fill
  $values before calling $handler->set)
- remove some validation that is already done in DomainHandler
- use $handler->set even if creating $handler results in an error to
  make error messages for all fields visible
- set $values to defaults at the end of the file if $error == 0 (and
  use a foreach loop) instead of doing it for GET at the beginning and
  again after successful POST
- remove some unused variables
- various other changes

edit-domain.php, templates/admin_edit-domain.tpl:
- rename "fField" form fields to just "field" to match the column names 
  in the database



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1218 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a11d8c3dda Sometimes short commit messages are the best ones - see the message
for create-domain.php...

create-domain.php:
- finally: use DomainHandler :-))

edit-domain.php, create-domain.php, 
templates/admin_edit-domain.tpl:
- use 0/1 instead of off/on for checkboxes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1217 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1aeae661af DomainHandler.php:
- new: public function getStruct()
- make store() public explicitely
- store domain_postcreation error message in $this->errormsg
- use existing error message instead of "invalid domain"



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1216 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 646c790371 common.php, scripts/postfixadmin-cli.php:
- init Lang and Config classes in common.php instead of postfixadmin-cli.php -
  they need to be available in the web interface also


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1215 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4611b111e3 common.php:
- merge with scripts/common.php
- don't start/use session in CLI mode
- don't load smarty.inc.php in CLI mode
- hardcode language to 'en' in CLI mode (was done in postfixadmin-cli.php before)

scripts/postfixadmin-cli.php - __bootstrap():
- use common.php instead of scripts/common.php
- don't load languages/language.php and languages/en.lang (already
  done via common.php)
- don't call language_hook (already done via common.php)

scripts/common.php:
- deleted
- dropped helper functions low(), up(), r() and pr() which were just
  shortnames for existing PHP functions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1214 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7bcd041d45 scripts/shells/*.php:
- use strtolower()/strtoupper() instead of low()/up() shortnames.
  This makes the code slightly longer, but easier to understand because
  strtolower()/strtoupper() are well-known function names



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1213 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1a4bd35e08 Move the classes "Config" and "Lang" to scripts/common.php to model/
Class Lang uses exactly the same code as Class Config - therefore
I replaced its code with a simple "extends Config".



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1212 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 23e6dee1b2 shells/domain.php:
- *Task / __handle(): check $handler->result after calling "new"
- AddTask / __handle():
  - don't set domain in $values - it's already included in the "new" call
  - hardcode "active" to 1 - before, it accidently got the value of "aliases"
  - use $handler->set() and $handler->store instead of $handler->add()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1211 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 78d15b084d DomainHandler.php:
- split add() function to 
  - set() (validate values) and 
  - store() (write to database)
- set():
  - replace $checked with $this->values
  - store validation summary in $this->values_valid

PFAHandler.php:
- change _inp_* functions to return true/false if value is (in)valid
  instead if the sanitized value. They now also set $this->errormsg[]
  (not the final solution, but works for now)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1210 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8ed7747a81 DomainHandler.php:
- view(): 
  - auto-generate field list based on $this->struct
  - use date_format() for timestamp fields in the sql query
  - convert bool fields to integer 0/1 (postgresql uses t/f internally)
    to make the result database independent
- enable "display in list" for "created" column to avoid error in 
  CLI view domain


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1209 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz da21a4cae2 functions.inc.php:
- new function db_boolean_to_int() to convert boolean values from the 
  database to integer (0 or 1)
- db_get_boolean(): error out on unknown $CONF[database_type]


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1208 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz bf2d5e0f4b DomainHandler.php:
- validate $username (domain name in this case) in __construct
  (using the new function validate_id)
- make initStruct protected (was private)
- additional parameter for view() to supress error messages



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1207 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e88a7afdc2 *.lang:
- new error message: 
  $PALANG['domain_does_not_exist'] = 'This domain does not exist!';


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1206 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7a9a993083 PFAHandler, AliasHandler:
- move result() from AliasHandler to PFAHandler
- AliasHandler now extends PFAHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1205 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 14c5433faf DomainHandler:
- use ' instead of " for $struct keys
- whitespace changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1204 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1e601ce4d4 DomainHandler.php:
various fixes, implemented some TODOs

- move table name into variable $this->db_table
- use correct config option to detect if quota support is enabled
- fix (virtual) column name for default aliases
- use type 'ts' (timestamp) for created and modified
- fill non-editable rows with defaults if $this->new
- read values from $values instead of safepost()
- unset $db_values['default_aliases'] before writing to database
- some other minor changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1203 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6becdbba4a *.lang:
- $PALANG['pCreate_mailbox_mail'] = 'Send welcome mail', but some 
  translations mean "create mailbox".
  Added a note for translators to update it.

Reported by Segeja in #postfixadmin


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1202 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8b636bd1ee create-mailbox:
- always display correct available quota (using allowed_quota())

Patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3421296&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1201 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ed7019ff5c MailboxHandler:
- whitespace changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1200 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8b3976272f list-virtual.php:
- delivery to mailbox with a recipient delimiter (mailbox+foo@domain)
  was marked as "forward only"

This fixes 
https://sourceforge.net/tracker/?func=detail&aid=3420440&group_id=191583&atid=937964
reported by <stderr1> on #postfixadmin


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1198 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 88a840690b create-mailbox.php:
- use smtp_get_admin_email() instead of the admin's username as sender
  for the welcome mail

This fixes 
http://sourceforge.net/tracker/?func=detail&aid=2958684&group_id=191583&atid=937964
reported by mrfrenzy on IRC


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1197 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3589514932 list-virtual.php:
- better error message if no domains exist or a domain admin doesn't
  have permissions for any domain. That's less confusing than the
  "Invalid parameter" message

*.lang:
- new (error) messages
  - $PALANG['no_domains_for_this_admin']
  - $PALANG['no_domains_exist']
 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1195 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 83ec3e0cab create-mailbox.php:
- check password with validate_password
- cleanup password validation
- cleanup/merge duplicate assignment of $t* variables

This fixes the remaining 50% of
https://sourceforge.net/tracker/?func=detail&aid=1951979&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1194 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d6d4fb4748 functions.inc.php - create_admin()
- check password with validate_password()
- cleanup the handling of the success message

This fixes 50% of
https://sourceforge.net/tracker/?func=detail&aid=1951979&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1193 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 69b3df10e4 config.inc.php
- new config option $CONF['password_validation'] - array with regular
  expressions to check if a password is valid/good enough.
  The default configuration enforces:
  - minimum length 5 characters/digits/whatever
  - at least 2 characters
  - at least 2 digits
- removed $CONF['min_password_length'] - it's now handled in /.{5}/ in
  $CONF['password_validation']

functions.inc.php
- new function validate_password to check a given password against
  $CONF['password_validation']
- generate_password: generated password is always 8 chars long
  (instead of $CONF['min_password_length'])

edit-admin.php, users/password.php, edit-mailbox.php, setup.php:
- use validate_password instead of $CONF['min_password_length']

This implements
https://sourceforge.net/tracker/?func=detail&aid=1785513&group_id=191583&atid=937967


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1192 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e38ba1f7cf users/password.php, edit-admin.php, edit-mailbox.php, *.lang:
- rename $PALANG['pPasswordTooShort'] to $PALANG['password_too_short']

*.lang:
- add $PALANG['password_no_characters'] and $PALANG['password_no_digits']
  (will be used by my next commit)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1191 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 9f2a0db106 create_admin() cleanup
functions.inc.php:
- create_admin(): use db_insert instead of INSERT queries
  (this includes automatic escaping of all values)

create-admin.php:
- use safepost instead of isset($_POST[...])
- don't escape_string post values - it's done inside create_admin now
- remove superfluous emptying of empty $tDomains for GET
- allow htmlentities-escaping for pAdminCreate_admin_username_text
- some whitespace / linebreak changes

setup.php:
- load config.inc.php only once (loading it twice will break if custom
  hook functions exist in config.*.php - "can't redefine function ...")
- use safepost instead of isset($_POST[...])
- don't escape_string post values - it's done inside create_admin now
- escape $tUsername with htmlentities() instead of escape_string



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1190 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz dc54de1657 smarty.inc.php - select_options():
- escape $val with htmlentities() (function result will/must be used
  unescaped later)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1189 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz bd4889a7c2 functions.inc.php - check_email():
- replace $CONF[vacation_domain] only at the end of the mail address


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1188 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 9d1f79c495 create-admin.php:
- fix SQL injection (only exploitable by superadmins)

Reported by Matthias Bethke (msbethke@SF),
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3412484&group_id=191583

Note: this fix is (intentionally) different from the fix in the 2.3 branch
and includes a TODO note for some bigger changes that we should do.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1186 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8f805af202 de.lang:
- fix typo


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1182 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 536b7ac688 config.inc.php:
- several comments for the language_hook function:
  - x_* naming policy for custom texts
  - note that custom texts must appear in all blocks
  - note that translation fixes should be reported in the bugtracker


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1177 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a5f3cb9b96 config.inc.php:
- new config option $CONF['language_hook']
  Hook function to override or add translations to $PALANG.
  Example hook function included (commented out).

common.php:
- honor $CONF['language_hook']

scripts/postfixadmin-cli.php:
- honor $CONF['language_hook']
- add TODO - language shouldn't be hardcoded to english

This implements my feature request at
http://sourceforge.net/tracker/?func=detail&aid=3292408&group_id=191583&atid=937967


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1176 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1033c950fa vacation.php:
- split off $fDomain from ?username= (admin mode)
- basic sanity check for ?username= (admin mode)
- urlencode $fDomain for $Return_url (admin mode)
- don't split off domain from username in users mode (not needed)
- added various TODO notes
- some whitespace fixes near the end of the file (2*3 lines)

list-virtual_mailbox.tpl
- don't include domain in link to vacation.php (no longer needed)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1172 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0403a0a55a functions.inc.php - check_owner():
- escape_string() $username and $domain to prevent SQL injections
- add a TODO


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1171 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 15fe167948 *.lang:
- marked several texts as obsolete:
  - pUsersVacation_button_away
  - pUsersVacation_button_back
  - pUsersVacation_result_error
  - pUsersVacation_result_success
  - pUsersVacation_activefrom
  - pUsersVacation_activeuntil

This is based on a patch by jan-kruis,
https://sourceforge.net/tracker/?func=detail&aid=3383236&group_id=191583&atid=937966
(to be exact: the remaining parts of his patch)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1170 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 9bee8d89c1 Merge users/vacation.php and edit-vacation.php into vacation.php
vacation.php
- result of merging edit-vacation.php and users/vacation.php
- vacation.php comes with the svn history of edit-vacation.php
- display "vacation already active" (only) in user mode if vacation is active
  (would be useful in admin mode too, but needs a text change)
- various comment updates
- add username in $PALANG[pVacation_result_removed] and
  $PALANG[pVacation_result_added] using sprintf
- change compared to Jan Kruis' patch:
  - set return url for users to main.php instead of users/main.php
  - set return url for admins after setting $fDomain. Otherwise the return url
    does not contain the domain.
  - removed unused variable $tDomain

users/vacation.php:
- require(../vacation.php)
- remove everything else
- whitespace changes in the license header
- note: this is completely different from Jan Kruis' patch - his intention was
  to remove this file and use ../vacation.php. However, with his way all links
  in the users menu would point to the wrong place/directory

edit-vacation.php:
- deleted

templates/vacation.tpl
- display username only in admin mode

templates/list-virtual_mailbox.tpl
- link changed to merged vacation.php

languages/en.lang
- add username in $PALANG[pVacation_result_removed] and
  $PALANG[pVacation_result_added] as sprintf variable
- (comments added by Jan Kruis' patch are not part of this commit)

languages/nl.lang
- translation updates
- already contains the sprintf variable in $PALANG[pVacation_result_removed]
  and $PALANG[pVacation_result_added]

(updates for other *.lang files follow in another commit)

The following parts of Jan Kruis' patch are not part of this commit:
- rejected:
  - variables.inc.php: don't add $Admin_role and $Return_url
    If we initialize them, it should be done directly in (edit-)vacation.php,
    but the current code always sets them already in all cases.
  - templates/users_main.tpl: do not change url for vacation.php
- postponed:
  - added comments in en.lang about obsolete texts


Most parts of this commit (see exceptions above) were provided as patch 
by Jan Kruis (jan-kruis@SF), see
https://sourceforge.net/tracker/?func=detail&aid=3383236&group_id=191583&atid=937966



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1169 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Valkum dbf7d1aa74 added quota level percentage display
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1168 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ce747878a2 create-alias.php:
- display correct error message if alias is invalid

Patch by J.Kruis (jan-kruis@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3387375&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1167 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz c471efcda1 Paperwork ;-)
Changelog update with all changes between 2.3.x and trunk.
Also includes several TODO notes.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1166 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz cd260cbba7 css/default.css:
- removed superfluous white background in some elements (body already 
  has white background)

images/mail_bg.gif:
- made background transparent instead of white


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1164 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1695f1a7b2 Merged edit-vacation.tpl and users_vacation.tpl.
Prepare merging of edit-vacation.php and users/vacation.php

users/vacation.php, edit-vacation.php:
- first step of merging
- renamed some variables to fit vacation.tpl
- some code sorting and cleanup
- replaced JS redirect on cancel with handling in PHP

users_vacation.tpl, edit-vacation.tpl:
- deleted (merged to vacation.tpl)

vacation.tpl:
- new file, result of merging edit-vacation.tpl and users_vacation.tpl
- display mail address to users also (to be discussed)

Thanks to J.Kruis (jan-kruis@SF) for the patch,
https://sourceforge.net/tracker/?func=detail&aid=3383236&group_id=191583&atid=937966


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1163 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3ff680d3a6 nl.lang:
- translation update by J.Kruis (jan-kruis@SF)
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3383236&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1162 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 93dd4517f1 ADDITIONS/delete-mailq-by-domain.pl,
ADDITIONS/squirrelmail-plugin/**/postfixadmin.po:
- whitespace fix: replace DOS line ends with Linux line ends
  (no other changes)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1160 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b9798456f3 import_users_from_csv.py:
- update FSF address (the openSUSE build check complained ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1158 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3556e4bfda SUPERADMIN.txt:
- replace SQL instructions to create a superadmin with a note about setup.php

SECURITY.txt:
- add a note about permissions needed by setup.php
- add note about templates_c directory


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1157 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0656852d4e functions.inc.php:
- new function allowed_quota to get the allowed maximum quota for a mailbox.
  Based on a patch by wvolz (wvolz@SF), but with several enhancements/changes.
  https://sourceforge.net/tracker/index.php?func=detail&aid=2856577&group_id=191583&atid=937966
- added a TODO note

edit-mailbox.php:
- get maximum allowed quota via allowed_quota() instead of just using
  the maxquota of the domain


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1156 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 58815ccd7d create-mailbox:
- switch to edit-mailbox template (I forgot this in r1154)
- added some TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1155 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 57d25d3d41 Merge edit-mailbox.tpl and edit-mailbox.tpl:
edit-mailbox.tpl:
- merged with create-mailbox.tpl
- added various {if $mode = ...}
- use $PALANG.pCreate_mailbox_password (text: "Password") instead of
  $PALANG.pEdit_mailbox_password text (text: "New password") for edit mode

create-mailbox.tpl:
- deleted

edit-mailbox.php:
- add smarty mode = edit variable

create-mailbox.php
- add smarty mode = create variable

*.lang:
- marked pEdit_mailbox_password and pEdit_mailbox_password2 as obsolete


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1154 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e5c68e2450 Merge edit-alias.tpl and create-alias.tpl
edit-alias.tpl:
- merge with create-alias.tpl
- added various {if $mode = ...}
- for edit mode: used "multiple targets" help text right of textarea
  (instead of having it under the headline)
- use $fGoto instead of array in textarea

create-alias.tpl
- deleted

edit-alias.php:
- fixed $tGoto to contain unmodified $_POST value on error
- dropped $array smarty variable that was used instead of $tGoto
- added mode = edit smarty variable
- add empty pCreate_alias_address_text_error smarty variable to avoid
  "undefined" warning

create-alias.php:
- added mode = create smarty variable
- switched to edit-alias template

*.lang
- marked $PALANG['pCreate_alias_address'] as obsolete


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1153 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6c35590eb7 Merge admin_edit-domain.tpl and admin_create-domain.tpl
admin_edit-domain.tpl:
- merged with admin_create-domain.tpl
- added various {if $mode = ...}
- added 4th column for error messages

admin_create-domain.tpl:
- deleted

edit-domain.php:
- added mode = edit smarty variable
- added pAdminCreate_domain_domain_text_error smarty variable to avoid
  "undefined variable" warning

create-domain.php
- added mode = create smarty variable
- switch to admin_edit-domain template


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1152 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0fe45bca8a Merge admin_edit-admin.tpl and admin_create-admin.tpl
create-admin.php
- switch to edit-admin template
- rename a smarty variable
- add smarty mode = create variable

edit-admin.php:
- rename a smarty variable
- add smarty mode = edit variable

admin_edit-admin.tpl:
- merge with admin_create-admin.tpl
- add some {if $mode == '...'} switches 
- change <form> name to "admin"
- rename a smarty variable

admin_create-admin.tpl:
- deleted

*.lang:
- mark some $PALANG texts as obsolete:
  - $PALANG['pAdminCreate_admin_username']
  - $PALANG['pAdminCreate_admin_password'
  - $PALANG['pAdminCreate_admin_password2']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1151 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b26012ca18 users/edit-alias.php:
- fix undefined smarty variables


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1150 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8f2a3f00ad admin_create-domain.tpl:
- replaced lots of PALANG[pAdminCreate_*] with PALANG[pAdminEdit_*]
- this will make merging with the edit-domain template easier

*.lang
- marked several $PALANG variables as obsolete:
  - pAdminCreate_domain_domain
  - pAdminCreate_domain_description
  - pAdminCreate_domain_aliases
  - pAdminCreate_domain_aliases_text
  - pAdminCreate_domain_mailboxes
  - pAdminCreate_domain_mailboxes_text
  - pAdminCreate_domain_maxquota
  - pAdminCreate_domain_maxquota_text
  - pAdminCreate_domain_transport
  - pAdminCreate_domain_transport_text
  - pAdminCreate_domain_backupmx
- added some "please check" translator notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1149 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6af24d6e80 language-update.sh:
- better readable output for --comparetext


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1148 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a81f3d6506 edit-mailbox.php, edit-mailbox.tpl:
- fixed undefined variables


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1147 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 94dbfa2bb4 Mostly merge edit-mailbox.tpl and create-mailbox.tpl
edit-mailbox.php
- report password errors next to the password field instead of flash_error()
- small changes to smarty variables

create-mailbox.php:
- small changes to smarty variables

edit-mailbox.tpl, create-mailbox.tpl:
- merge as good as possible (everything that is still left will probably
  need an {if}
- renamed some smarty variables
- use colspan=3 for buttons

*.lang:
- mark pCreate_mailbox_username, pCreate_mailbox_name, pCreate_mailbox_quota,
  pCreate_mailbox_quota_text and pEdit_mailbox_name_text as obsolete
- added some "please check" notes for translators



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1146 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d09ae9e360 model/DomainHandler.php:
- integrate $defaults in $struct to have everything in one place
- integrate field labels, descriptions etc. in $struct
- $struct now has named keys and is filled with the new pacal() helper function
- replaced TODO comments with new ones ;-)

functions.inc.php:
- new function pacol() to fill $struct with an associative array


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1145 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d01bf7d0c4 scripts/shells/alias.php:
- fixed help() output


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1144 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0a2f73e51a password.tpl:
- removed a superfluous </td>


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1143 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3dcd56c77a Replaced motd*.txt with $CONF[motd_*] options
config.inc.php:
- new config options $CONF['motd_user'], $CONF['motd_admin'] and
  $CONF['motd_superadmin']

templates/index.tpl:
- added $CONF[motd_*] handling

css/default.css:
- new style #motd

templates/users_menu.tpl, templates/menu.tpl:
- removed inclusion of motd-users.txt / $motd_file

smarty.inc.php:
- removed handling for motd*.txt files

templates/motd-users.txt, templates/motd.txt:
- deleted


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1142 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 99382f1318 configs/menu.conf:
- remove discarded _txt_* entries


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1141 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ab636c92e5 Merge password.tpl and users_password.tpl
users/password.php:
- use SESSID_USERNAME instead of USERID_USERNAME to match the smarty
  variable name in the password module for admins
- switch to 'password' template
 
templates/password.tpl:
- display "exit" button if logged in as user
- change form name to something more useful

templates/users_password.tpl:
- deleted


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1140 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 656b0b0897 index.tpl:
- use $authentication_has_role instead of checking if $smarty_template
  contains "users_". This makes the code cleaner and avoids problems
  when merging templates to names without "users_".
- check for login template without using needle - that's possible after
  merging the login and users_login template to login.tpl


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1139 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 80389ec0e3 language-update.sh:
- new parameter --comparetext to compare two texts in $PALANG.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1138 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b065366a91 Merge template for admin login and user login
login.php, users/login.php:
- set logintype=admin/user smarty variable
- cleanup: move smarty assignments outside of GET/POST handling - it's
  the same for both

users/login.php:
- do not pre-fill username on failed login

templates/login.tpl:
- merge in users_login.tpl
- add some {if} to handle the differences between admin and user login

templates/users_login.tpl:
- deleted

*.lang:
- mark pUsersLogin_username, pUsersLogin_password, pUsersLogin_language 
  and pUsersLogin_button as obsolete
- add some notes if pLogin_* and pUsersLogin differ


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1137 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e5b09bb805 edit-vacation.php:
- remove unused variables $vacation_domain and $vacation_goto


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1136 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 27caea6ca8 create-domain.php:
- default aliases were always created, even when unchecking the checkbox
  (to be exact: after my last commit yesterday, they were never created)
  This bug was introduced in r867 (setting the default to "on") in
  combination with isset() falling back to the default value. For an
  unchecked checkbox, this means that it always used the default fallback
  which was "on" since r867.
  (Does _not_ affect the 2.3 branch.)
- replaced two <br> with a TODO ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1135 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 93676dd7fc variables.inc.php:
- moved some variables from variables.inc.php to the (only) file that
  uses them
- removed unused $escaped_string

create-domain.php
- target for $fDefaultaliases and $tDefaultaliases

list-virtual.php
- target for $tDisplay_back, $tDisplay_back_show, $tDisplay_up_show,
  $tDisplay_next, $tDisplay_next_show


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1134 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e4c76696de edit-mailbox.php, edit-mailbox.tpl, variables.inc.php
- removed always empty variable $pEdit_mailbox_password_text
- replaced "static" variable $pEdit_mailbox_quota_text with its
  PALANG content in the template


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1133 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1479fd9e65 create-mailbox.php, variables.inc.php, create-mailbox.tpl
- removed always empty variable $pCreate_mailbox_username_text
- replaced "static" variables $pCreate_mailbox_password_text and
  $pCreate_mailbox_quota_text with their PALANG content in the template


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1132 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a7664eb548 login.php:
- remove outdated comment


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1131 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b2d953071c upgrade.php:
- add hint about ?debug=1


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1130 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 032a795795 templates/edit-vacation.tpl, templates/users_vacation.tpl:
- replaced hardcoded background-color with class=readonly

css/default.css:
- new style .readonly for vacation start/end input fields


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1129 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 814b89baf3 list-domain.php:
- only put current username in dropdown for domain admins
  (instead of a list of domains, which didn't work at this place and
  was different to the superadmin behaviour)

The issue was reported before by Dale in
https://sourceforge.net/tracker/?func=detail&aid=3305307&group_id=191583&atid=937964
Nice to see that he fixed one of his bugreports himself ;-)

And *drum roll* it is also the _last part_ of Dale's huge cleanup patch :-)
and the last time you'll see the following footer in a commit message:

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1128 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz c4fd99baa7 MailboxHandler.php:
- use smtp_get_admin_email() to get the sender for the welcome mail
- add a check for empty (shouldn't happen in theory) or 'CLI' username
  and use the mailbox address as fallback

This is based on Dale's patch, but completely rewritten (what a big word
for two lines of code ;-)  Dale had only added the line
 if(empty($fFrom)) $fFrom = $this->username;

My version is tested with CLI with both $CONF[admin_email] set and empty.

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1127 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0e33c90fa1 message.tpl:
- remove $tMessage - it is no longer used/filled anywhere
- replaced with a TODO note that message.tpl usage and the file itsself
  has to be removed (not part of Dale's patch)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1126 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 198bab0057 default.css:
- move menu to left (instead of centered)
- move edit forms to 50px from left instead of centered
- various cleanup

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1125 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7fee8f760a ja.lang:
- translation update

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


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1124 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 744872191f de.lang:
- small text change in pCreate_mailbox_password_text_error


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1123 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 32bb589bb6 default.css:
- redesign login form - now has an image on the right
- change width from 730px to 990px
- change menu :hover background color from green to dark grey
- change button :hover background color from green to light grey
- change table row :hover color in list mode from green to light grey
- add padding to input fields
- remove background color and border in edit form header
- remove border-left from list-virtual submenu (show all / mailboxes / ...)
- change main.php :hover from green left + bottom border to dark grey and
  only left border
- removed green background in overview row (the line containing the search box)
- removed table borders (list and edit mode)
- add text-align:right for edit form labels
- some whitespace fixes

images/mail_bg.gif:
- [new file] the image in the login form

This commit is based on Dale's patch, but some styles were moved around
in the CSS file (to keep the diff of this commit somehow readable).
Some of Dale's changes are not yet included in this commit.

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1122 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ee5c1cc239 create-alias.tpl:
- add "multiple targets" help text


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1121 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5c39718251 *.lang:
- removed <span> in comment / translation note for 
  $PALANG['pSendmail_result_error']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1120 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ce7b0d5ff5 *.lang
- removed remaining <br /> in
  - $PALANG['pPassword_password_text_error']
  - $PALANG['pAdminCreate_admin_password_text_error']
  - $PALANG['pAdminEdit_admin_password_text_error']
  - $PALANG['pCreate_alias_catchall_text']
  - $PALANG['pCreate_mailbox_password_text_error']
  - (and some other texts not listed here, but only in one or two languages)
- differences to Dale's patch:
  - use a space as replacement for <br /> (instead of nothing)
  - added a note that the translation needs to be be beautified to most languages
    (except en and de, which are already ok)
  - do not change "MB" -> "in MB" in $PALANG['pAdminCreate_domain_maxquota_text']
    and PALANG['pAdminEdit_domain_maxquota_text']

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1119 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a0aa16f6b7 *.lang:
- some $PALANG texts contained field description and error message in
  one $PALANG text. Removed the field descriptions so that the text only
  contains the error message.
- affected texts:
  - $PALANG['pCreate_alias_goto_text_error']
  - $PALANG['pCreate_mailbox_password_text_error']
  - $PALANG['pAdminCreate_admin_username_text_error1']
  - $PALANG['pAdminCreate_admin_username_text_error2']
- difference to Dale's patch:
  - removed the field description in all *.lang files instead of only
    removing the <br />. I just did this manually.
    (changes in en.lang were part of Dale's patch)
  - added a "# check" in some languages where I'm not sure if I removed
    the correct part (if the first half of the text differed from the
    field description in another $PALANG text)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1118 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1476d3e420 *.lang:
- added $PALANG['pUsersLogin_language']
- difference to Dale's patch:
  - NOT added $PALANG['pCreate_alias_help'] to avoid text duplication.
    We can use the existing $PALANG['pEdit_alias_help'] instead.

en.lang:
- fixed typo in $PALANG['pCreate_mailbox_quota_text_error']
- fixed typo in $PALANG['pBroadcast_error_empty'] - this also affects
  not yet translated texts in some *.lang

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1117 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4671b7c081 *.lang:
- removed all <span> tags
- removed several <br> tags
- marked the following stings as obsolete:
  - pDelete_postdelete_error
  - pDelete_domain_alias_error
  - pEdit_alias_address_error
  - pEdit_alias_domain_error
  - pEdit_mailbox_username_error
  - pPassword_admin_text_error

Note: This commit does not contain all *.lang changes from Dale's patch.
There are some interesting[tm] changes left to check/fix.

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1116 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz cd894a7835 list-virtual.tpl:
- change <h3> to <th>

list-virtual_alias_domain.tpl
- style "create new" link as button

These changes were forgotten by Dale :-P


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1115 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 043fd5520d list-virtual.tpl:
- replace & with &amp; in links
- replaced <h3> with <th>
- style "create new" links as button

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1114 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 767faf95b2 menu.tpl, users_menu.tpl:
- add class="logout" to logout menu item to allow special styling

menu.tpl:
- remove <br clear=all>

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1113 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3de3aaefff adminlistadmin.tpl, adminlistdomain.tpl:
- style "create new" links as button

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1112 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 2991a1334f fetchmail.tpl:
- change <h3> to <th>
- style "new fetchmail entry" link as button
- changes compared to Dale's patch:
  - do not change colspan +2 to +4 in <th>
  - use colspan=2 instead of 4 in empty cell of <th>
  (both changes were wrong and don't match the table body)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1111 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4d33437cd2 variables.inc.php,
admin_edit-domain.tpl, create-alias-domain.tpl, edit-alias.tpl, 
edit-vacation.tpl, password.tpl:
- remove now unused $tMessage
  (the change in variables.inc.php was not contained in Dale's patch)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1110 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz dc782512a3 overview-get.tpl, viewlog.tpl:
- changed <h3> to <th>

overview-get.tpl:
- removed class="flat" from domain dropdown

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1109 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4f24737f74 fetchmail.php:
- changes to embedded HTML (for the new/edit form):
  - replaced <h3> with <th>
  - marked labels with <label>
  - aligned buttons to input fields
  - removed lots of hardcoded style=

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1108 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7203639886 create-mailbox.php:
- renamed $pCreate_mailbox_*_text to $pCreate_mailbox_*_text_error
- replaced $tMessage with flash_error() / flash_info()

templates/create-mailbox.tpl:
- added 4th column for error messaegs
- replaced <h3> with <th>
- marked lables with <label>
- aligned button with input fields
- removed tMessage

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1107 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d660270ef9 functions.inc.php
- changed array item name in comment for create_admin()

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1106 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 99dce81fa3 create-alias.php:
- fixed syntax error introduced in the last revision
- removed $pCreate_alias_goto_text and $pCreate_alias_address_text
  (replaced by PALANG texts in the template)

templates/create-alias.tpl:
- removed colspan to allow helptext in "alias" row
- moved PALANG.pCreate_alias_catchall_text to alias row
- removed pCreate_alias_address_text (always empty)
- replaced PALANG.pCreate_alias_help (empty) with PALANG.pCreate_alias_goto_text
- some whitespace fixes

variables.inc.php
- removed now unused $pCreate_alias_address_text and $pCreate_alias_goto_text

(These changes are _not_ part of Dale's patch ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1105 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1467a959ed create-alias.php:
- renamed $pCreate_alias_address_text to $pCreate_alias_address_text_error
- replaced $tMessage with flash_error() / flash_info()
- changes compared to Dale's patch:
  - do not add $fAddress and $fGoto to $PALANG['pCreate_alias_goto_text_error']
    error message

templates/create-alias.tpl:
- added 4th column for error messages
- replace <h3> with <th>
- mark labels with <label>
- aligned button with input fields
- added $PALANG[pCreate_alias_help]
- removed tMessage

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1104 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0bc0c29a77 functions.inc.php:
- create_admin():
  - renamed some internal variables
  - removed a variable setting that was always overwritten in the next line
  - disabled setting a var to $PALANG['pAdminCreate_admin_username_text']

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1103 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 12694a420f create-domain.php:
- renamed $pAdminCreate_domain_domain_text to $pAdminCreate_domain_domain_text_error 
- replaced $tMessage with flash_error(), flash_info() and 
  $pAdminCreate_domain_domain_text_error 
- differences to Dale's patch:
  - removed now always empty smarty->assign for $pAdminCreate_domain_domain_text

templates/admin_create-domain.tpl:
- added 4th column for error messages
- marked labels as <label>
- aligned button to input fields
- removed tMessage
- differences to Dale's patch:
  - removed now unused $pAdminCreate_domain_domain_text

variables.inc.php:
- removed now unused $pAdminCreate_domain_domain_text
  (this was not part of Dale's patch)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1102 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5f4f20accf edit-mailbox.php:
- replace $tMessaeg with flash_error()
- use pEdit_mailbox_quota_text_error instead of pEdit_mailbox_quota_text
  for error message

templates/edit-mailbox.tpl:
- added 4th column for error messages
- replaced <h3> with <th>
- marked labels with <label>
- marked non-editable fields with <em>
- aligned buttons with input fields
- removed tMessage

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1101 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 54cec415ce variables.inc.php:
- removed some unused variables:
  - $pAdminCreate_domain_defaultaliases_text
  - $pCreate_mailbox_name_text
  - $pEdit_mailbox_username_text

(not related to Dale's patch ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1100 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 310d22bb6e create-admin.php
- renamed $pAdminCreate_admin_username_text to $pAdminCreate_admin_username_text_error
- renamed $pAdminCreate_admin_password_text to $pAdminCreate_admin_password_text_error
- replaced $tMessage with $infoMessage (displayed via flash_info)
- additional change compared to Dale's patch: removed unused variable 
  $pAdminCreate_admin_username_text

variables.inc.php:
- removed now unused variables $pAdminCreate_admin_password_text and
  $pAdminCreate_admin_username_text

templates/admin_create-admin.tpl:
- added 4th column for error messages
- replaced <h3> with <th>
- marked labels with <label>
- align button with input fields
- remove tMessage

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1099 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1786099b17 edit-admin.php:
- use additional column for error messages
- renamed $pAdminEdit_admin_password_text to $pAdminEdit_admin_password_text_error
- removed $tMessage

variables.inc.php:
- remove now unused $pAdminEdit_admin_password_text
  (this change was not contained in Dale's patch)

templates/admin_edit-admin.tpl
- added a 4th column for error messages
- HTML cleanup
- changed <h3> to <th>
- marked labels as <label>
- removed tMessage

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1098 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 484e7a74f0 smarty.inc.php:
- prefix $CONF['theme_custom_css'] with $CONF['postfix_admin_url']
  - difference to Dale's patch: only do this if $CONF[theme_custom_css]
    is not empty

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1097 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6e5deede3b edit-alias.tpl:
(forgot to include this one in r1095, same commit message)
- replaced <h3> with <th>
- marked labels with <label>
- marked non-editable fields with <em>
- align buttons with input fields
- note: removal of tMessage intentionally postponed

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1096 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b648510548 admin_edit-domain.tpl create-alias-domain.tpl, edit-vacation.tpl,
list-virtual_alias_domain.tpl, password.tpl:
- replaced <h3> with <th>
- marked labels with <label>
- marked non-editable fields with <em>
- align buttons with input fields
- note: removal of tMessage intentionally postponed

password.tpl:
- move error message formatting to template (language changes will follow
  in a later commit)
  - difference to Dale's patch: use <td class="error_msg"> instead of 
    <td><span class="error_msg">

edit-vacation.tpl:
- added language="JavaScript to <script> tags
- removed reference to calendar.css (now @import'ed in default.css)
- added class="flat" to activefrom and activeuntil input fields

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1095 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f0a153f0fc sendmail.php, broadcast-message.php:
- use smtp_get_admin_email() to determinate the mail sender
- rename $SESSID_USERNAME to $smtp_from_email
- replaced tMessage with flash_error() / flash_info()

sendmail.php:
- changes compared to Dale's patch:
  - use flash_info() for $PALANG['pSendmail_result_success']

broadcast-message.php:
- use flash_error() for $PALANG['pBroadcast_error_empty'] instead of
  hardcoding it in the template


sendmail.tpl,templates/broadcast-message.tpl:
- replace <h3> with <th>
- replaced $SESSID_USERNAME / $CONF[admin_email] with $smtp_from_email
- mark labels with <label>
- mark non-editable fields with <em>
- align buttons with input fields
- remove tMessage

sendmail.tpl:
- changes compared to Dale's patch:
  - fixed colspan for buttons cell

templates/broadcast-message.tpl:
- remove hardcoded error message (see broadcast-message.php change above)
- changes compared to Dale's patch:
  - fixed colspan for <th>

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1094 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 28cce0ca37 config.inc.php
- change default of $CONF['admin_email'] to '' and updated the comment.
  IMPORTANT: If set, this will be used as mail sender for all mails
  (2.3.x used the currently logged admin's username in most cases).
  $CONF['admin_email'] = '' will match the 2.3.x behaviour.

functions.inc.php:
- new function smtp_get_admin_email() to get mail sender address
  ($CONF[admin_email] or currently logged in admin if not set)
- changes compared to Dale's patch: 
  - added @return in comment
  - switched to /** comment style

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1093 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 75a9aabc70 config.inc.php:
- new config option $CONF['theme_custom_css']. This allows to add another
  CSS file that is loaded after $CONF['theme_css']. Useful if someone wants to
  do some small changes, but doesn't want to edit default.css
 
templates/header.tpl:
- include $CONF[theme_custom_css] if set

Changes compared to Dale's patch:
- $CONF['theme_custom_css'] is empty by default
- only include $CONF[theme_custom_css] if not empty

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1092 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8e9b423120 users_main.tpl:
- do not display username on main page. The user should know who he is ;-)
  and even if not, his name is displayed in the footer

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1091 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ce5f6ce559 users_edit-alias.tpl, users_password.tpl, users_vacation.tpl:
- replaced <h3> with <th>
- marked labels as <label>
- mark non-editable fields with <em>
- removed tMessage
- aligned buttons with input fields

users_password.tpl:
- put class=error_msg in template (will be removed from $PALANG strings)
  - change compared to Dale's patch: use <td class="error_msg"> instead of
    <td><span class="error_msg">

users_vacation.tpl:
- added class="flat" to fActiveFrom and fActiveUntil
- added language="JavaScript" to <script>
- removed reference to calendar.css (now included via default.css)

default.css
- added @import calendar.css

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1090 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 2b1f3e4102 login.tpl, users_login.tpl:
- changed <h4> to <th>
- mark labels with <label>
- added a label to the language selector
- removed tMessage

languages/*:
- added PALANG[pLogin_language]

changes compared to Dale's patch:
- users_login.tpl:
  - do not add the <div class="field_container"> ... </div> wraps
  - use PALANG[pLogin_language] instead of PALANG[pUsersLogin_language]
    to avoid a superfluous string/translation
- login.tpl:
  - removed wrong colspan for language selector and login button
- de.lang: added german translation for PALANG[pLogin_language]

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1089 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6e76fb2ac9 edit-vacation.php: whitespace changes
- converted DOS to UNIX line endings
- replaced some tabs with spaces
- removed spaces at the end of some lines


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1088 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3f46cdfc13 footer.tpl:
- swapped order of "update check" and "logged in as" to be more logical
  (we now have $version | update check | logged in as | $CONF['footer_text'])
- added a </div>

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1087 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 15401040ec edit-alias.php, edit-domain.php, edit-vacation.php,
create-alias-domain.php, password.php, viewlog.php:
- replaced tMessage with flash_error() / flash_info()

edit-alias.php:
- removed now superfluous code to merge multiple tMessage with <br>
- removed a </span> that was added after $PALANG['pEdit_alias_goto_text_error2']

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1086 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ceb24297c7 users/edit-alias.php, users/password.php, users/vacation.php, users/login.php:
- replaced tMessage with flash_error() / flash_info()

users/vacation.php:
- set today as default date if vacation start/end date are empty

users/edit-alias.php:
- removed now superfluous code to join multiple tMessage texts with <br>
- removed a </font> that was appended to $PALANG['pEdit_alias_goto_text_error2']

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1085 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 59dd7cb083 login.php:
- replaced tMessage with flash_error()

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1084 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f2ce6d24fe list-virtual.php
- removed superfluous reference to tMessage (not used anywhere)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1083 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 903e1f9369 list-admin.php
- removed superfluous smarty tMessage assignment ($tMessage is not used
  in list-admin)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1082 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b610c21baf edit-active-admin.php, edit-active-domain.php, edit-active.php
- replaced $tMessage with flash_error()

edit-active.php:
- removed a </font> added after $PALANG['pEdit_mailbox_domain_error']

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1081 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz cffa61c652 delete.php:
- rename $tMessage to $deletionMessage
- replace tMessage with flash_error

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1080 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz cc0a63ce3a backup.php:
- switch from tMessage to flash_error()
- style download link as button

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1079 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5fdb814ca4 setup.php:
- renamed $tMessage to $setupMessage

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1078 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 27ce979678 header.tpl, index.tpl, flash_error.tpl:
- move flash_error and flash_info output from header.tpl to separate 
  flash_error.tpl file
- some HTML whitespace fixing in header.tpl

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1077 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 058f46f1a5 users/vacation.php, edit-vacation.php, backup.php:
- supress warnings about PHP's date.timezone not set.

  The risk of doing this is low IMHO - the worst thing that can happen 
  is a wrong default date for vacation or a "wrong" tempfile name for
  backup.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1076 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 931a375255 VacationHandler:
- check_vacation() used outdated syntax $ah->get() which nowadays only
  returns true/false. Fixed to fetch $ah->result() and added at least
  basic error handling.
Indirectly ;-) reported by supa_user on IRC


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1075 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 8044cb9dc1 fix as per #3086890
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1073 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e7d230da28 dropspan:
This is a quick&dirty script to remove HTML from the language files.

It will be deleted from SVN again once this job is done.

    grep '<' en.lang
will print a TODO list ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1072 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 43bde95b57 functions.inc.php - pacrypt():
- if dovecotpw does not give the expected output, read stderr and write
  it to error_log()

This would have made the debugging session I just had with makomi on IRC
about an hour shorter ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1071 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7dc3d62f3d smarty.inc.php:
- replaced last usage of $CONF['postfix_admin_path'] with $incpath

config.inc.php:
- drop (now unused) $CONF['postfix_admin_path'] config variable


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1070 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3330e20b81 functions.inc.php - gen_show_status()
- do not leave the while loop with break - this could hide some
  undeliverable alias targets from being flagged if another alias
  target points to a domain in $CONF[show_undeliverable_exceptions]
- do not add a blank $CONF[show_status_text] if 
  $CONF[show_undeliverable] is disabled - it only wastes space ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1069 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b6cf638b4e functions.inc.php - gen_show_status():
don't show vacation_domain as undeliverable + various code cleanup

- don't show the vacation domain as undeliverable
  In theory this should already have worked already, but $stat_vacdomain
  missed the first letter of the domain ("xample.com" instead of
  "example.com") which broke it.
  Fixed by using $stat_domain, which has the same content anyway.
  This fixes part (2) of
  https://sourceforge.net/tracker/?func=detail&aid=1951926&group_id=191583&atid=937967
- generate the regex for $CONF[recipient_delimiter] at the start of the
  function. Besides saving some CPU cycles, this makes the code more
  readable.
- generate $stat_domain earlier and in a regex-free way
- drop $stat_catchall - it's nothing else than @ + $stat_domain
- use in_array() to check $CONF[show_undeliverable_exceptions] instead
  of a while loop



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1068 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b323c8d25c functions.inc.php:
- lots of whitespace changes

old:
    foo
    {

new:
	foo {


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1067 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 9a1317edc9 functions.inc.php:
- check_quota(): whitespace changes only


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1066 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 62261f54ae functions.inc.php: fix check_quota() to handle unlimited maxquota
- explicitely check for unlimited maxquota when checking if 
  $quota > $limit[maxquota]. Without this, $quota was always
  considered as being too big (not surprising, everything is >0 ;-)
  This fixes https://sourceforge.net/tracker/?func=detail&aid=3306926&group_id=191583&atid=937964
  (caused by domain quota patch, therefore not affecting 2.3.x)
- replaced setting $rval with return in some cases if the decision is
  final without needing to check domain quota
- added lots of comments to make understanding the function easier



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1065 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz bd41cf1693 edit-domain.php:
- changed UPDATE query to db_update()
  This should also fix 
  https://sourceforge.net/tracker/?func=detail&aid=3306933&group_id=191583&atid=937964
- replaced various isset($_POST[...]) with safepost() calls


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1064 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0f49fb81b7 - text change to "Logged _in_ as %s" (the 'in' was missing)
pointed out by supa_user in #postfixadmin
- added a german translation


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1062 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 78635ff88c fix patch for config.inc.php when creating .deb
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1061 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz c858a602d8 create-mailbox.php:
- pSendmail_subject_text comes from $PALANG, not $CONF

Thiss fixes 
https://sourceforge.net/tracker/?func=detail&aid=3305302&group_id=191583&atid=937964
reported by Dale Blount (lnxus @SF)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1060 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5451b536d3 The link target of the "Main" menu item in users/ was configurable in
$CONF['user_footer_link']. This doesn't really make sense - it should
always be a link to users/main.php.

configs/menu.conf:
- added url_user_main = main.php

templates/users_menu.tpl:
- replaced $CONF.user_footer_link with #url_user_main#

config.inc.php:
- removed (now unused) $CONF['user_footer_link']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1059 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 10368edc90 LICENSE.TXT:
- update list of used licenses
- split list into "shipped/not shipped with PostfixAdmin"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1056 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 408c257659 *.lang:
- new texts 'show' and 'all' for list-virtual (see r1054)
- marked 'pOverview_alias_domain_target' as obsolete (no longer needed since r1052)

de.lang:
- added some translations

language-update.sh:
- made --obsolete working


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1055 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz bf1883ebd7 list-virtual:
new option 'all' to display domain aliases, mailboxes and aliases on
one page (like in 2.3.x)

The question is: what do we want as default?
-> feedback please!
(personally, I'd prefer "all")

templates/list-virtual.tpl:
- new submenu option "all"
- changed subnav to a more lightweight design

css/default.css:
- new style ".subnav p" for submenu
- new style "span.active"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1054 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3ffd496587 list-virtual.php:
- lots of whitespace fixes to use 4 spaces everywhere
  (which list-virtual.php has in its vim: comment since a long time)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1053 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 23e3330003 display alias domains less confusing (from/to instead of "is an alias domain for ...)
This fixes 
https://sourceforge.net/tracker/?func=detail&aid=2890375&group_id=191583&atid=937967

list-virtual.php:
- merge queries for from and to side of alias domains
- use a mostly common query for MySQL and PgSQL
- move "can create alias domain" logic to PHP

list-virtual_alias_domain.tpl:
- merge "from" and "to" view to one table
- add "To" column to the merged table
- do not link to $fDomain (which would lead to the currently displayed page)
- drop the second table / "is an alias domain for ..."



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1052 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b37811d153 sendmail.php:
- hand over subject and body as separate parameters to smtp_mail()
  instead of cooking the mail headers manually


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1051 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0247de425a upgrade_1050():
- add index on (domain,timestamp) in log table to make viewlog faster

_add_index():
- fix handling of multi-column aliases in MySQL


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1050 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f6cb50e914 backup.php:
- add a warning that backup.php is poorly maintained and might contain bugs
- disable HTML escaping for the message - we feed it with HTML tags...


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1049 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 43d1b71d4d smarty.inc.php:
- cleanup flash messages after displaying them

This fixes
https://sourceforge.net/tracker/?func=detail&aid=3232174&group_id=191583&atid=937964
reported by john doe (johndoe64@SF)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1048 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 9f94438a78 model/DomainHandler.php:
- replace $domain with $this->username in add()
- comment cleanup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1047 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 39fde20ccc vacation.pl:
- skip mails with a List-Unsubscribe header - that's another indication
  for a mailinglist


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1046 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e61bffe776 scripts/shells/domain.php:
- add handling of domain-level quotas


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1045 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 19bf885fa9 model/DomainHandler.php:
- allow editing and viewing of "quota" (domain-level quota) field.
  Otherwise the CLI can't set it ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1044 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 562f1ac5b8 model/DomainHandler.php:
- get default domain quota from $CONF
- remove unused from "quota" field - it's used now ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1043 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz af6a1b6626 Add support for domain-level quota (total quota for a domain)
Based on a patch from W. Rossmann (W. Rossmann@SF),
https://sourceforge.net/tracker/index.php?func=detail&aid=2974928&group_id=191583&atid=937966
with some modifications, cleanup and adoptions to trunk (especially templates)

config.inc.php:
- new config option $CONF['domain_quota'] to enable/disable domain-level
  quota (default: enabled)
- new config option $CONF['domain_quota_default'] (default: 2 GB)

functions.inc.php - check_quota():
- add code to check the quota sum on a domain
- add optional parameter $username (to exclude that username from quota
  calculation, used by edit-mailbox)

edit-domain.php, create-domain.php,
admin_edit-domain.tpl, admin_create-domain.tpl:
- add input field and handling for domain-level quota

list-domain.php, overview-get.tpl, adminlistdomain.tpl:
- display allocated and allowed domain quota
- beautify quota and max_quota fields - display "unlimited" instead of "-1"

edit-mailbox.php:
- hand over username to check_quota()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1042 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 091d15e58f *.lang: Preparations for domain level quotas
- added $PALANG['pAdminList_domain_quota'] and
  $PALANG['pAdminEdit_domain_quota']
- mark $PALANG['pAdminList_domain_maxquota'] as obsolete

en.lang:
- added TODO for text change to pAdminCreate_domain_maxquota and
  pAdminEdit_domain_maxquota

These changed are based on the patch from W. Rossmann (W. Rossmann@SF),
https://sourceforge.net/tracker/index.php?func=detail&aid=2974928&group_id=191583&atid=937966


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1041 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3e2b6c506f language-update.sh:
- new parameter --obsolete to mark a text as obsolete


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1040 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1e71b525c4 css/default.css:
- merge width and margin to a single rule instead of spreading it all around the CSS

This is a small part from the patch from W. Rossmann (W. Rossmann@SF),
https://sourceforge.net/tracker/?func=detail&aid=2974928&group_id=191583&atid=937966
with some adoptions to SVN trunk


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1039 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 721ee60e8d DomainHandler.php:
- convert domain name to lowercase

This is a follow-up to
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3287965&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1038 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d94b4a6a95 create-domain.php:
- force domain name to lowercase to avoid problems with PgSQL foreign keys

Reported by Munroe Sollog (roe1234@SF),
https://sourceforge.net/tracker/?func=detail&aid=3287965&group_id=191583&atid=937964
after some bughunting on #postfixadmin



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1037 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a6cc2a2947 Changed delete.php to use flash_error(), removed some HTML from languages/*
delete.php: 
- replace various $tMessage=... with flash_error()
- always redirect to the relevant page, even if an error happened
- fix error check in delete admin
- removed HTML formatting (<b>, <span>) from some error messages
- replaced check for pgsql + BEGIN/COMMIT/ROLLBACK with db_begin(),
  db_commit() and db_rollback()
- the smarty message.tpl is most probably superfluous

languages/*.lang:
- removed HTML (<span>) from messages used by delete.php

fetchmail.php, scripts/snippets/baseclass.php
- remove superfluous </span>


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1036 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f503ba1098 functions.inc.php,
- db_delete(): if no row was deleted, return 0 (not true)
  This should not affect any existing code, but makes more sense
  for future usage.
- whitespace changes in db_delete()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1035 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 736074ec12 list-virtual.php: use create_page_browser().
This will speed up pagebrowser creation by about 300 times.

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

It also brings back the pagebrowser in search mode and therefore fixes
https://sourceforge.net/tracker/?func=detail&aid=2782818&group_id=191583&atid=937964

Detailed changes:
- create separate query parts for pagebrowser creation
  (without SELECT $fieldlist and LIMIT clause)
- create pagebrowser arrays with create_page_browser()
- cNav_bar class: parameter cleanup in constructor: use count() instead of 
  relying on external counting
- change cNav_bar calls accordingly


functions.inc.php:
- remove pagebrowser generation from get_domain_properties()
  (no longer needed, obsoleted by create_page_browser)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1034 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 799cd9c2f3 functions.inc.php:
- create_page_browser(): added queries for PgSQL (untested!)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1033 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz cf1fde5194 languages/*:
several text changes to be more clear (see the en.lang diff for details)

This commit implements most changes from Chris H. (dharmachris@SF) posted at
https://sourceforge.net/tracker/?func=detail&aid=3186094&group_id=191583&atid=937964


Related template changes:

templates/admin_edit-admin.tpl:
- use PALANG.save instead of PALANG.pAdminEdit_admin_button

templates/users_edit-alias.tpl, templates/edit-alias.tpl:
- split PALANG.pEdit_alias_welcome - second half is now PALANG.pEdit_alias_help
  (this avoids the <br /> in the text)
- use PALANG.save instead of PALANG.pEdit_alias_button

templates/edit-mailbox.tpl:
- use PALANG.save instead of $PALANG.pEdit_mailbox_button

templates/admin_edit-domain.tpl:
- use PALANG.save instead of $PALANG.pAdminEdit_domain_button


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1031 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz cfd1be04b2 functions.inc.php:
fully working MySQL version of create_page_browser()

- force $page_size to int and die() if it is < 2
- dropped $item_count parameter - the function now counts itsself
- include last row in the query
- return empty array (= no pagebrowser) if all rows fit in one page
- PgSQL queries are still on my TODO list


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1030 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a10272d1d2 list-domain.php:
- add explicit field list in SELECT to avoid PgSQL problems with custom columns

Reported by ksb (ksb4ever@SF),
https://sourceforge.net/tracker/?func=detail&aid=2859165&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1028 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 63146720d4 functions.inc.php:
- generate_password(): generate more secure random password

Based on a patch from Pierre Fagrell (mrfrenzy@SF),
https://sourceforge.net/tracker/?func=detail&aid=2958698&group_id=191583&atid=937964
(with some modifications)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1026 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1414617f4e fix typo in variable name
Reported by Gabriele Vivinetto (gabrielev@SF),
https://sourceforge.net/tracker/?func=detail&aid=3266862&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1024 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8f174d430a postfixadmin-cli: use readlink if $0 is a symlink
- use readlink if $0 is a symlink (for example in /usr/bin) so that
  postfixadmin-cli.php can be found
  Reported by john doe (johndoe64@SF),
  https://sourceforge.net/tracker/?func=detail&aid=3232183&group_id=191583&atid=937964
- add quoting to all variables


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1023 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 67069e07f8 functions.inc.php:
- new function create_page_browser()

Function to create the page browser index ("a-c, d-h, ...") with light
speed (at least when compared with the current code that can take several
minutes(!) for people with lots of mailboxes or aliases).

At the moment, it only works with MySQL, has several big TODO notes 
(including notices how to implement the PostgreSQL query) and is not
yet actively used.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1022 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d66262f00e Remove usage of $CONF['postfix_admin_url'] in various Location: headers
to avoid problems with wrong values of $CONF['postfix_admin_url'].

https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3039042&group_id=191583
contains the technical details and reasons.

Note: $CONF['postfix_admin_url'] is still used at some places that are
a bit harder to change.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1021 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b89b94cf83 Renamed UserHandler to MailboxHandler to make clear it's about mailboxes
(as discussed with GingerDog on IRC yesterday).
Also renamed user to mailbox in the CLI.

- renamed model/UserHandler.php to MailboxHandler.php
- renamed scripts/shells/user.php to mailbox.php
- replaced UserHandler / user with MailboxHandler / mailbox in various files

- unrelated cleanup: deleted obsolete scripts/models-ext directory


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1019 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 3be13f059d this will probably migrate us to phpunit; stupid dev env is misbehaving though so it is hard to test
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1017 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 820256011f go away; move to use phpunit from pear
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1016 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d93f3c12c2 Remove the Zend svn:external from trunk and 2.3 branch
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1015 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz fdfcedb621 de.lang:
- remove half/invalid utf-8 char in $PALANG['pCreate_dbLog_createalias']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1014 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1351953f2c CHANGELOG.TXT:
- merge in correct revision and date for 2.3.3 release


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1013 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f8cd54a468 variables.inc.php:
- cleanup: move some vars to password.php and users/password.php
- drop $pPassword_admin_text - was always empty

password.php, users/password.php:
- init $pPassword_password_text and $pPassword_password_current_text
  (previously in variables.inc.php)

templates/password.tpl, templates/users_password.tpl:
- drop $pPassword_admin_text - was always empty

These changes should also fix some undefined variable warnings reported 
by makomi on IRC.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1004 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5c9e2e772a list-domain.php
- init $domain_properties() to avoid undefined variable warning
  (reported by makomi on IRC)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1002 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0fa1614dad upgrade.php:
- fix syntax error


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1001 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 22f023511c CHANGELOG.TXT:
- merge in changes from 2.3.3 (2.3 branch)
- small whitespace fix


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1000 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 4a29c75938 edit-mailbox.php:
- drop superfluous "modified" field (it's default anyway)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@998 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz c75022ad50 VacationHandler.php:
- set_away() killed the existing aliases and replaced them with the vacation 
  alias instead of adding it. Fixed.
- remove array() from db_update calls for vacation table (introduced by valkum
  in r981) - the vacation table has created/modified columns since r945


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@988 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Valkum 179f195bf1 *fixed db_insert - duplicate $timestamp
*fixed VacationHandler.php
*changed edit-vacation to us VacationHandler
*added todopoint to upgrade.php
*fixed problem in AliasHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@981 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 8560012db8 For reference: the baseclass I was talking about in my previous commit
+ implementation of fetchmail with this class.

Note that those files were last edited on Aug 14 2008, so they probably
contain some outdated stuff ;-)  Nevertheless the baseclass implementation
and the comments it contains are still useful IMHO.

Feedback welcome ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@979 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 51262b7675 DomainHander: on the way to a common interface for all classes and
easy-to-edit field lists. With lots of inspiration from fetchmail.php
and a base class I started 2.5 years ago.

model/DomainHandler.php
- base on PFAHandler (see below)
- new protected variables
  - $id_field (column that contains $username)
  - $struct (field list)
  - $defaults (default values, option lists)
  - $new (switch between new and edit mode)
- change $username to protected (preparation for move to PFAHandler)
- add optional $new parameter to __construct. Targets (not yet implemented):
  - early validation of $username (domain name in this case)
  - if $new == 1, check that item does NOT exist and is a valid domain
  - else: check if item exists. error out if not.
- new function initStruct to fill $id_field, $struct, $defaults
- add():
  - use an array as parameter instead of single parameters
    Advantage: this makes it easy to add another field
  - use _inp_* base validation 
  - create default aliases only in create mode, not in edit mode
- view(): fix error message
- added various TODO notes. Some affect design questions - feedback welcome ;-)

scripts/shells/domain.php:
- change $handler->add call to array usage
- add some TODO notes
- some whitespace fixes in execute()

model/PFAHandler.php:
- new base class for *Handler classes
- contains only some generic input validation for now
- more code will be moved from DomainHandler to PFAHandler later


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@978 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 62eee67aee delete.php:
- fix various db_delete calls - use default table name, not table_by_key() result


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@977 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d0327cbbc7 setup.php:
- make check for $CONF['configured'] more strict (=== instead of ==)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@976 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6225e555f4 model/AliasHandler.php:
- fix comment for delete() - it no longer has a param

model/*:
- add svn $Id line


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@975 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 74fa966522 fix svn:keywords
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@974 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 240079c16f smarty.inc.php:
- set $this->template->allow_php_tag = true instead of editing 
  smarty/libs/Smarty.class.php after every smarty upgrade

added smarty/smarty_version with:
- a note about the current smarty version
- a note about additional files not part of the smarty package


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@973 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 82778dba1e Update smarty from 3.0.5 to 3.0.7
See http://smarty-php.googlecode.com/svn/trunk/distribution/change_log.txt
for a list of all changes.

New files:
libs/sysplugins/smarty_internal_get_include_path.php
libs/plugins/shared.mb_str_replace.php

Deleted files (no longer shipped with smarty):
libs/plugins/function.popup.php
libs/plugins/function.popup_init.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@972 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 476035efd1 Legal stuff: add notes about the licenses of the libraries we use to LICENSE.TXT
Also added smarty/COPYING.lib (contains the smarty license - LGPL3)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@971 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3f9f4b5ee7 vacation.pl:
- add date range check to all queries

Patch by Colin Viebrock (cviebrock@SF) -
https://sourceforge.net/tracker/?func=detail&aid=3152571&group_id=191583&atid=937964

Additionally added a TODO note that we should use a function instead of
having 3 copies of the query in the code.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@970 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz acfc4e57f8 upgrade.php:
- PostgreSQL: change domain.quota, domain.maxquota and mailbox.quota to bigint

reported by oliver (n0d3 @SF), 
https://sourceforge.net/tracker/?func=detail&aid=3057081&group_id=191583&atid=937964

Note: MySQL has bigint field since r169.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@968 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ff84852775 css/default.css:
- center main menu - based on a patch by Chris H. (dharmachris @SF)
  https://sourceforge.net/tracker/?func=detail&aid=3186087&group_id=191583&atid=937964
- some whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@967 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz c97e5224dc Remove $username parameter from db_log()
functions.inc.php:
- remove $username parameter from function db_log()
  (now auto-detected with authentication_get_username())

various files:
- remove hardcoded username ('CONSOLE', $username etc.) in db_log() calls


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@966 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ba8fc89347 Preparation for removing the $username parameter from db_log()
(will be detected by authentication_get_username() instead)

scripts/postfixadmin-cli.php:
- define ("POSTFIXADMIN_CLI", 1) (we have no session running and need a
  way to tell authentication_get_username() that this is a CLI access)

functions.inc.php:
- authentication_get_username(): check for POSTFIXADMIN_CLI constant,
  return 'CLI' if set
  (hmmm, do we need a similar thing for XMLRPC?)
- db_log(): override $username parameter with authentication_get_username()
  (removing it from function parameters will be my next big commit)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@965 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz e3b25d99b4 smarty.inc.php:
- use correct variable name instead of $smarty in __construct()
- everything else in this commit: whitespace changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@964 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 4be543e313 adminlistadmin.tpl, adminlistdomain.tpl:
- fix undefined variables (by using $PALANG.* instead)

footer.tpl:
- remove undefined variable because the correct one is already included


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@963 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 07c21cfa07 VacationHandler.php:
- replaced deprecated split() call with explode()
  https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3179951&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@962 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 1de551320b DomainHandler.php:
- implement delete()

Note that this is a dummy function at the moment. It doesn't work,
it just errors out with "not implemented yet" ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@961 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 2668f5a6c3 shells/domain.php: delete handling, adopted parameter changes
- adopted to changed parameters in DomainHander class
- implemented delete handling


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@960 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 562842f154 DomainHandler.php:
- return true/false instead of shell-style 0/1


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@959 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz d21bf2e82d DomainHandler.php: proofreading results: various small changes
- use $this->username for the domain name (I know the variable name is
  confusing, but I'd like to be consistent with the other classes)
- remove $domain parameter in add() and view(), use $this->username instead
- escape domain in view() for select query
- removed unused "global $config" in view()
- remove superfluous created/modified arrays in db_insert calls
- added some TODO notes
- changed db_log to 'CONSOLE' instead of $this-username for consistency
  with other classes. Long-term fix is to remove the first parameter of
  db_log and let it detect the username automatically.
- various whitespace fixes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@958 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz a93d63a692 smarty.inc.php: interface cleanup etc.
- move initialisation of $smarty->template_dir, compile_dir and 
  config_dir into __construct() of PFASmarty class
- remove usage of /tmp/postfixadmin_templates_c/ to avoid security
  risks (symlink attacks etc.)
- remove __set, __get and __call from PFASmarty class to ensure we
  have a clearly documented interface to the template layer
- whitespace changes (mostly in select_options())
- added vim: line

See also the discussion about the r949 commit in postfixadmin-devel
for details.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@957 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz cebf126eff AliasHandler.php:
- escape $address in is_mailbox_alias()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@956 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz e8beac17d0 index.tpl:
- footer.tpl was accidently lost in r951, added again


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@955 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 53ecb4cb50 ru.lang:
- translation update by Pavel Usischev (pusischev @SF)
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3178905&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@954 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin b0bd8cd1f5 see changeset:952 ... move php code out of template into here
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@953 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin a7942d7059 move this to common.php; i dislike inline php in templates
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@952 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin d798138d1d i prefer english... ;-)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@951 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 43a150941b check if a variable is populated...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@950 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 7424cb0c1a remove strict standards issue with redefinition of smarty::assign() with different parameters than parent class; ideally I should not put the __get/__set/__call methods in here as living without them would reduce our dependency on smarty, but meh (PFASmarty should stil appear and BEHAVE like a Smarty object, it just technically is not one - it is just using one
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@949 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin cf22f1dfd4 reindent; give tMessage a default value (undefined var etc)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@948 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 834f533371 fix some undefined variables
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@947 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 515fa83809 upgrade.php: add vacation.activefrom/activeuntil even for updates from 2.3.x
- MySQL only allows one column with DEFAULT CURRENT_TIMESTAMP per table
  -> introduce {DATE} with DEFAULT 2000-01-01 as workaround
  -> GingerDog, please check if the PostgreSQL variant of {DATE} is valid
- disable upgrade_727_mysql because
  - function number is too small for upgrades from 2.3.x
  - MySQL only
  - it creates some tables PostfixAdmin doesn't use
- new function upgrade_946 to add activefrom/activeuntil fields to the
  vacation table (previously done in upgrade_727_mysql)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@946 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fc26618140 upgrade.php: add "modified" column to vacation table, various fixes and new helper functions
- fix _pgsql_field_exists and _mysql_field_exists to work with 
  non-default table names
- new function _db_field_exists as database-independent wrapper for 
  _*_field_exists
- new function _db_add_field to add a field to a table
- new function printdebug for debug output (grey text)
- define {DATECURRENT} for timestamp fields (avoids lots of duplication)
  -> @GingerDog: please check if the PostgreSQL statement is correct!
- upgrade_945: add a 'modified' column to the vacation table
- various small changes (whitespace, comments, TODO notes etc.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@945 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian d3e68fdc8a two small bugfixes:
- syntax error
- fix commentation marks

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@944 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fb6ee0ea9a sk.lang:
- big translation update by Ondrej Zary (rnbw @sf) - thanks!
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3162501&group_id=191583

*.lang:
- added pViewlog_action_create_domain, pViewlog_action_delete_domain and
  pViewlog_action_edit_domain (was only in en.lang)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@942 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 412fe0fa48 UPGRADE.txt:
- renumbering headlines


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@941 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ea6a7cef79 footer.tpl: remove escaping of $CONF[footer_link]
url-escaping $CONF[footer_link] makes the link look like
"http%3A%2F%2Fexample.com". Browsers interpret this as file name 
relative to the current domain and directory, not as full 
http://example.com URL. Removed escaping.

Thanks to jan-kruis @SF for pointing this out.
https://sourceforge.net/tracker/?func=detail&aid=3153035&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@940 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 02391146b2 AliasHandler.php: fix false positives in is_mailbox_alias and various
small fixes and cleanups

- get(): whitespace fix
- is_mailbox_alias(): avoid false positives if $address is a mailbox,
- is_mailbox_alias(): remove disabled (commented) old code
- update(): remove unused variable $true
- delete(): removed superfluous parameter in $this->get() call
- delete(): removed outdated FIXME note


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@939 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ccda9cd995 VacationHandler.php proofreading results: small changes and some TODO notes
- added several TODO notes
- use db_insert/db_update/db_delete instead of raw queries
- get_details(): error check first (for better readable code),
  whitespace fix
- getVacationAlias: str_replace is enough


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@938 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fc4b51d938 various documentation updates:
INSTALL.TXT:
- added a note to read the official PostfixAdmin documentation first,
  and that "external" HOWTOs on the web are often outdated or incomplete.
  That might sound selfish, but would already have saved several users
  some time.
- updated some links
- added link to the wiki
- added hint about config.local.php
- added note about write access for templates_c directory for www-data

UPGRADE.txt
- added note about setup.php?debug=1
- added note about postfix config update (alias domains)
- added note about templates_c permissions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@937 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 80412e4d60 list-virtual_alias.tpl: fix editing of aliases with $CONF[special_alias_control] == NO
- with special_alias_control = NO, no alias was editable.
  Fixed - only default_aliases should be locked (looks like == instead 
  of === needs to be used in smarty for bool comparison)
- merged conditions, simplified code


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@936 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 0afa2957e6 config.inc.php:
- better documentation for $CONF[alias_control], $CONF[alias_control_admin]
  and $CONF[special_alias_control] because the existing comments were 
  confusing (as pointed out by libertytrek in #postfixadmin)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@934 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum f73c7cbad2 added some things to model class
added user_model.php for user handling
added user_controller.php for controlling user missgin view for output.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@933 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 0ca6c9f239 Done is_mailbox_alias todo. Now it checks against the database.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@932 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 4a2b40e100 changed db_update parameters for the most common usecase "WHERE col=value" -
column and value are separate parameters now

functions.inc.php:
- changed function db_update() parameters - column name and value for the WHERE
  condition are now two separate parameters. This means we don't need to
  escape_string(), add quotes etc. for most UPDATE queries.
  Example call: db_update('alias', 'address', $this->username, $values_array)
- the previous db_update() is now called db_update_q()

model/UserHandler.php:
- changed db_update call to the new parameters
- removed now unused variables
- renamed $username to $E_username
- call pacrypt directly when setting the $set array, no need for $new_db_password

model/AliasHandler.php
- changed db_update call to the new parameters

edit-mailbox.php
- switched to db_update_q()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@931 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 9aa96dabd0 (mostly) make CLI "alias delete" working
shells/alias.php:
- execute still called help() instead of __handle()

model/AliasHandler.php - delete():
- remove useless $address parameter from delete() (we have $this->username)
- added error messages
- fixed variable names for db_log

Reason for the "mostly":
The $this->is_mailbox_alias() in delete() always returns true and therefore
forbids deletion.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@930 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 20e14ad664 Fixed CRYPT
added CRAM-MD5


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@929 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 3c7d04e92a Own Crypt Library. Independence of dovecotpw/doveadm pw
added some structure and tried to impelement CRYPT.

Dovecots Version is here (crypt_generate() ) http://hg.dovecot.org/dovecot-1.2/file/84373d238073/src/auth/password-scheme.c

Can someone help me with creating the lib?



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@928 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz f3450acd0a shells/alias.php:
- fixed wrong variable name for user input


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@927 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 0f4f202371 create-mailbox.php:
- let smtp_mail() construct the mail headers


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@926 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fe2d4ba129 moved scripts/models-ext/* to model/
- moved scripts/models-ext/DomainHandler.php to model/
- deleted redirect scripts in scripts/models-ext/ (UserHandler.php, 
  AliasHandler.php)
- changed scripts/common.php to include the files from ../model/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@925 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 221c18bbc3 AliasHandler.php:
- rewrote delete(): 
  - error checks first (better readable than nested if blocks)
  - use db_delete
  - db_log() alias deletion
- removed outdated comments
- some whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@924 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz b9e562f426 INSTALL.TXT:
- fix example /etc/passwd line (had too many fields)
- moved no_address_mappings to the smtpd on port 25
- removed no_unknown_recipient_checks on port 10025


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@923 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 3004a6cafc added some snippets for new model layout. with new database framework
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@921 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum c6771f7f04 some todos done or partially done
-added alias delete function
-remove silly password function in domain and alias

-changed some $this->err to $this->error
-error ends with stop(1) which returns 1 in *unix shells



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@920 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 320a9331f1 added unix return code in user add. please check it!
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@919 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum f98dfda9ed added some comments
missed in the previous commit


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@918 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 02868eb680 Added some TODOs and MARKs
Some lines in the shells are duplicate



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@917 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 9c5084af04 model/UserHandler.php: fix verifying old password in change_pw()
- if you want to verify the old password, you should compare it against 
  the OLD and not the NEW password ;-)
- fix database calls

In other words: changing the password in users/password.php works again ;-)

users/password.php:
- switch from obsolete change_pass() to change_pw()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@916 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 8e62ef1630 AliasHandler.php proofreading results: various fixes and changes
- pass $username through strtolower()
- get(): error check first for better readability (avoids long if block)
- get(): fixed a forgotten return behaviour change
- get(): renamed $new_list to $filtered_list (self-explaining code)
- update(): migrated to new return behaviour of get()
- update(): use db_update etc.
- some minor changes
- added various TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@915 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz f6cb87eb6e users/edit-alias.php:
- another fix for fForward_and_store on validation errors


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@914 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz da3ef2e1c0 shells/alias.php:
- changed AliasHandler->get call - it does not need the address as parameter
- adopted to true/false return values
- some minor changes and TODO notes

models-ext/AliasHandler.php
- deleted, replaced with a redirect to ../model/AliasHandler.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@913 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 42573d3e4e model/AliasHandler.php:
changed behaviour of get()

- get() now returns only true (success) / false (failure) instead of
  the alias list
  (result of partly merging in scripts/models-ext/AliasHandler.php)
- new method result() to get the real result (alias targets)
- added TODO on if(sizeof($addresses) == 0) - this should never happen

model/VacationHandler.php:
- updated for new AliasHandler bevaviour

xmlrpc.php:
- updated for new AliasHandler bevaviour
- switched from obsolete change_pass to change_pw method


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@912 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 5381f96426 users/edit-alias.php: prepared for updated AliasHandler, small fixes
- prepared for updated AliasHandler from scripts/
- user could cause an empty alias with a trick (or form manipulation).
  Checking forward_and_store for != YES instead of == NO fixes this.
- don't replace spaces in the middle of an (BTW: invalid) alias target
- preserve user input on validation error
- allowed displaying of multiple error messages
- removed unused $_POST[fVacation] variable
- some whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@911 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 93d80797ea functions.inc.php: last commit missed some changes to db_log():
- sorted $action_list to make it more readable
- cleanup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@910 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz f963cc33f1 scripts/shells/user.php:
- adopted return value checks to true/false instead of shell-like 0/1
- fixed some messages in interactive mode
- various minor fixes
- added some TODO notes, but didn't do a full proofreading

scripts/models-ext/UserHandler.php:
- deleted, replaced with a redirect to /model/UserHandler.php

scripts/common.php, scripts/shells/shell.php:
- replaced obsolete "... =& new ..." with "... = new ..."


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@909 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 1a0d584bf9 model/UserHandler.php: proofreading, lots of changes and added TODO comments
- change_pass() now returns the return value of change_pw()
- made most variables un-escaped (as expected by db_insert/db_update/
  db_delete). This means they HAVE TO BE ESCAPED when using them in a
  hand-written query. (Error messages also need escaping - the
  backslashes from escape_string wouldn't help there anyways.)
- escaped variables renamed to $E_whatever
- changed all return values to true (success) and false (failure)
  instead of shell-like 0 (success) and 1 (failure)
- removed unused global $config at various places
- removed timestamp columns from db_insert and db_update call where they
  match the default
- added db_log() for some (but not all) failures
- honor $CONF[maildir_name_hook] when creating a mailbox
- splitting a mail address is now done with list(...) = explode(...)
- switched to db_begin(), db_commit(), db_rollback()
- let smtp_mail create the mail header
- added missing db_commit in delete()
- various minor fixes, code cleanup, comments and TODO notes

To sum it up: all code in UserHandler.php that does not have a TODO
attached should be fine :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@908 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 900615a5ec functions.inc.php: various improvements while working on UserHandler.php
- smtp_mail(): added another (currently optional) parameter.
  It can now be called with subject and body, no need to build the mail
  header in every script that needs to send a mail.
- db_delete() did not use table_by_key. Fixed, backport queued for 
  2.3 branch
- db_insert() now has array(created,modified) as default for timestamp 
  columns so that most calls can be done without that parameter
- db_update() now has array(modified) as default for timestamp column
  so that most calls can be done without that parameter
- new functions db_begin / db_commit / db_rollback - BEGIN / COMMIT / 
  ROLLBACK wrapped in a check for $CONF['database_type'] == "pgsql".
  One more step to get rid of database-specific code in all files.
- db_log(): 
  - migrated to db_insert. This should also fix some missing quoting.
  - sorted $action_list to make it more readable
  - backport queued for 2.3 branch for both changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@907 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 36bdb2fbd0 postfixadmin-cli:
- don't clear the screen at startup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@906 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz bf17e00daf templates_c:
- updated svn:ignore - the new smarty version seems to use different filenames


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@905 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 623d992091 functions.inc.php:
- check_domain(): don't trim() the domain - whitespace is an error.
  This catches "foo@ domain.com" that wasn't catched before.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@902 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz f4957b8bb2 edit-alias.php:
some small fixes that came up while integrating the multiple alias
target patch from anexius (r898 [2.3]/r900 [trunk]):

- replace spaces only at the start and end of a line, not in the
  middle of an (BTW: invalid) mail address
- prevent input data loss on validation errors
- allow multiple error messages (separated by <br />)
- removed some obsolete comments


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@901 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz a0fbff5377 create-alias: support multiple alias targets
- support multiple alias targets, patch by anexius@SF,
  http://sourceforge.net/projects/postfixadmin/forums/forum/676076/topic/4004442
  The patch fixes
  https://sourceforge.net/tracker/?func=detail&aid=2706290&group_id=191583&atid=937964

additional small fixes:
- replace spaces only at the start and end of a line, not in the
  middle of an (BTW: invalid) mail address
- allow multiple error messages (separated by <br />)
- prevent input data loss on validation errors




git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@900 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 48af3c856e UserHandler.php: merge in changes from scripts/models-ext/UserHandler.php
- merged in all new functions and changes (by valkum + some bugfixes 
  and notes from me) - for details see r831, r888 and r891 of 
  scripts/models-ext/UserHandler.php
- re-added change_pass() function (was removed/renamed by valkum) for 
  backward compatibility. 
  IMPORTANT: change_pass will only exist temporarily and is deprecated.
  Besides that, the new implementation has different return values etc.
  so existing code might break already.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@896 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 2f259742f5 upgrade.php:
- replaced deprecated split() with explode()
- added SVN $Id header


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@894 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 512c9bfb44 functions.inc.php:
- replaced deprecated split() call with preg_split()
  https://sourceforge.net/tracker/?func=detail&aid=3060495&group_id=191583&atid=937964
- added hint about probably missing php5-* packages in error messages if 
  database functions don't exist



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@892 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz c6425f695d UserHandler.php, DomainHandler.php
- db_insert and db_delete need the default table name as parameter
  ('alias', not $table_alias aka table_by_key('alias') )

DomainHandler.php
- removed now unused $table_domain and $table_alias



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@891 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz d0a3cd62e8 overview-get.tpl:
- removed a space that caused a smarty syntax error


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@890 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz c1d5b7da0e nb.lang:
- translation update by Odd Henriksen (oddhenriksen @SF)
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3121434&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@889 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fb6ed610fa UserHandler.php:
- add some FIXME and TODO notes

UserHandler.php, AliasHandler.php:
- whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@888 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian 1ad8eafdff - add missing Smarty plugin
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@887 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian cc3972a3c5 - Smarty 3.0.5
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@886 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian 07714cd3c7 git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@885 a1433add-5e2c-0410-b055-b7f2511e0802 14 years ago
Sebastian 6ad87e2b7a - prepare for Smarty Update 2.6 -> 3.0.5
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@884 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian a057830b84 - make template Smarty >= 3.x compatible. Tested with Smarty 3.0.5
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@883 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz e986ba2daa vacation.pl:
whitespace fixes only:
- remove spaces at the end of the line
- replace some tabs with spaces


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@882 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 70db729373 vacation.pl:
some changes after using perlcritic.org - in detail:
- removed unused variable $spam
- use ':encoding(UTF-8)' instead of ':utf8' to validate input against 
  invalid utf8 sequences
- foreach creates its own instance of $item - marking it with "my $item"
- replaced lots of "..." with '...'

BTW: Thanks to the nice guy who recommended perlcritic.org at the 
openSUSE conference!


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@881 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 648cf52972 updating with build deps
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@880 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin cc713d8c63 debian/patches/: fix patch which was broken by a previous change to config.inc.php
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@879 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin e6224e47ad fix dpkg-buildpackage command
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@878 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin d257fc53d1 README.txt: added as per cboltzs subtle irc hint
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@877 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 31821dd69b POSTFIX_CONF.TXT:
- fixed filename for quota


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@876 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 3e69b1d0dc vacation.pl:
- drop unneeded backslashes. The first one caused logging of "$email" 
  instead of the variable content, the others are just cosmetical.
  Reported by Johan Meiring (jmeiring)
  https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3086899&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@875 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz e99547a06c list-virtual.php:
- fix displaying of 'modified' column for aliases when using postgres
  (bugreport mailed by Dominic, neocoretech @SF)
- drop MySQL variant of the alias query, the fixed postgres variant works for
  both
- fixed wrong position of $sql_where (search string) - must be outside 
  the sub-query
- escape search string in page browser - even if it is unlikely that enough
  mail adresses contain funny chars to let the pagebrowser appear ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@874 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz dc4667a4cb config.inc.php:
- fixed parameter description of $CONF['domain_postcreation_script']
  and $CONF['domain_postdeletion_script']
  reported by Aleksey Chudov (alekseyc)
  https://sourceforge.net/tracker/?func=detail&aid=3075955&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@873 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 98c0252a08 common.php:
- store language in session variable
  (BTW: storing it only at login instead of calling check_language() on 
  every page would save some processor cycles ;-)

templates/header.tpl:
- add   class="lang-XY"   (where XY is the language to the body tag.
  This allows language-specific CSS code: .lang-XY table {...}

This commit implements the feature request from J.Kruis (jan-kruis)
https://sourceforge.net/tracker/?func=detail&aid=2903088&group_id=191583&atid=937967



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@872 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 06d65a32b3 fetchmail.php:
- change edit form to XHTML
  (and BTW: the whole form is produced by fetchmail_edit_row() and 
  handed over to smarty in a single variable. Should be converted to
  a generic "edit form" smarty template...)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@871 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz d404b8e531 list-virtual.php:
- include $search in pagebrowser navigation links
- replace deprecated split() with explode()
- fix typo - $GLOABLS instead of $GLOBALS


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@870 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz a46d0c5278 Another step in code cleanup: replaced search.php with search mode in
list-virtual.php. We now have two file less to maintain without loosing
functionality :-)

Only remaining bug: in search mode, no page browser is displayed.
This means that you'll only see the first $CONF['page_size'] search results
*without* the possibility to see the next page of results.
(BTW: search.php simply ignored $CONF['page_size'] ;-)


search.php, templates/search.tpl:
- deleted, RIP ;-)

configs/menu.conf:
- change search form to use list-virtual.php instead of search.php

list-virtual.php:
- added TODO note about the "no page browser in search mode" bug

templates/list-virtual.tpl:
- hand over $search to all tabs



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@869 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 4c912f1da8 list-virtual.php:
- hand over $search to smarty templates

templates/list-virtual_alias.tpl, templates/list-virtual_alias_domain.tpl:
- add search result highlighting

templates/list-virtual_mailbox.tpl:
- add search result highlighting
- move output of "Mailbox" / "Forward only" outside the foreach loop
  (was displayed once per mailbox alias target)

css/default.css:
- add style for ".searchresult"



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@868 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian e85c0ab2b4 - fix encoding problem in menu.tpl which prevented adding Mailbox from menu.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@799 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 852397d285 - small fixes for Smarty 3.0 compatibility
- Postfixadmin now works with Smarty >= 3.0b7

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@798 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian b73839b123 - remove unused motd text files. They are now within the templates directory.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@797 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 610009cb50 - fix bug that no admins and domains can be edited.
- workaround for filename problem.

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@796 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 39172bcac7 - small change. Needed to get PFA running with Smarty 3.0
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@795 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 70d09e17ab upgrade.php:
- fix typo in _drop_index and _add_index ($tabe -> $table) that broke 
  changing table names via $CONF


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@794 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 3fd0649a16 CHANGELOG.TXT:
- changelog update
- fix release details for 2.3 (broken by smarty merge)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@793 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 9ddf15439f - fix some display errors after rev. 788, found and patch supplied by Jan-Kruis, thx.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@791 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 20d2aab24f upgrade.php
- function upgrade_1_mysql(): change default charset of vacation table to
  latin1. Otherwise table creation breaks with MySQL 6.
  Fields that need to be utf-8 are changed to utf-8 later anyways.
  (Found by mechno on #postfixadmin)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@790 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz ec6ac581e6 list-virtual_alias_domain.tpl
- fix delete link for alias domains (when on target domain - delete link
  must contain the "from" domain)
  Reported by roe_ on #postfixadmin, also affects 2.3


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@789 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin e041b9a7a7 list-domain.php: do not escape stuff twice
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@788 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 96cb5820a1 a) PHP != python; use brackets :) b) fix invalid SQL (at least for postgresql) - list-virtual is broken though in not displaying any mailboxes/aliases
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@787 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz c070a61ef2 functions.inc.php
- remove obsolete unlink($tmpfile) that was re-introduced by smarty merge


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@785 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz a250b68988 upgrade.php:
- fix issues from smarty merge:
  - re-add {BIGINT} replacement for pgsql
  - convert DOS linebreaks to unix linebreaks


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@784 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 017b062acd extend the Smarty class so when assigning data to it, it is automatically escaped (unless specified otherwise with a 3rd parameter (false) in the assign function call). This will probably cause some breakage esp where translations have html embedded within them - however i would rather this were the case than the application be vulnerable to XSS
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@782 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 9b0a8deb34 login.php: fix up html escaping etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@781 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 232bc42d63 - Fix small typo.
- Fix small table/link layout problem.

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@780 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 16036cfd4d list-virtual.php
- add in_array check to avoid that superadmins can enter invalid domains
- the check_owner check is probably obsolete after this change. I left it
  in (with a clear message) until I'm 100% sure that it's really unneeded.
- move sticky domain code below error checking - the session should only
  include valid domains ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@779 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 3922f6fece after an hour of debugging with Han on #postfixadmin...
functions.inc.php:
- added error message if the check_owner query returns more than one result.
  This can happen with old databases (pre-2.3) where the domain_admins table
  contains "ALL" _and_ a domain for a superadmin - which results in the
  superadmin not able to edit mailboxes etc. for this domain.
  (Error message not translatable - this is a corner case.)

list-virtual.php:
- add "invalid parameter" error message before redirecting to list-domain
  if the user doesn't have permissions for a domain


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@778 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz f1c9e278f5 DOCUMENTS/DOVECOT.txt
- add query for pgsql (thanks s0undt3ch)
- added 'active' check for MySQL query



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@777 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 42bf87bb58 - fixed minor table error.
- default text alignment is now "left"
- fixed variable assignment in templates/menu.tpl


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@775 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 091cd59d77 import_users_from_csv.py
- add known restrictions (MySQL only, hardcoded "domain/username/") to usage()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@774 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz f456d8f9c3 ru.lang
- updated by  Pavel Usischev (pusischev @SF)
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=2900334&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@773 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 76dc501a52 *.lang:
- added missing strings

language-update.sh:
- made --forcepatch more robust


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@772 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz ad5a4fff9f language updates:
- es.lang by virtualminds @SF
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=2894512&group_id=191583
- fr.lang by fschmutz @SF
  https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2898500&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@771 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz cc38342087 config.inc.php
- document commandline parameters for $CONF[*_script] options 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@770 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 3271b2d822 - fix templates to honour $CONF['sendmail'] and $CONF['fetchmail'] settings
- fix some small undefined errors

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@769 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 4a3e525f24 - small fix to smarty.inc.php. Really use our compile and templates directory
- Fix in menu.tpl to honor "show fetchmail tab"

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@768 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 281dde9cbd adding script as provided by Simone Piccardi via the postfixadmin-devel mailing list
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@767 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 283c563d84 - small bugfix. Display date correctly
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@766 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 2dca007dbf - add some images
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@765 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 5275e17c20 - add ability to choose activation date for vacation message in user module
- add files to user module
TODO: clean up whole user module, use VacationHandler in admin module

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@764 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian e701d6e756 - improved error message of setup.php
- Use $incpath in setup.php to make sure nobody is doing evil things

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@763 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 8360ca09d0 - fixed one more short open tag.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@762 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Norman Messtorff 7229502738 Small typo fixed...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@761 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian 0b41887b36 - add <?php tags.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@760 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian cf40467570 - accidentially deleted header.php. Needed for setup
- add some error checks.

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@759 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian cb029a5daf - add images for calendar JavaScript application
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@758 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian b1287d97e2 - big merge of Postfixadmin smarty into trunk
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@757 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 9a0e51c11b add missing driver option for dovecot-mysql config file
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@756 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 7280a2bf80 POSTFIX_CONF.txt: typo fix
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@754 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 188aa2bd5c functions.inc.php:
- handle dovecot passwords without any tempfile (to prevent safe_mode issues)
  Changed based on a patch from Aleksandr @SF,
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=2890471&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@752 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 6220b6d85c after a long weekend...
list-virtual.php:
- merge search functionality into list-virtual.php (even more performant
  for domain admins now - search.php checked domain ownership after
  querying all domains...)
  (Use list-virtual.php?search=searchterm to test searching)
- allow to display mailbox alias targets in mailbox list
  Fields added to the mailbox list array:
  * goto_mailbox (mailbox (=1) or forward-only (=0))
  * goto_other (array with aliases not pointing to the mailbox)
  * (vacation alias is skipped)
  open question: is $display_mailbox_aliases = boolconf('special_alias_control')
  correct? I'm slightly confused with alias_control, alias_control_admin
  and special_alias_control...
- build mailbox query step by step instead of having several variants
  which overlap 90% (and include a high bug potential, as already
  demonstrated by me ;-)

templates/list-virtual.php
- added search result highlighting
- added displaying of mailbox aliases (goto_mailbox and goto_other)
- removed ?domain= parameter for edit-alias.php, other edit-*.php have
  to follow (otherwise we'll have to extract the domain from the address
  to avoid incorrect parameters in search mode)

functions.inc.php
- added db_in_clause() which builds a "field in(x, y)" clause for
  database queries



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@751 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 7ea19f84ef de.lang:
- fix wrong translation


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@750 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 2c4cdca5fd edit-alias.php
- get domain name by splitting address parameter instead of relying
  on the domain GET/POST parameter. 
  This makes linking to edit-alias easier.
- simplify reading $_GET/$_POST['address']



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@749 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 7f4f8fd996 remove short open tags etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@748 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 9cbb2a5d57 list-virtual.php + its template
- better fix for used quota not showing up (SELECT quota2.bytes _as current_)
- this includes reverting the template patch from r746, patch from
  https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2889335&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@747 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 1b59229f11 fix quota display - as per http://sourceforge.net/tracker/?func=detail&atid=937964&aid=2889335&group_id=191583 - thanks for the patch
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@746 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 0ec2c3aa41 upgrade.php
- upgrade_344_mysql(): fix MySQL 6.0 compatibility
  reported by ant77191 on					   
  https://sourceforge.net/projects/postfixadmin/forums/forum/676076/topic/3435180


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

@ -0,0 +1,34 @@
name: GitHubBuild
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Validate composer.json and composer.lock
run: composer validate
- name: setup templates_c
run: mkdir templates_c || true
- name: touch config.local.php
run: touch config.local.php && php -v
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Build/test
run: composer build
- name: setup coveralls
run: mkdir -p build/logs || true
- name: Coveralls
run: vendor/bin/coveralls ./clover.xml || true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

7
.gitignore vendored

@ -0,0 +1,7 @@
/config.local.php
/templates_c/*.tpl.php
/templates_c/*menu.conf.php
/vendor/
/.php_cs.cache
/.idea
/composer.lock

@ -0,0 +1,23 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('lib')
->exclude('vendor')
->exclude('templates')
->exclude('templates_c')
->exclude('debian')
->files()->notName('config.inc.php')->notName('config.local.php')
->in(__DIR__);
return PhpCsFixer\Config::create()
->setFinder($finder)
->setRules(array(
'@PSR2' => true,
'braces' => array(
'position_after_functions_and_oop_constructs' => 'same',
),
'method_argument_space' => false, # don't break formatting in initStruct()
'no_spaces_inside_parenthesis' => false, # don't break formatting in initStruct()
));
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4 ft=php: */

@ -0,0 +1,32 @@
language: php
php:
- 7.2
- 7.3
- 7.4
services:
- mysql
- postgresql
cache:
directories:
- $HOME/.composer/cache
- $HOME/vendor
before_install:
- mysql -e 'CREATE DATABASE postfixadmin;'
- psql -c 'create database postfixadmin;' -U postgres
before_script:
- travis_retry composer install --no-interaction --prefer-source --dev
- mkdir -p build/logs
script:
- composer build
- DATABASE=sqlite vendor/bin/phpunit tests/
- DATABASE=mysql vendor/bin/phpunit --coverage-clover=build/logs/clover.xml tests/
- DATABASE=postgresql vendor/bin/phpunit tests/
after_success:
- travis_retry php vendor/bin/php-coveralls

@ -6,8 +6,7 @@
# This source file is subject to the GPL license that is bundled with
# this package in the file LICENSE.TXT.
#
# Further details on the project are available at :
# http://www.postfixadmin.com or http://postfixadmin.sf.net
# Further details on the project are available at http://postfixadmin.sf.net
#
# @version $Id$
# @license GNU GPL v2 or later.

@ -0,0 +1,8 @@
Version 0.1 -- 26/10/2009
---------------------------
* Public Release.
* Postcreation, Postdeletion and Postedit hooks.

@ -0,0 +1,7 @@
Configuración
-------------
- Edita el fichero cyrus.conf y modifica las variables $cyrus_*. El usuario debe tener permisos sobre todas las cuentas.
- Edita los ficheros cyrus-*.pl y cambia la ruta de cyrus.conf (linea require '/path/to/cyrus.conf';)

@ -0,0 +1,7 @@
Configuration
-------------
- Edit cyrus.conf and set $cyrus_* variables correctly. User must have permission over all accounts.
- Edit cyrus-*.pl and change path to cyrus.conf (require '/path/to/cyrus.conf'; line)

@ -0,0 +1,36 @@
#!/usr/bin/perl
# Cyrus Mailbox creation
#
# Iñaki Rodriguez (irodriguez@virtualminds.es / irodriguez@ackstorm.es)
#
# LICENSE
# This source file is subject to the GPL license that is bundled with
# this package in the file LICENSE.TXT.
#
# (26/10/2009)
use Cyrus::IMAP::Admin;
require '/etc/mail/postfixadmin/cyrus.conf';
use strict;
use vars qw($cyrus_user $cyrus_password $cyrus_host);
my %opts;
my $mailbox = mailbox_name($ARGV[0]);
my $client = Cyrus::IMAP::Admin->new($cyrus_host);
die_on_error($client);
$opts{-user} = $cyrus_user;
$opts{-password} = $cyrus_password;
$client->authenticate(%opts);
die_on_error($client);
$client->create($mailbox);
die_on_error($client);
$client->setquota($mailbox,'STORAGE',scalar $ARGV[3]) if ($ARGV[3] > 0);
die_on_error($client);

@ -0,0 +1,36 @@
#!/usr/bin/perl
# Cyrus Mailbox deletion
#
# Iñaki Rodriguez (irodriguez@virtualminds.es / irodriguez@ackstorm.es)
#
# LICENSE
# This source file is subject to the GPL license that is bundled with
# this package in the file LICENSE.TXT.
#
# (26/10/2009)
use Cyrus::IMAP::Admin;
require '/etc/mail/postfixadmin/cyrus.conf';
use strict;
use vars qw($cyrus_user $cyrus_password $cyrus_host);
my %opts;
my $mailbox = mailbox_name($ARGV[0]);
my $client = Cyrus::IMAP::Admin->new($cyrus_host);
die_on_error($client);
$opts{-user} = $cyrus_user;
$opts{-password} = $cyrus_password;
$client->authenticate(%opts);
die_on_error($client);
$client->setacl($mailbox,$cyrus_user => 'all');
die_on_error($client);
$client->deletemailbox($mailbox);
die_on_error($client);

@ -0,0 +1,33 @@
#!/usr/bin/perl
# Cyrus Mailbox edition
#
# Iñaki Rodriguez (irodriguez@virtualminds.es / irodriguez@ackstorm.es)
#
# LICENSE
# This source file is subject to the GPL license that is bundled with
# this package in the file LICENSE.TXT.
#
# (26/10/2009)
use Cyrus::IMAP::Admin;
require '/etc/mail/postfixadmin/cyrus.conf';
use strict;
use vars qw($cyrus_user $cyrus_password $cyrus_host);
my %opts;
my $mailbox = mailbox_name($ARGV[0]);
my $client = Cyrus::IMAP::Admin->new($cyrus_host);
die_on_error($client);
$opts{-user} = $cyrus_user;
$opts{-password} = $cyrus_password;
$client->authenticate(%opts);
die_on_error($client);
$client->setquota($mailbox,'STORAGE',scalar $ARGV[3]) if ($ARGV[3] > 0);
die_on_error($client);

@ -0,0 +1,31 @@
#!/usr/bin/perl
# Config
$cyrus_user = 'cyrus';
$cyrus_password = 'cyruspass';
$cyrus_host = 'localhost';
# unixhierarchysep => 1 (yes) / 0 (no)
$unixhierarchysep = 1;
# Common routines
sub mailbox_name {
my $mailbox = shift;
if($unixhierarchysep) {
$mailbox = 'user/'.$ARGV[0];
} else {
$mailbox = 'user.'.$ARGV[0];
}
return $mailbox;
}
sub die_on_error {
my $cyradm = shift;
if($cyradm->error) { die $cyradm->error; }
}
1;

@ -21,20 +21,20 @@ GetOptions ('l' => \$list, 'd=s' => \$domain) or (help());
sub delete_queue {
my $ids = `postqueue -p`;
my @ids = split /\n/, $ids;
for my $id (@ids) {
next if $id =~ /^[\s\(-]/;
chomp $id;
next unless $id;
$id =~ s/(.*?)\**\s.*/$1/;
#print "$id\n";
my $match = `postcat -q $id | grep '$domain'`;
next unless $match;
#print "Deleting ID: $id\n";
my $saida = `postsuper -d $id`;
print $saida;
my $ids = `postqueue -p`;
my @ids = split /\n/, $ids;
for my $id (@ids) {
next if $id =~ /^[\s\(-]/;
chomp $id;
next unless $id;
$id =~ s/(.*?)\**\s.*/$1/;
#print "$id\n";
my $match = `postcat -q $id | grep '$domain'`;
next unless $match;
#print "Deleting ID: $id\n";
my $saida = `postsuper -d $id`;
print $saida;
}
}

@ -26,6 +26,15 @@ our $db_username="mail";
# database password
our $db_password="CHANGE_ME!";
# Where to create a lockfile; please ensure path exists.
our $run_dir="/var/lock/fetchmail";
# in case you want to use dovecot deliver to put the mail directly into the users mailbox,
# set "mda" in the fetchmail table to the keyword "dovecot".
# Where the delivery binary is located
$dovecot_deliver = "/usr/lib/dovecot/deliver";
# instead of changing this script, you can put your settings to /etc/mail/postfixadmin/fetchmail.conf
# just use perl syntax there to fill the variables listed above (without the "our" keyword). Example:
# $db_username = 'mail';
@ -40,7 +49,7 @@ if (-f "/etc/mail/postfixadmin/fetchmail.conf") {
openlog("fetchmail-all", "pid", "mail");
sub log_and_die {
my($message) = @_;
my($message) = @_;
syslog("err", $message);
die $message;
}
@ -59,8 +68,6 @@ while ($_ = shift @ARGS1) {
}
}
$run_dir="/var/run/fetchmail";
# use specified config file
if (-e $configfile) {
do $configfile;
@ -72,6 +79,10 @@ if($db_type eq "Pg" || $db_type eq "mysql") {
log_and_die "unsupported db_type $db_type";
}
if(!-d $run_dir) {
log_and_die("Please create: $run_dir");
}
$lock_file=$run_dir . "/fetchmail-all.lock";
$lockmgr = LockFile::Simple->make(-autoclean => 1, -max => 1);
@ -81,35 +92,45 @@ $lockmgr->lock($lock_file) || log_and_die "can't lock ${lock_file}";
$dbh = DBI->connect($dsn, $db_username, $db_password) || log_and_die "cannot connect the database";
if($db_type eq "Pg") {
$sql_cond = "date_part('epoch',now())-date_part('epoch',date)";
$sql_cond = "active = 't' AND date_part('epoch',now())-date_part('epoch',date)";
} elsif($db_type eq "mysql") {
$sql_cond = "unix_timestamp(now())-unix_timestamp(date)";
$sql_cond = "active = 1 AND unix_timestamp(now())-unix_timestamp(date)";
}
$sql = "
SELECT id,mailbox,src_server,src_auth,src_user,src_password,src_folder,fetchall,keep,protocol,mda,extra_options,usessl
SELECT id,mailbox,src_server,src_auth,src_user,src_password,src_folder,fetchall,keep,protocol,mda,extra_options,usessl, sslcertck, sslcertpath, sslfingerprint
FROM fetchmail
WHERE $sql_cond > poll_time*60
";
my (%config);
map{
my ($id,$mailbox,$src_server,$src_auth,$src_user,$src_password,$src_folder,$fetchall,$keep,$protocol,$mda,$extra_options,$usessl)=@$_;
my ($id,$mailbox,$src_server,$src_auth,$src_user,$src_password,$src_folder,$fetchall,$keep,$protocol,$mda,$extra_options,$usessl,$sslcertck,$sslcertpath,$sslfingerprint)=@$_;
syslog("info","fetch ${src_user}@${src_server} for ${mailbox}");
$cmd="user '${src_user}' there with password '".decode_base64($src_password)."'";
$cmd.=" folder '${src_folder}'" if ($src_folder);
$cmd.=" mda ".$mda if ($mda);
if ($mda) {
if ($mda eq "dovecot") {
$cmd.=" mda \"${dovecot_deliver} -d ${mailbox}\" ";
} else {
$cmd.=" mda ".$mda
}
}
# $cmd.=" mda \"/usr/local/libexec/dovecot/deliver -m ${mailbox}\"";
$cmd.=" is '${mailbox}' here";
$cmd.=" keep" if ($keep);
$cmd.=" fetchall" if ($fetchall);
$cmd.=" ssl" if ($usessl);
$cmd.=" sslcertck" if($sslcertck);
$cmd.=" sslcertpath $sslcertpath" if ($sslcertck && $sslcertpath);
$cmd.=" sslfingerprint \"$sslfingerprint\"" if ($sslfingerprint);
$cmd.=" ".$extra_options if ($extra_options);
$text=<<TXT;
set postmaster "postmaster"
set nobouncemail
@ -117,10 +138,11 @@ set no spambounce
set properties ""
set syslog
poll ${src_server} with proto ${protocol}
$cmd
TXT
$text.="poll ${src_server} with proto ${protocol}";
$text.=" service ${src_port}" if ($src_port);
$text.="\n $cmd";
($file_handler, $filename) = mkstemp( "/tmp/fetchmail-all-XXXXX" ) or log_and_die "cannot open/create fetchmail temp file";
print $file_handler $text;

@ -0,0 +1,231 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Script takes a CSV list of users and does a 'bulk' insertion into mysql.
#
# Copyright (C) 2009 Simone Piccardi
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
import csv
import getopt
import sys
import re
import time
import random, string
from datetime import datetime
from crypt import crypt
try:
import MySQLdb
except ImportError ,e:
print 'Cannot import the needed MySQLdb module, you must install it'
print 'on Debian systems just use the command'
print ' apt-get install python-mysqldb'
def usage():
print "Usage: inspostadmusers.py [options] users.csv"
print " -h print this help"
print " -t test run, do not insert, just print"
print " -u DB user"
print " -p DB password"
print " -D DB name"
print " -H DB host"
print " -q Quota in Mb (0 => no limit)"
print " -n char in seed"
print " -d debug info on"
print " -A create default alias for each domain"
print
print "the users.csv file must contains the user list with a line"
print "for each user, first line should be a title line with at least"
print "the following column names: "
print " * user - user part of the email (like user in user@domain.com)"
print " * password - cleartext password"
print " * domain - domain name (like 'domain.com')"
print " * name - full user name ('Name Surname')"
print
print "the 'name' column is optional, other columns will be ignored"
print
print "Known restrictions:"
print "* this script only works with MySQL"
print "* mailbox paths are hardcoded to domain/username/"
# option parsing
try:
opts, args = getopt.getopt(sys.argv[1:], 'u:p:d:D:H:htdA')
optval={}
for opt, val in opts:
if opt == "-h":
usage()
sys.exit(0)
else:
optval[opt]=val
except getopt.GetoptError:
usage()
sys.exit(2)
#
# Setup DB connection
#
MYSQLDB="postfixadmin"
MYSQLUSER="postfixadmin"
MYSQLPASSWORD=""
MYSQLHOST="localhost"
# settings by command line options
if optval.has_key('-u'):
MYSQLUSER = optval['-u']
if optval.has_key('-p'):
MYSQLPASSWORD = optval['-p']
if optval.has_key('-D'):
MYSQLDB = optval['-D']
if optval.has_key('-H'):
MYSQLHOST = optval['-H']
if optval.has_key('-q'):
quota = optval['-q']
else:
quota = 0
if optval.has_key('-n'):
seed_len = optval['-n']
else:
seed_len = 8
# check arguments, only the user list file must be present
if len(args) !=1:
print 'Need just one argument'
usage()
sys.exit(1)
# MySQL connection (skipped in test run)
if optval.has_key('-t'):
print "Test Run"
else:
try:
connection = MySQLdb.connect(host=MYSQLHOST, user=MYSQLUSER,
db=MYSQLDB, passwd=MYSQLPASSWORD)
except MySQLdb.MySQLError, e:
print "Database connection error"
print e
sys.exit(1)
cursor = connection.cursor()
#
# Main body
#
NOW = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
# read and convert CSV data
lista = csv.DictReader(open(args[0]))
def gen_seed(seed_len, chars):
return '$1$'+''.join([random.choice(chars) for _ in xrange(seed_len)])+'$'
def insert_record(cursor,table,record):
columns = record.keys()
query = "INSERT INTO " + table + "(" + ','.join(columns) + ") VALUES (" + ','.join(len(columns)*['%s']) + ")"
try:
cursor.execute(query, record.values())
return 0
except MySQLdb.MySQLError, e:
print "Database insertion error"
print e
print "Record was:"
print record.values()
print "Query was:"
print query
# defining default values for tables (mailbox, alias and domain)
mailbox = {
'created': NOW,
'modified': NOW,
'active': 1,
'quota': quota
}
aliases = {
'created': NOW,
'modified': NOW,
'active': 1
}
domain = {
'description': "",
'aliases': 0,
'mailboxes': 0,
'quota': 0,
'transport': 'virtual',
'backupmx': 0,
'created': NOW,
'modified': NOW,
'active': 1
}
# list of default alias
def_alias = ['abuse','hostmaster','postmaster','webmaster']
domain_list = {}
chars = string.letters + string.digits
# loop over the CSV
for row in lista:
# create domain if it does not exists
if domain_list.has_key(row["domain"]):
if optval.has_key('-d'):
print "Domain " + row["domain"] + "already exixts"
else:
domain_list[row["domain"]] = 1
domain['domain'] = row["domain"]
if optval.has_key('-t'):
print "Inserting domain"
print domain
else:
insert_record(cursor,'domain',domain)
if optval.has_key('-A'):
for i in def_alias:
aliases['address']= i+'@'+row["domain"]
aliases['goto']= aliases['address']
aliases['domain'] = row["domain"]
if optval.has_key('-t'):
print "Inserting alias"
print aliases
else:
insert_record(cursor,'alias',aliases)
# build query data for mailbox table
mailbox['username']=row["user"]+'@'+row["domain"]
encpass=crypt(row["password"], gen_seed(seed_len,chars))
mailbox['password'] = encpass
mailbox['name'] = row["name"]
mailbox['maildir'] = row["domain"]+'/'+row["user"]+'/'
mailbox['local_part'] =row["user"]
mailbox['domain'] = row["domain"]
# build query data for alias table
aliases['address']= mailbox['username']
aliases['goto']= mailbox['username']
aliases['domain'] = row["domain"]
# inserting data for mailbox (and relate alias)
if optval.has_key('-t'):
print "Inserting mailbox"
print mailbox
print aliases
else:
insert_record(cursor,'mailbox',mailbox)
insert_record(cursor,'alias',aliases)
sys.exit(0)

@ -52,7 +52,17 @@ if [ -e "$maildir" ]; then
exit 1
fi
maildirmake "$maildir"
# try looking for maildirmake ...
MDM=`which maildirmake || which courier-maildirmake`
if [ "x${MDM}" = "x" ]; then
echo "Couldn't find maildirmake or courier-maildirmake in your PATH etc (via which)" >/dev/stderr
exit 1
fi
"${MDM}" "${maildir}"
if [ ! -d "$maildir" ]; then
echo "$0: maildirmake didn't produce a directory; bailing out."
exit 1

@ -0,0 +1,38 @@
Installing the postfixadmin Plugin
======================================
Requirements:
=============
- PHP 5.[234].* with php5-xmlrpc installed (if available; it should be available by default anyway)
- http access to a local/remote postfixadmin interface
- Zend Framework (1.12.x) - needs adding to the include path within common.php,
or installing in a system include path directory (e.g. /usr/share/php)
(e.g. from within the directory containing this file ...
wget https://packages.zendframework.com/releases/ZendFramework-1.12.3/ZendFramework-1.12.3-minimal.tar.gz
tar -zxf ZendFramework-1.12.3-minimal.tar.gz
mv ZendFramework-1.12.3-minimal/library/Zend . )
NOTE: This plugin is _not compatible_ with Zend Framework version 2.x.
Installation :
==============
- Copy this code into the Squirrelmail plugins directory - your life will be easiest if it's in a directory called 'postfixadmin'
- Install Zend Framework (see above under Requirements for example)
- Edit config.php and specify the remote URL for the Postfixadmin XmlRpc service.
- Edit common.php and (if you need to) change the include path(s) so they are correct.
- Edit the remote Postfixadmin's XmlRpc service config file and ensure 'xmlrpc_enabled' is set to boolean true.
- Enable the plugin through 'squirrelmail-configure' or 'config/conf.pl'.
Choose option 8 and move the plugin from the "Available Plugins"
category to the "Installed Plugins" category. Save and exit.
Security :
==========
- The XmlRpc client needs to get the user's mailbox password before it will be able to connect to the
XmlRpc server (postfixadmin). The plugin prompts the user for their mailbox password, and caches it in their session
($_SESSION['password']). This password is then sent once on every page load to the remote XmlRpc server.
- You should consider doing any of the following :
- Using https if the server and client are on seperate servers. This will probably require a signed certificate etc, and may require changes to the Zend_XmlRpc_Client's HttpClient.
- Using something like stunnel to encrypt traffic between server(s).

@ -0,0 +1,40 @@
2007/03/29 :
Before I (David Goodwin) customised this plugin, it contained the following within all
files as a header.
/****************************************************************************************
Author ......... Florian Kimmerl
Contact ........ info@spacekoeln.de
Home Site ...... http://www.spacekoeln.de/
Program ........ postfixadmin
Purpose ........ Allows you to change your postfixadmin settings within squirrelmail
*************************************************************************************
The Original Code is Postfix Admin.
The Initial Developer of the Original Code is Mischa Peters .
Portions created by Mischa Peters are Copyright (c) 2002, 2003, 2004.
All Rights Reserved.
Contributor(s):
This project includes work by Mischa Peters and others that is:
Copyright (c) 2002,2003,2004 Mischa Peters
All rights reserved.
****************************************************************************************/
Contacting the author provided no success, so I took over maintainership.
Please note:
1) Changes made by myself (David Goodwin) will be licensed under the GPL
2) PostfixAdmin has itself been relicensed under the GPL; however this took place _after_
this plugin was written.
3) Squirrelmail itself is released under http://squirrelmail.org/wiki/SquirrelMailGPL (GPL)
The GNU public license can be found online at :
http://www.gnu.org/licenses/gpl.txt

@ -0,0 +1,31 @@
# Squirrelmail Plugin Postfixadmin
The Postfixadmin SquirrelMail plugin let users change their virtual alias,
vacation status/message and password
Your users can therefore use this plugin within Squirrelmail to :
* Turn vacation on/off
* Change their email password
* Setup forwarding rules
Note, this plugin does not require access to the Postfixadmin database. It communicates with Postfixadmin using the XMLRPC protocol.
## Notes
* We now depend upon the Zend Framework (preferably v1.9.x at the time of writing) (Download from http://framework.zend.com/download/latest - the minimal one should be sufficient)
* Traffic to the XmlRpc interface needs encrypting (e.g. https) - this is something _you_ need to do
* When trying to use the plugin, the user will be prompted to enter their mailbox password - this is necessary to authenticate with the remote XmlRpc? interface
## REQUIREMENTS
* SquirrelMail 1.4x
* PostfixAdmin version 3 or higher.
* PHP 5.4+ with XMLRPC support

@ -0,0 +1,51 @@
<?php
// vim:ts=4:sw=4:et
ini_set('include_path', get_include_path() . ':' . dirname(__FILE__));
@include_once('Zend/Version.php');
if (!class_exists('Zend_Version', false)) {
die("Zend Framework not found. Please check the INSTALL File.");
}
chdir("..");
if (!defined('SM_PATH')) {
define('SM_PATH', '../');
}
$config_file = dirname(__FILE__ ) . '/config.php';
$validate_file = dirname(__FILE__) . '/../include/validate.php';
if (!file_exists($config_file)) {
die("$config_file is missing");
}
include_once($config_file);
include_once(dirname(__FILE__) . '/functions.inc.php');
if (file_exists($validate_file)) {
include_once($validate_file);
} else {
$validate_file = SM_PATH . '/src/validate.php';
if (file_exists($validate_file)) {
include_once($validate_file);
}
}
include_once(SM_PATH . 'functions/page_header.php');
include_once(SM_PATH . 'functions/display_messages.php');
include_once(SM_PATH . 'functions/imap.php');
include_if_exists(SM_PATH . 'functions/array.php');
if (file_exists(SM_PATH . 'src/load_prefs.php')) {
include_once(SM_PATH . 'src/load_prefs.php');
} else {
include_if_exists(SM_PATH . 'include/load_prefs.php');
}
// overwrite squirrelmail's content type to utf8...
header("Content-Type: text/html; charset=utf8");
//global $VACCONFMESSAGE;
bindtextdomain('postfixadmin', dirname(__FILE__) . '/postfixadmin/locale');
textdomain('postfixadmin');

@ -0,0 +1,22 @@
<?php
$CONF = array();
$CONF['xmlrpc_url'] = 'http://postfixadmin.local/postfixadmin/xmlrpc.php';
// Virtual Vacation
// If you use virtual vacation for you mailbox users set this to 'true'.
// NOTE: Make sure that you install the vacation module!!
//$AllowVacation = true; // true or false
global $AllowVacation;
$AllowVacation = true;
// Change Password
// Enables user to change the POP3/IMAP Password.
//$AllowChangePass = true; // true or false
global $AllowChangePass;
$AllowChangePass = true;
// Minimum password length - set to Zero to not care, otherwise the number of
// characters a password must be longer than.
$CONF['min_password_length'] = 5;

@ -0,0 +1,20 @@
Squirrelmail PostfixAdmin Plugin for Debian
===========================================
After installing the package, you will need to :
1) Edit the config.inc.php file to point to the PostfixAdmin server.
2) Ensure the xmlrpc interface is available and enabled on the Postfixadmin server
3) Run the squirrelmail-configure script.
Where to get help
=================
See http://squirrelmail-postfixadmin.palepurple.co.uk
Try also : david [at] pale purple dot co dot uk
Or #postfixadmin on irc.freenode.net might be a good bet.

@ -0,0 +1,27 @@
squirrelmail-postfixadmin (2.3.0) stable; urgency=low
* Using XMLRPC backend (no SQL here)
-- David Goodwin <david.goodwin@palepurple.co.uk> Mon, 01 Feb 2010 09:56:00 +0000
squirrelmail-postfixadmin (2.2.0) stable; urgency=low
* Changed DB backend to use prepared statements
* Changed vacation handling to match that of Postfixadmin (vacation.active
etc)
* Changed vacation page to support UTF8
-- David Goodwin <david.goodwin@palepurple.co.uk> Wed, 20 Aug 2008 15:25:00 +0000
squirrelmail-postfixadmin (2.1.1-1) stable; urgency=low
* Add NL language support
* Better db error logging (e.g. if wrong mdb2 driver specified etc)
-- David Goodwin <david.goodwin@palepurple.co.uk> Wed, 12 Dec 2007 16:00:00 +0000
squirrelmail-postfixadmin (2.1.0-1) stable; urgency=low
* Initial release.
-- David Goodwin <david.goodwin@palepurple.co.uk> Thu, 8 Nov 2007 20:00:00 +0000

@ -0,0 +1 @@
/etc/squirrelmail/plugins/postfixadmin-config.php

@ -0,0 +1,19 @@
Source: squirrelmail-postfixadmin
Section: mail
Priority: optional
Maintainer: David Goodwin <david.goodwin@palepurple.co.uk>
Standards-Version: 3.6.1
Package: squirrelmail-postfixadmin
Architecture: all
Depends: squirrelmail, php-pear
Suggests: postfixadmin
Description: Plugin for Squirrelmail to integrate with Postfixadmin
Postfixadmin is a web based interface for managing mail domains
and users. This package integrates Squirrelmail with it.
Users can change their password, forwarding and vacation settings
from within Squirrelmail when this package is installed, and
enabled through the ./squirrelmail-configure command.
.
For further information see
http://squirrelmail-postfixadmin.palepurple.co.uk

@ -0,0 +1,11 @@
This package was debianized by David Goodwin <david@palepurple.co.uk>
2007/11/08
It was downloaded from: http://squirremail-postfixadmin.palepurple.co.uk
Upstream Author(s): n/a
Copyright:
Copyright (C) 2007+ by David Goodwin <david@palepurple.co.uk>
License: GPL v2+

@ -0,0 +1,4 @@
LICENSE.txt
README
INSTALL
debian/README.Debian

@ -0,0 +1 @@
squirrelmail-postfixadmin_2.2.0_all.deb mail optional

@ -0,0 +1,3 @@
usr/share/squirrelmail/plugins/postfixadmin
usr/share/doc/squirrelmail-postfixadmin
etc/squirrelmail/plugins

@ -0,0 +1,5 @@
#!/bin/sh
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
echo "WARNING: You need to read /usr/share/doc/squirrelmail-postfixadmin/README.Debian!"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

@ -0,0 +1,56 @@
#!/usr/bin/make -f
# debian/rules makefile for squirrelmail
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
build: build-stamp
build-stamp:
dh_testdir
clean:
dh_testdir
dh_testroot
dh_clean
install: build
$(checkdir)
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
dh_install
mkdir -p debian/tmp/usr/share/squirrelmail/plugins/postfixadmin
cp -a *.php version debian/tmp/usr/share/squirrelmail/plugins/postfixadmin
cp -a locale debian/tmp/usr/share/squirrelmail/plugins/postfixadmin
cp -a po debian/tmp/usr/share/squirrelmail/plugins/postfixadmin
mkdir -p debian/tmp/etc/squirrelmail/plugins/
cp -a *.sample debian/tmp/etc/squirrelmail/plugins/postfixadmin-config.php
mkdir -p debian/tmp/DEBIAN
cp debian/postinst debian/tmp/DEBIAN/postinst
chmod 555 debian/tmp/DEBIAN/postinst
ln -s /etc/squirrelmail/plugins/postfixadmin-config.php debian/tmp/usr/share/squirrelmail/plugins/postfixadmin/config.php
find debian/tmp -name .svn | xargs -r rm -r
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_installdebconf
dh_installdocs -X.svn
dh_installexamples
dh_installman
dh_installcron
dh_link
dh_compress
dh_fixperms -X/var
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
binary-arch:
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

@ -0,0 +1,96 @@
<?php
/**
* Postfixadmin (http://postfixadmin.sf.net) integration with Squirrelmail.
* See http://squirrelmail-postfixadmin.palepurple.co.uk
* @author David Goodwin and many others
*/
function do_header() {
global $color;
displayPageHeader($color, 'None');
}
function do_footer() {
echo "</body></html>";
}
function _display_password_form() {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
do_header('Postfixadmin Squirrelmail - Login');
echo _('The PostfixAdmin plugin needs your current mailbox password');
echo "<form action='' method='post'>";
echo _('Password for');
echo " " . $_SESSION['username'] . " :";
echo "<input type='password' name='password' value=''>";
echo "<input type='submit' value='" . _('Submit') . "'></form>";
do_footer();
}
/**
* This returns a Zend_XmlRpc_Client instance - unless we can't log you in...
*/
function get_xmlrpc() {
global $CONF;
require_once('Zend/XmlRpc/Client.php');
$client = new Zend_XmlRpc_Client($CONF['xmlrpc_url']);
$http_client = $client->getHttpClient();
$http_client->setCookieJar();
$login_object = $client->getProxy('login');
if (empty($_SESSION['password'])) {
if (empty($_POST['password'])) {
_display_password_form();
exit(0);
} else {
try {
$success = $login_object->login($_SESSION['username'], $_POST['password']);
} catch (Exception $e) {
//var_dump($client->getHttpClient()->getLastResponse()->getBody());
error_log("Failed to login to xmlrpc instance - " . $e->getMessage());
die('Failed to login to xmlrpc instance');
}
if ($success) {
$_SESSION['password'] = $_POST['password'];
// reload the current page as a GET request.
header("Location: {$_SERVER['REQUEST_URI']}");
exit(0);
} else {
_display_password_form();
exit(0);
}
}
} else {
$success = $login_object->login($_SESSION['username'], $_SESSION['password']);
}
if (!$success) {
unset($_SESSION['password']);
die("Invalid details cached... refresh this page and re-enter your mailbox password");
}
return $client;
}
function include_if_exists($filename) {
if (file_exists($filename)) {
include_once($filename);
}
return;
}
global $optmode;
$optmode = 'display';
//
// check_email
// Action: Checks if email is valid and returns TRUE if this is the case.
// Call: check_email (string email)
//
function check_email($email) {
$return = filter_var($email, FILTER_VALIDATE_EMAIL);
if ($return === false) {
return false;
}
return true;
}

@ -0,0 +1,25 @@
<?php
/****************************************************************************************
Author ......... Florian Kimmerl
Contact ........ info@spacekoeln.de
Home Site ...... http://www.spacekoeln.de/
Program ........ postfixadmin
Version ........ 0.3-1.4
Purpose ........ Allows you to change your postfixadmin settings within squirrelmail
/**
* index.php
*
* Copyright (c) 1999-2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This file simply takes any attempt to view source files and sends those
* people to the login screen. At this point no attempt is made to see if
* the person is logged or not.
*
*
****************************************************************************************/
header("Location: ../../index.php");

@ -0,0 +1,6 @@
#!/bin/bash
for f in $(find . -name postfixadmin.po)
do
msgfmt -o $(dirname $f)/postfixadmin.mo $f
done

@ -0,0 +1,132 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2004-01-29 17:35+0100\n"
"PO-Revision-Date: 2007-07-20 20:46+0100\n"
"Last-Translator: Michael Heca <michael.heca@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr "Pøesmìrování"
msgid "Here you can create and edit E-Mail forwards."
msgstr "Zde mù¾ete vytvoøit a nastavit pøesmìrování"
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr "Zde mù¾ete nastavit automatickou odpovìd, pokud nebudete k zasti¾ení."
msgid "Change your mailbox password."
msgstr "Zmìnít heslo k Va¹emu e-mailovému úètu"
#: postfixadmin_changepass.php
msgid "Alias"
msgstr "Úèet"
msgid "Change Password"
msgstr "Zmìnit heslo"
msgid "Change your login password"
msgstr "Zmìnít heslo k Va¹emu e-mailovému úètu"
#: postfixadmin_forward.php
msgid "Edit Alias"
msgstr "Editace adresy pro pøesmìrování"
msgid "Edit an alias* for your domain.<br />One entry per line."
msgstr "Editace pøesmìrování pro Vá¹ úèet. <br/> Ka¾dá adresa na novém øádku."
msgid "The email address that you have entered is not valid:"
msgstr "Zadaná e-mailová adresa je chybná:"
msgid "Unable to locate alias!"
msgstr "Neni mo¾né nalézt úèet!"
msgid "Unable to modify the alias!"
msgstr "Není mo¾né zmìnit úèet!"
msgid "*Additional forward-aliase always recieve messages BBC!"
msgstr "Dal¹í aliasy dostanou e-mail jako BBC!"
msgid "Alias successfully changend!"
msgstr "Pøesmìrování bylo zmìnìno!"
msgid "To remove an alias, simply delete it's line from the text box."
msgstr "Pro odstranení pøesmìrování sma¾te v¹echny øádky v textovém boxu."
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr "Automatická odpovìï"
msgid "Going Away"
msgstr "Jsem mimo"
msgid "Coming Back"
msgstr "Jsem zpìt"
msgid "Options"
msgstr "Nastavení"
msgid "Out of Office"
msgstr "Mimo kanceláø"
msgid "Subject"
msgstr "Pøedmìt"
msgid "Body"
msgstr "Tìlo mailu"
msgid "Your auto response has been removed!"
msgstr "Va¹e automatická odpovìï byla odstranìna!"
msgid "Your auto response has been set!"
msgstr "Va¹e automatická odpovìï byla nastavena!"
msgid "You already have an auto response configured!"
msgstr "U¾ máte nastavenu automatickou odpovìï!"
#: postfixadmin_changepass.php:81
#: postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr "Zadaná hesla nejsou stejná a nebo jsou prázdná!"
#: postfixadmin_forward.php:70
#: postfixadmin_forward.php:152
msgid "To"
msgstr "Komu"
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr "Není mo¾né zmìnit heslo!"
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr "Stávající heslo neodpovídá!"
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr "Va¹e heslo bylo zmìnìno!"
msgid "Password current"
msgstr "Stávající heslo"
msgid "Password new"
msgstr "Nové heslo"
msgid "Password new again"
msgstr "Nové heslo znovu"
msgid "Please sign out and log back again with your new password!"
msgstr "Prosím odhla¹te se a pøihla¹te se s novým heslem!"
msgid "I will be away from <date> until <date>. For urgent matters you can contact <contact person>."
msgstr "Nebudy k zasti¾ení od <date> do <date>. Pro naléhané po¾adavky prosím kontaktujte <contact person>."

@ -0,0 +1,127 @@
# Danish translation for Squirrelmail Plugin Postfixadmin.
# Copyright (C) 2004 Florian Kimmerl, 2007 David Goodwin
# This file is distributed under the same license as the Squirrelmail Plugin Postfixadmin package.
# Jesper R. Meyer <jrm@upthere.dk>, 2007.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 0.4.3\n"
"POT-Creation-Date: 2004-01-29 17:35+0100\n"
"PO-Revision-Date: 2007-11-09 16:07+0100\n"
"Last-Translator: JESPER MEYER <jrm@upthere.dk>\n"
"Language-Team: DANISH <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr "Videresending"
msgid "Here you can create and edit E-Mail forwards."
msgstr "Her kan du oprette og ændre email-videresendinger."
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr "Tilføj en 'ikke tilstede' besked eller et autosvar til din emailadresse."
msgid "Change your mailbox password."
msgstr "Ændre adgangskoden til din postboks"
#: postfixadmin_changepass.php
msgid "Alias"
msgstr "Alias"
msgid "Change Password"
msgstr "Ændre adgangskode"
msgid "Change your login password"
msgstr "Ændre din login-adgangskode"
#: postfixadmin_forward.php
msgid "Edit Alias"
msgstr "Rediger alias"
msgid "Edit an alias* for your domain.<br />One entry per line."
msgstr "Rediger et alias* for dit domæne.<br />En modtager pr. linje."
msgid "The email address that you have entered is not valid:"
msgstr "Emailadressen du angav er ugyldig"
msgid "Unable to locate alias!"
msgstr "Aliaset eksistere ikke!"
msgid "Unable to modify the alias!"
msgstr "Kunne ikke ændre aliaset!"
msgid "*Additional forward-aliase always recieve messages BBC!"
msgstr "*Eksta vidersendingsalias modtager altid meddelelser BCC!"
msgid "Alias successfully changend!"
msgstr "Alias ændret!"
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr "Autosvar"
msgid "Going Away"
msgstr "Tager afsted"
msgid "Coming Back"
msgstr "Kommer tilbage"
msgid "Options"
msgstr "Indstillinger"
msgid "Out of Office"
msgstr "Ikke tilstede"
msgid "Subject"
msgstr "Emne"
msgid "Body"
msgstr "Meddelelse"
msgid "Your auto response has been removed!"
msgstr "Autosvar er fjernet!"
msgid "Your auto response has been set!"
msgstr "Autosvar er aktiveret!"
msgid "You already have an auto response configured!"
msgstr "Du har allerede et autosvar indstillet!"
#: postfixadmin_changepass.php:81 postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr "Adgangskoderne er ikke ens!<br />Eller er tomme!"
#: postfixadmin_forward.php:70 postfixadmin_forward.php:152
msgid "To"
msgstr "Til"
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr "Kan ikke ændre adgangskoden!"
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr "Du glemte at skrive din nuværende adgangskode!"
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr "Din adgangskode er ændret!"
msgid "Password current"
msgstr "Nuværende adgangskode"
msgid "Password new"
msgstr "Ny adgangskode"
msgid "Password new again"
msgstr "Ny adgangskode (igen)"
msgid "Please sign out and log back again with your new password!"
msgstr "Log af og log ind igen med din nye adgangskode!"
msgid "I will be away from <date> until <date>. For urgent matters you can contact <contact person>."
msgstr "Jeg er ikke tilstede i perioden <dato> til <dato>. I nødstilfælde kan <kontaktperson> kontaktes."

@ -0,0 +1,127 @@
# postfixadmin - Plugin for Squirrelmail.
# Copyright (C) 2004 FLORIAN KIMMERL
# This file is distributed under the same license as the PACKAGE package.
# Florian Kimmerl <info@spacekoeln.de>, 2004.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 0.3-1.4\n"
"POT-Creation-Date: 2004-01-28 16:32+0100\n"
"PO-Revision-Date: 2004-01-28 16:32+0100\n"
"Last-Translator: FLORIAN KIMMERL <info@spacekoeln.de>\n"
"Language-Team: GERMAN <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr "Weiterleitungen"
msgid "Here you can create and edit E-Mail forwards."
msgstr "Hier können Sie E-Mail-Weiterleitungen erstellen und bearbeiten."
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr "Hier können Sie den Abwesenheits-Assistenten konfigurieren."
msgid "Change your mailbox password."
msgstr "Hier können Sie Passwort ändern. Nach der Änderung müssen Sie sich neu anmelden!"
#: postfixadmin_changepass.php
msgid "Alias"
msgstr "E-Mail"
msgid "Change Password"
msgstr "Passwort ändern"
msgid "Change your login password"
msgstr "Ändern Sie Ihr Zugangspasswort für POP3/IMAP"
#: postfixadmin_forward.php
msgid "Edit Alias"
msgstr "E-Mail Weiterleitungen bearbeiten"
msgid "Edit an alias* for your domain.<br />One entry per line."
msgstr "Bearbeiten Sie hier Ihre E-Mail Weiterleitungen*.<br />Ein Eintrag pro Zeile."
msgid "The email address that you have entered is not valid:"
msgstr "Die angegebene E-Mail-Adresse ist ungültig:"
msgid "Unable to locate alias!"
msgstr "Ihre Weiterleitungen können nicht angefordert werden! Versuchen Sie es später erneut."
msgid "Unable to modify the alias!"
msgstr "Ihre Weiterleitungen können nicht modifiziert werden! Versuchen Sie es später erneut."
msgid "*Additional forward-aliase always recieve messages BBC!"
msgstr "*Zusätzliche Weiterleitungen erhalten alle Nachrichten als Kopie (BCC)!"
msgid "Alias successfully changend!"
msgstr "Weiterleitungen wurden erfolgreich geändert!"
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr "Abwesenheits-Assistent"
msgid "Going Away"
msgstr "Ich bin weg"
msgid "Coming Back"
msgstr "Ich bin zurück"
msgid "Options"
msgstr "Optionen"
msgid "Out of Office"
msgstr ""
msgid "Subject"
msgstr "Betreff"
msgid "Body"
msgstr "Nachrichtentext"
msgid "Your auto response has been removed!"
msgstr "Iher Abwesenheits-Nachricht wurde deaktiviert!"
msgid "Your auto response has been set!"
msgstr "Ihre Abwesenheits-Nachricht wurde aktiviert!"
msgid "You already have an auto response configured!"
msgstr "Ihre Abwesenheits-Nachricht ist bereits aktiviert!"
msgid "back"
msgstr "zurück"
#: postfixadmin_changepass.php:81 postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr "Die beiden neuen Passwörter stimmen nicht überein!<br />Oder die Felder wurden nicht ausgefüllt!"
#: postfixadmin_forward.php:70 postfixadmin_forward.php:152
msgid "To"
msgstr "An"
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr "Ihr Passwort kann nicht geändert werden!"
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr "Ihr aktuelles Passwort wurde nicht angegeben oder ist falsch!"
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr "Ihr Passwort wurde ergolgreich geändert!"
msgid "Password current"
msgstr "Passwort aktuell"
msgid "Password new"
msgstr "Passwort neu"
msgid "Password new again"
msgstr "Passwort neu nochmal"
msgid "Please sign out and log back again with your new password!"
msgstr "Bitte melden Sie sich hier ab und loggen sich mit Ihrem neuen Passwort erneut ein! "

@ -0,0 +1,135 @@
# postfixadmin - Plugin for Squirrelmail.
# Copyright (C) 2004 FLORIAN KIMMERL
# This file is distributed under the same license as the PACKAGE package.
# Florian Kimmerl <info@spacekoeln.de>, 2004.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 0.3-1.4\n"
"POT-Creation-Date: 2004-01-28 16:32+0100\n"
"PO-Revision-Date: 2004-01-28 16:32+0100\n"
"Last-Translator: FLORIAN KIMMERL <info@spacekoeln.de>\n"
"Language-Team: HUNGARIAN <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr "Levéltovábbítás"
msgid "Here you can create and edit E-Mail forwards."
msgstr "Itt tudod létrehozni és szerkeszteni az E-mail továbbításokat."
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr "Itt lehet beállítani az automatikus válasz levél szövegét, ha az ember távol van."
msgid "Change your mailbox password."
msgstr "Itt tudod megváltoztatni a belépéshez szükséges jelszót."
#: postfixadmin_changepass.php
msgid "Alias"
msgstr "E-mail"
msgid "Change Password"
msgstr "Jelszó megváltoztatása"
msgid "Change your login password"
msgstr "Bejelentkezési jelszó megváltoztatása"
#: postfixadmin_forward.php
msgid "Edit Forward"
msgstr "Levéltovábbítás szerkesztése"
msgid "Edit Alias"
msgstr "Levéltovábbítás szerkesztése"
msgid "The email address that you have entered is not valid:"
msgstr "Az E-mail cím amit beírtál hibás:"
msgid "Unable to locate alias!"
msgstr "Hiba az e-mail címmel."
msgid "Unable to modify the alias!"
msgstr "A módosítás sikertelen!"
msgid "Alias successfully changed!"
msgstr "A módosítás sikeres!"
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr "Automatikus válasz"
msgid "Going Away"
msgstr "Házonkívül vagyok"
msgid "Coming Back"
msgstr "Visszajöttem"
msgid "Options"
msgstr "Opciók"
msgid "Out of Office"
msgstr "Házonkívül"
msgid "Subject"
msgstr "Tárgy"
msgid "Body"
msgstr "Levéltörzs"
msgid "Your auto response has been removed!"
msgstr "Az automatikus válasz törölve lett!"
msgid "Your auto response has been set!"
msgstr "Az automatikus válasz be lett állítva!"
msgid "You already have an auto response configured!"
msgstr "Már létezik egy automatikus válasz!"
#: postfixadmin_changepass.php:81 postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr "A jelszavak nem egyeznek!<br />Vagy üresen hagytad a mezõket!"
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr "A jelszó megváltoztatása sikertelen!"
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr "Az aktuális jelszó nem megfelelõ!"
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr "A jelszó változtatása sikeres volt!"
msgid "Password current"
msgstr "Aktuális jelszó"
msgid "Password new"
msgstr "Új jelszó"
msgid "Password new again"
msgstr "Új jelszó mégegyszer"
msgid "Please sign out and log back again with your new password!"
msgstr "Kérjük, jelentkezzen ki, majd újra be az új jelszavával!"
msgid "I will be away from <date> until <date>. For urgent matters you can contact <contact person>."
msgstr "Házonkívül leszek <date> és <date> között. Sürgõs esetben értesítendõ: <contact person>."
msgid "One copy always goes to"
msgstr "Egy másolat mindig ide"
msgid "Another copy also goes to"
msgstr "További másolatok ide"
msgid "Enter an email address (or addresses) where you would like an additional copy of messages addressed to you sent.<br> Enter only one address per line."
msgstr "Sorolja fel azokat az e-mail címeket, amelyekre az Önhöz érkezõ leveleket továbbítani szeretné.<br>Soronként csak egy címet adjon meg!"
msgid "A copy of each message will go to both your mailbox and the forwarded address(es)."
msgstr "Minden Önnek címzett levél meg fog érkezni a saját postafiókjába és a továbbított e-mail címekre is."
msgid "To remove a Forward, simply delete its line from the text box."
msgstr "Ahhoz, hogy töröljön egy továbbítást, ki kell törölnie az adott sort a felsorolásból."

@ -0,0 +1,129 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2004-01-29 17:35+0100\n"
"PO-Revision-Date: 2010-02-19 11:30+0100\n"
"Last-Translator: valentina <ruggiolona@tiscali.it>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr "Inoltro E-MAIL"
msgid "Here you can create and edit E-Mail forwards."
msgstr "Qui puoi creare e modificare l'inoltro dell' E-MAIL."
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr "Imposta un messaggio OUT OF OFFICE / ASSENTE o un risponditore automatico per la tua mail."
msgid "Change your mailbox password."
msgstr "Modifica la tua password di accesso alla mail"
#: postfixadmin_changepass.php
msgid "Alias"
msgstr "Alias"
msgid "Change Password"
msgstr "Modifica password"
msgid "Change your login password"
msgstr "Modifica la tua password di accesso"
#: postfixadmin_forward.php
msgid "Edit Alias"
msgstr "Modifica Alias"
msgid "Edit an alias* for your domain.<br />One entry per line."
msgstr "Modifica un Alias per il tuo dominio.<br />Un record per linea."
msgid "The email address that you have entered is not valid:"
msgstr "L'indirizzo email che hai inserito non è corretto:"
msgid "Unable to locate alias!"
msgstr "Impossibile trovare l'alias!"
msgid "Unable to modify the alias!"
msgstr "Impossibile modificare l'alias!"
msgid "*Additional forward-aliase always recieve messages BBC!"
msgstr "* L'inoltro ad un alias aggiuntivo comporta l'invio del messaggio in BCC!"
msgid "Alias successfully changend!"
msgstr "Alias modificato correttamente!"
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr "Risponditore automatico"
msgid "Going Away"
msgstr "Going Away"
msgid "Coming Back"
msgstr "Coming Back"
msgid "Options"
msgstr "Opzioni"
msgid "Out of Office"
msgstr "Out of Office/Assente"
msgid "Subject"
msgstr "Oggetto"
msgid "Body"
msgstr "Messaggio"
msgid "Your auto response has been removed!"
msgstr "Il risponditore automatico è stato disattivato!"
msgid "Your auto response has been set!"
msgstr "Il risponditore automatico è stato configurato!"
msgid "You already have an auto response configured!"
msgstr "Hai gia configurato il risponditore automatico !"
#: postfixadmin_changepass.php:81
#: postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr "Le password inserite non coincidono!<br />O i campi sono vuoti!"
#: postfixadmin_forward.php:70
#: postfixadmin_forward.php:152
msgid "To"
msgstr "A"
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr "Impossibile modificare la password"
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr "Non hai indicato la password attuale!"
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr "La tua password è stata modificata!"
msgid "Password current"
msgstr "Password attuale"
msgid "Password new"
msgstr "Nuova password"
msgid "Password new again"
msgstr "Insierisci nuovamente la nuova password"
msgid "Please sign out and log back again with your new password!"
msgstr "Per favore fai log out e riaccedi alla tua mail con la nuova password!"
msgid "I will be away from <date> until <date>. For urgent matters you can contact <contact person>."
msgstr "Mi dispiace sarò assente dal <date> al <date>. Per richieste urgenti vi prego di contattare <nome e indirizzo email>. I will be away from <date> until <date>. For urgent matters you can contact <contact person>."

@ -0,0 +1,131 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: postfixadmin-squirrelmail 2.1.0\n"
"POT-Creation-Date: 2007-11-16 17:35+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Johan <johan@double-l.nl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr "Doorsturen"
msgid "Here you can create and edit E-Mail forwards."
msgstr "Hier kunt u uw doorstuur adres bewerken"
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr "Configureer hier uw automatisch beantwoorden"
msgid "Change your mailbox password."
msgstr "Verander uw wachtwoord"
#: postfixadmin_changepass.php
msgid "Alias"
msgstr "Alias"
msgid "Change Password"
msgstr "Verander wachtwoord"
msgid "Change your login password"
msgstr "Verander uw login wachtwoord"
#: postfixadmin_forward.php
msgid "Edit Forwards"
msgstr "Bewerk aliassen"
msgid "Edit an alias* for your email address.<br />One entry per line."
msgstr "Bewerk uw alias(sen) voor uw emailadres.<br />1 alias per regel."
msgid "The email address that you have entered is not valid:"
msgstr "Het ingevoerde adres is geen geldig adres"
msgid "Unable to locate alias!"
msgstr "Niet in staat opgeven alias te vinden!"
msgid "Unable to modify the alias!"
msgstr "Niet in staat de alias aan te passen"
msgid "*Additional forward-aliases always receive messages BBC!"
msgstr "Aliassen ontvangen altijd per BCC! "
msgid "To remove an alias, simply delete its line from the text box."
msgstr "Verwijder de regel om de alias(sen) te verwijderen."
msgid "Alias successfully changed!"
msgstr "Alias succesvol aangepast"
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr "Automatisch beantwoorden"
msgid "Going Away"
msgstr "Ik ben weg, schakel Out of Office IN"
msgid "Coming Back"
msgstr "Ik ben terug, schakel Out of Office UIT"
msgid "Options"
msgstr "Opties"
msgid "Out of Office"
msgstr "Out of office"
msgid "Subject"
msgstr "Onderwerp"
msgid "Body"
msgstr "Tekst"
msgid "Your auto response has been removed!"
msgstr "Uw automatisch beantwoorden is verwijderd!"
msgid "Your auto response has been set!"
msgstr "Uw automatisch beantwoorden is geactiveerd!"
msgid "You already have an auto response configured!"
msgstr "Automatisch beantwoorden is al geconfigureerd!"
#: postfixadmin_changepass.php:81 postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr "De wachtwoorden komen niet overeen!<br />Of er is geen wachtwoord opgegeven!"
#: postfixadmin_forward.php:70 postfixadmin_forward.php:152
msgid "To"
msgstr "Aan"
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr "Niet in staat uw wachtwoord te wijzigen!"
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr "U moet uw huidige wachtwoord opgeven!"
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr "Uw wachtwoord is gewijzigd!"
msgid "Password current"
msgstr "Huidig wachtwoord"
msgid "Password new"
msgstr "Nieuw wachtwoord"
msgid "Password new again"
msgstr "Nieuw wachtwoord nogmaals"
msgid "Please sign out and log back again with your new password!"
msgstr "Log uit en opnieuw in met het nieuwe wachtwoord"
msgid "I will be away from <date> until <date>. For urgent matters you can contact <contact person>."
msgstr "Ik ben niet aanwezig van <datum> tot <datum>. Voor dringende zaken kunt u contact opnemen met <Contact persoon>."

@ -0,0 +1,132 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2004-01-29 17:35+0100\n"
"PO-Revision-Date: 2007-07-20 20:46+0100\n"
"Last-Translator: Krzysztof Laska <krzysiek@dip.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr "Przekazywanie"
msgid "Here you can create and edit E-Mail forwards."
msgstr "Tutaj mo¿esz ustawiæ i edytowaæ opcje przekazywania wiadomo¶ci"
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr "Ustaw wiadomo¶æ wysy³an± nadawcom podczas Twojej nieobecno¶ci (Vacation)"
msgid "Change your mailbox password."
msgstr "Zmieñ has³o do swojego konta pocztowego"
#: postfixadmin_changepass.php
msgid "Alias"
msgstr "Konto"
msgid "Change Password"
msgstr "Zmieñ has³o"
msgid "Change your login password"
msgstr "Zmieñ has³o do swojego konta pocztowego"
#: postfixadmin_forward.php
msgid "Edit Alias"
msgstr "Edytuj adresy do przekazywania"
msgid "Edit an alias* for your domain.<br />One entry per line."
msgstr "Edytuj forward* dla swojego konta. <br/> Ka¿dy adres w nowym wierszu."
msgid "The email address that you have entered is not valid:"
msgstr "Adres e-mail jaki poda³e¶ jest niepoprawny:"
msgid "Unable to locate alias!"
msgstr "Nie mo¿na zlokalizowaæ aliasu!"
msgid "Unable to modify the alias!"
msgstr "Nie mo¿na zmodyfikowaæ aliasu!"
msgid "*Additional forward-aliase always recieve messages BBC!"
msgstr "*Wszystkie dodatkowe adresy zawsze odbieraj± wiadomo¶ci przesy³ane jako BCC! Ca³a poczta jest przekazywana i nie jest przechowywana na koncie podstawowym!"
msgid "Alias successfully changend!"
msgstr "Zmiana zachowana!"
msgid "To remove an alias, simply delete it's line from the text box."
msgstr "¯eby wy³±czyæ forward na dane konto po prostu usuñ liniê z adresem na który nie chcesz ju¿ przekazywaæ poczty."
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr "Autoodpowied¼"
msgid "Going Away"
msgstr "W³±cz autoodpowied¼"
msgid "Coming Back"
msgstr "Wy³±cz autoodpowied¼"
msgid "Options"
msgstr "Opcje"
msgid "Out of Office"
msgstr "Autoodpowied¼"
msgid "Subject"
msgstr "Temat"
msgid "Body"
msgstr "Tre¶æ"
msgid "Your auto response has been removed!"
msgstr "Twoja autoodpowied¼ zosta³a wy³±czona!"
msgid "Your auto response has been set!"
msgstr "Twoja autoodpowied¼ zosta³a w³±czona!"
msgid "You already have an auto response configured!"
msgstr "Masz ju¿ skonfigurowan± autoodpowied¼!"
#: postfixadmin_changepass.php:81
#: postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr "Has³a które poda³e¶ nie pasuj± lub s± puste!"
#: postfixadmin_forward.php:70
#: postfixadmin_forward.php:152
msgid "To"
msgstr "Do"
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr "Nie mo¿na zmieniæ has³a!"
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr "Nie poda³e¶ aktualnego has³a!"
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr "Twoje has³o zosta³o zmienione!"
msgid "Password current"
msgstr "Bie¿±ce has³o"
msgid "Password new"
msgstr "Nowe has³o"
msgid "Password new again"
msgstr "Powtórz nowe has³o"
msgid "Please sign out and log back again with your new password!"
msgstr "Wyloguj siê i zaloguj z nowym has³em!"
msgid "I will be away from <date> until <date>. For urgent matters you can contact <contact person>."
msgstr "Nie bêdê odbieraæ poczty pomiêdzy <data> a <data>. W sprawach pilnych proszê kontaktowaæ siê z <osoba kontaktowa>"

@ -0,0 +1,127 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2004-01-29 17:35+0100\n"
"PO-Revision-Date: 2008-10-16 20:30+3\n"
"Last-Translator: Julio Covolato <julio@psi.com.br>\n"
"Language-Team: BRAZILIAN PORTUGUESE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr "Encaminhar"
msgid "Here you can create and edit E-Mail forwards."
msgstr "Aqui Voc&ecirc; pode criar e editar alias."
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr "Configurar mensagem de f&eacute;rias para seu email."
msgid "Change your mailbox password."
msgstr "Troque a senha de seu email."
#: postfixadmin_changepass.php
msgid "Alias"
msgstr ""
msgid "Change Password"
msgstr "Mudar Senha"
msgid "Change your login password"
msgstr "Mude sua senha de login"
#: postfixadmin_forward.php
msgid "Edit Alias"
msgstr "Editar Alias"
msgid "Edit an alias* for your domain.<br />One entry per line."
msgstr "Editar um alias* para seu dom&iacute;nio.<br /> Uma entrada por linha."
msgid "The email address that you have entered is not valid:"
msgstr "Este endere&ccedil;o de email informado n&atilde;o &eacute; v&aacute;lido:"
msgid "Unable to locate alias!"
msgstr "Alias n&atilde;o encontrado!"
msgid "Unable to modify the alias!"
msgstr "Imposs&iacute;vel modificar o alias!"
msgid "*Additional forward-aliase always recieve messages BBC!"
msgstr "*Alias adicionais sempre recebem mensagens em BCC"
msgid "Alias successfully changend!"
msgstr "Alias alterado com sucesso!"
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr "Auto resposta"
msgid "Going Away"
msgstr "Ativar"
msgid "Coming Back"
msgstr "Desativar"
msgid "Options"
msgstr "Op&ccedil;&otilde;es"
msgid "Out of Office"
msgstr "Fora do escrit&oacute;rio"
msgid "Subject"
msgstr "Assunto"
msgid "Body"
msgstr "Mensagem"
msgid "Your auto response has been removed!"
msgstr "Sua auto resporta foi removida!"
msgid "Your auto response has been set!"
msgstr "Sua auto resposta foi ativada!"
msgid "You already have an auto response configured!"
msgstr "Voc&ecirc; ainda tem uma auto resposta ativa"
#: postfixadmin_changepass.php:81 postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr "A senha digitada n&atilde;o confere!<br />Ou est&aacute; vazia"
#: postfixadmin_forward.php:70 postfixadmin_forward.php:152
msgid "To"
msgstr "Para"
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr "Imposs&iacute;vel alterar a sua senha!"
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr "Voc&ecirc; n&atilde;o forneceu a sua senha atual!"
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr "Sua senha foi alterada com sucesso!"
msgid "Password current"
msgstr "senha atual"
msgid "Password new"
msgstr "Nova senha"
msgid "Password new again"
msgstr "Confirme a nova senha"
msgid "Please sign out and log back again with your new password!"
msgstr "Por favor, saia e entre novamente no webmail com a nova senha"
msgid "I will be away from <date> until <date>. For urgent matters you can contact <contact person>."
msgstr "Estarei fora do escrit&oacute;rio entre os dias <data> e <data> do m&ecirc;s de <m&ecirc;s>.<br /> Qualquer mensagem urgente, favor enviar para o email <email>."

@ -0,0 +1,127 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2004-01-29 17:35+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: setup.php
msgid "Forwarding"
msgstr ""
msgid "Here you can create and edit E-Mail forwards."
msgstr ""
msgid "Set an OUT OF OFFICE message or auto responder for your mail."
msgstr ""
msgid "Change your mailbox password."
msgstr ""
#: postfixadmin_changepass.php
msgid "Alias"
msgstr ""
msgid "Change Password"
msgstr ""
msgid "Change your login password"
msgstr ""
#: postfixadmin_forward.php
msgid "Edit Alias"
msgstr ""
msgid "Edit an alias* for your domain.<br />One entry per line."
msgstr ""
msgid "The email address that you have entered is not valid:"
msgstr ""
msgid "Unable to locate alias!"
msgstr ""
msgid "Unable to modify the alias!"
msgstr ""
msgid "*Additional forward-aliase always recieve messages BBC!"
msgstr ""
msgid "Alias successfully changend!"
msgstr ""
#: postfixadmin_vacation.php
msgid "Auto Response"
msgstr ""
msgid "Going Away"
msgstr ""
msgid "Coming Back"
msgstr ""
msgid "Options"
msgstr ""
msgid "Out of Office"
msgstr ""
msgid "Subject"
msgstr ""
msgid "Body"
msgstr ""
msgid "Your auto response has been removed!"
msgstr ""
msgid "Your auto response has been set!"
msgstr ""
msgid "You already have an auto response configured!"
msgstr ""
#: postfixadmin_changepass.php:81 postfixadmin_changepass.php:87
msgid "The passwords that you supplied don't match!<br />Or are empty!"
msgstr ""
#: postfixadmin_forward.php:70 postfixadmin_forward.php:152
msgid "To"
msgstr ""
#: postfixadmin_changepass.php:101
msgid "Unable to change your password!"
msgstr ""
#: postfixadmin_changepass.php:75
msgid "You didn't supply your current password!"
msgstr ""
#: postfixadmin_changepass.php:96
msgid "Your password has been changed!"
msgstr ""
msgid "Password current"
msgstr ""
msgid "Password new"
msgstr ""
msgid "Password new again"
msgstr ""
msgid "Please sign out and log back again with your new password!"
msgstr ""
msgid "I will be away from <date> until <date>. For urgent matters you can contact <contact person>."
msgstr ""

@ -0,0 +1,125 @@
<?php
require_once(dirname(__FILE__) . '/common.php');
$xmlrpc = get_xmlrpc();
$user = $xmlrpc->getProxy('user');
global $username;
do_header();
$USERID_USERNAME = $username;
$tmp = preg_split('/@/', $USERID_USERNAME);
$USERID_DOMAIN = $tmp[1];
$stMessage = '';
$tMessage = '';
$pPassword_admin_text = '';
$pPassword_password_current_text = '';
$pPassword_password_text = '';
$error = 0;
if ($_SERVER['REQUEST_METHOD'] == "POST") {
//$pPassword_password_text = _("pPassword_password_text");
$fPassword_current = $_POST['fPassword_current'];
$fPassword = $_POST['fPassword'];
$fPassword2 = $_POST['fPassword2'];
$username = $USERID_USERNAME;
if (!$user->login($_SESSION['username'], $_POST['fPassword_current'])) {
$error = 1;
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$pPassword_password_current_text = _("You didn't supply your current password!");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
$min_length = 0;
if (isset($CONF['min_password_length'])) {
$min_length = $CONF['min_password_length'];
}
if (empty($fPassword) or ($fPassword != $fPassword2) or ($min_length > 0 && strlen($fPassword) < $min_length)) {
$error = 1;
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
if (empty($fPassword)) {
$pPassword_password_text .= _("The passwords that you supplied are empty!");
}
if ($fPassword != $fPassword2) {
$pPassword_password_text .= _("The passwords that you supplied don't match!");
}
if ($min_length > 0 && strlen($fPassword) < $min_length) {
$pPassword_password_text .= _("The password you supplied is too short!");
}
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
if ($error != 1) {
$success = $user->changePassword($fPassword_current, $fPassword);
if ($success) {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$tMessage = _("Your password has been changed!");
$stMessage = _("Please sign out and log back again with your new password!");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
} else {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$tMessage = _("Unable to change your password!");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
}
}
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
echo "<table bgcolor=\"$color[0]\" align=\"center\" width=\"95%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\">
<tr>
<td align=\"center\"><b>". _("Options") ." - ". _("Change Password")." </b>
<table align=\"center\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\">
<tr><td bgcolor=\"$color[4]\" align=\"center\"><br>
<table align=\"center\" width=\"95%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\"><tr>
<td bgcolor=\"$color[3]\" align=\"center\"><b>" ._("Change your login password") ."\n
</b></td>
</tr>
<tr>
<td bgcolor=\"$color[0]\" align=\"center\"><form name=\"mailbox\" method=\"post\">
<b>$tMessage<b><font color=red><br>
<a href=\"../../src/signout.php\" target=\"_top\">$stMessage</a>
".$pPassword_admin_text."\n
".$pPassword_password_current_text."\n
".$pPassword_password_text."\n
</b><table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td width=\"37%\"><b>". _("Alias") . ":\n</td>
<td width=\"63%\">{$_SESSION['username']}</td>
</tr>
<tr>
<td><b>". _("Password current"). ":\n</td>
<td><input type=\"password\" name=\"fPassword_current\" size=\"30\" /></td>
</tr>
<tr>
<td><b>". _("Password new"). ":\n</td>
<td><input type=\"password\" name=\"fPassword\" size=\"30\" /></td>
</tr>
<tr>
<td><b>". _("Password new again"). ":\n</td>
<td><input type=\"password\" name=\"fPassword2\" size=\"30\" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type=\"submit\" name=\"submit\" value=\"" ._("Change Password") . "\" /></td>
<td>&nbsp;</td>
</tr>
</table>
<TT></TT></FORM></td>
</tr><tr><td bgcolor=\"$color[4]\" align=\"left\">&nbsp;</td>
</tr></table><BR>
</td>
</tr></table></td></tr></table>";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');

@ -0,0 +1,159 @@
<?php
require_once(dirname(__FILE__) . '/common.php');
$USERID_USERNAME = $username;
$tmp = preg_split('/@/', $USERID_USERNAME);
$USERID_LOCALPART = $tmp[0];
$USERID_DOMAIN = $tmp[1];
$xmlrpc = get_xmlrpc();
$alias = $xmlrpc->getProxy('alias');
do_header();
// Normal page request (GET)
if ($_SERVER['REQUEST_METHOD'] == "GET") {
$row = $alias->get();
if ($row === false) {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$tMessage = _("Unable to locate alias!");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
exit(0);
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$pEdit_alias_goto = _("To");
$fGoto = $_POST['fGoto'];
// reform string into a list...
$goto = preg_replace('/\r\n/', ',', $fGoto);
$goto = preg_replace('/[\s]+/i', '', $goto);
$goto = preg_replace('/\,*$/', '', $goto);
$array = preg_split('/,/', $goto);
$error = 0;
// check that we have valid addresses in the list
foreach ($array as $key => $email_address) {
if (empty($email_address)) {
unset($array[$key]);
continue;
}
if (check_email($email_address) != "") {
$error = 1;
$tGoto = $goto;
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$tMessage = _("The email address that you have entered is not valid:") . " $email_address</font>";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
}
if ($error != 1) {
$flag = 'forward_and_store'; // goto = $USERID_USERNAME;
$success = $alias->update($array, $flag);
if (!$success) {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$tMessage = _("Unable to modify the alias!");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
} else {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
echo "<p align=center><b>". _("Alias successfully changed!"). "\n</b></p>";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
echo "<p align=center><a href=\"javascript:history.go(-1)\">". _("Click here to go back") ."</a></p>";
exit;
}
}
}
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
if (!isset($tMessage)) {
$tMessage = '';
}
echo "<table bgcolor=\"$color[0]\" align=\"center\" width=\"95%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\">
<tr>
<td align=\"center\" bgcolor=\"$color[0]\" colspan=\"2\">
<b>". _("Options") ." - ". _("Edit Alias"). " </b>
<table align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<td bgcolor=\"$color[4]\" align=\"center\">
<table align=\"center\" width=\"100%\">
<tr>
<td align=\"left\">". _("Edit an alias* for your email address.<br />One entry per line."). " </td>
</tr>
<tr>
<td align=\"left\">". _("*Additional forward-aliases always receive messages BCC!"). "\n
</tr>
<tr>
<td align=\"left\">" . _("To remove an alias, simply delete its line from the text box.") . "</td>
</tr>
</table>
<table align=\"center\" width\"95%\" cellpadding=\"5\" cellspacing=\"1\">
<form name=\"mailbox\" method=\"post\">
<tr>
<td bgcolor=\"$color[3]\" align=\"center\"><b>". _("Edit Forwards"). "</b>
</td>
</tr>
<tr>
<td bgcolor=\"$color[5]\" align=\"center\">$tMessage
<table cellpadding=\"5\" cellspacing=\"1\">
<tr>
<th align=\"left\">". _("Alias"). ":\n
</th>
<td align=\"left\">" . $_SESSION['username'] . "</td>
</tr>
<tr>
<th>&nbsp;</th>
<td>&nbsp;</td>
</tr>
<tr>
<th align=\"left\" valign=\"top\">". _("To"). ":\n</th>
<td>
<textarea rows=\"8\" cols=\"50\" name=\"fGoto\">";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
$aliases = $alias->get();
foreach ($aliases as $address) {
if ($address == "" || $address == null) {
continue;
}
print "$address\n";
}
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
echo "
</textarea>
</td>
</tr>
<tr>
<th>&nbsp;</th>
<td>&nbsp;</td>
</tr>
<tr>
<th>&nbsp;</th>
<td align=\"left\"colspan=\"2\">
<input type=\"submit\" name=\"submit\" value=\"" . _("Edit Alias") . "\">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td></tr>
</table>
";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');

@ -0,0 +1,141 @@
<?php
require_once(dirname(__FILE__) . '/common.php');
$xmlrpc = get_xmlrpc();
$vacation = $xmlrpc->getProxy('vacation');
$VACCONFTXT = _("I will be away from <date> until <date>. For urgent matters you can contact <contact person>.");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
$VACCONF = <<<EOM
$VACCONFTXT
EOM;
do_header();
$USERID_USERNAME = $username;
$tmp = preg_split('/@/', $USERID_USERNAME);
$USERID_DOMAIN = $tmp[1];
if ($_SERVER['REQUEST_METHOD'] == "GET") {
$details = $vacation->getDetails();
if ($vacation->checkVacation()) {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$tMessage = _("You already have an auto response configured!");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
echo "<table bgcolor=\"#b8cbdc\" align=\"center\" width=\"95%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\"><tr>
<td align=\"center\"><b>". _("Options") ." - ". _("Auto Response") ."</b>
<table align=\"center\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\">
<tr><td bgcolor=\"$color[4]\" align=\"center\"><br>
<table align=\"center\" width=\"70%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\"><tr>
<td bgcolor=\"$color[3]\" align=\"center\"><b>". _("Auto Response") ."\n
</b></td></tr><tr>
<td bgcolor=\"$color[0]\" align=\"center\"><form name=\"vacation\" method=\"post\">
<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td><center>$tMessage<p></center></td>
</tr>
<tr>
<td> <div align=\"center\">
<input type=\"submit\" name=\"fBack\" value=\"" . _("Coming Back"). "\" />
</div></td>
</tr>
</table>
<TT></TT></FORM>
</td>
</tr><tr><td bgcolor=\"$color[4]\" align=\"left\">&nbsp;</td>
</tr></table><BR></td></tr></table></td></tr></table>";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
} else {
$tSubject = "Out of Office";
$tSubject = $details['subject'];
$VACCONF = $details['body'];
$tMessage = '';
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
echo "<table bgcolor=\"$color[0]\" align=\"center\" width=\"95%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\">
<tr>
<td align=\"center\"><b>". _("Options") ." - ". _("Auto Response") ." </b>
<table align=\"center\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\">
<tr><td bgcolor=\"$color[4]\" align=\"center\"><br>
<table align=\"center\" width=\"70%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\"><tr>
<td bgcolor=\"$color[3]\" align=\"center\"><b>" . _("Auto Response") ."\n
</b></td></tr><tr>
<td bgcolor=\"$color[0]\" align=\"center\"><form name=\"vacation\" method=\"post\">$tMessage
<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\"><tr>
<td width=\"23%\">". _("Subject") .":\n</td>
<td width=\"2%\">&nbsp;</td>
<td width=\"69%\"><input type=\"text\" name=\"fSubject\" value=\"" . $tSubject . "\" /></td>
<td width=\"2%\">&nbsp;</td>
<td width=\"4%\">&nbsp;</td>
</tr><tr>
<td>". _("Body") .":\n</td>
<td>&nbsp;</td>
<td><textarea rows=\"10\" cols=\"80\" name=\"fBody\">$VACCONF\n
</textarea></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td>
<td><input type=\"submit\" name=\"fAway\" value=\"" . _("Going Away") . "\" /></td>
<td>&nbsp;</td><td>&nbsp;</td></tr>
</table><TT></TT></FORM></td>
</tr><tr><td bgcolor=\"$color[4]\" align=\"left\">&nbsp;</td>
</tr></table><BR></td></tr></table></td></tr></table>";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$fBack = null;
$fAway = null;
foreach (array('fBack', 'fAway', 'fSubject', 'fBody') as $key) {
$$key = null;
if (isset($_POST[$key])) {
$$key = $_POST[$key];
}
}
if (!empty($fBack)) {
$success = $vacation->remove();
if (!$success) {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$tMessage = _("Unable to update your auto response settings!");
echo "<p>This may signify an error; please contact support (1)</p>";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
} else {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
echo "<p align=center><b>". _("Your auto response has been removed!") ."</b></p>";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
}
if (!empty($fAway)) {
// add record into vacation
$success = $vacation->setAway($fSubject, $fBody);
if (!$success) {
$error = 1;
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$tMessage = _("Unable to update your auto response settings!");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
} else {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
echo "<p align=center><b>". _("Your auto response has been set!") ."</b></p>";
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
}
}

@ -0,0 +1,62 @@
<?php
// vim:ts=4:sw=4:et
if (!defined('SM_PATH')) {
die("Invalid internal state (don't access file directly)");
}
include_once(SM_PATH . 'functions/i18n.php');
function squirrelmail_plugin_init_postfixadmin() {
include(dirname(__FILE__) . '/config.php');
global $squirrelmail_plugin_hooks;
$squirrelmail_plugin_hooks['optpage_register_block']['postfixadmin'] = 'postfixadmin_optpage_register_block';
}
function postfixadmin_version() {
return '2.3.0';
}
function postfixadmin_optpage_register_block() {
// Gets added to the user's OPTIONS page.
global $optpage_blocks;
global $AllowVacation;
global $AllowChangePass;
// if ( !soupNazi() ) {
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
$optpage_blocks[] = array(
'name' => _("Forwarding"),
'url' => '../plugins/postfixadmin/postfixadmin_forward.php',
'desc' => _("Here you can create and edit E-Mail forwards."),
'js' => false
);
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
if ($AllowVacation) {
$optpage_blocks[] = array(
'name' => _("Auto Response"),
'url' => '../plugins/postfixadmin/postfixadmin_vacation.php',
'desc' => _("Set an OUT OF OFFICE message or auto responder for your mail."),
'js' => false
);
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');
textdomain('postfixadmin');
if ($AllowChangePass) {
$optpage_blocks[] = array(
'name' => _("Change Password"),
'url' => '../plugins/postfixadmin/postfixadmin_changepass.php',
'desc' => _("Change your mailbox password."),
'js' => false
);
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
}
}

@ -1,185 +1,193 @@
<?php
/*
Virtual Mail Delete
by George Vieira <george at citadelcomputer dot com dot au>
You can run this from your crontab with something like
0 4 * * * * vmail php -q virtualmaildel.php >/dev/null
Changes:
2017.08.31 updated to use PHP mysqli extension.
2018.02.23 removing Sieve filters if exists.
Tadas Ustinavičius <tadas at ring dot lt> ( https://github.com/postfixadmin/postfixadmin/pull/70 )
*/
$CONF = [];
// Either, uncomment this (and change to work)
//require_once('/path/to/postfixadmin/config.inc.php');
// OR uncomment this.
/*
$CONF = [
'database_host' => 'localhost',
'database_user' => 'someone',
'database_password' => 'something',
'database_name' => 'mydb'
];
*/
$MAKE_CHANGES = false; // change to true when you're happy this isn't going to trash your server.
if (empty($CONF)) {
die("\nPlease configure me\n\n");
}
// Where's the homedir accounts stored. (GET THIS RIGHT OTHERWISE IT THINK NONE EXIST AND DELETES ALL)
$homedir = '/home/virtual';
if (! is_dir($homedir)) {
die("Cannot find home directory for virtual mailboxes in $homedir\n");
}
//
// Recursive Delete Function
//
// Virtual Mail Delete
// by George Vieira <george at citadelcomputer dot com dot au>
//
// You can run this from your crontab with something like
//
// 0 4 * * * * vmail php -q virtualmaildel.php >/dev/null
//
// Setup location of postfixadmin config files. Needed to login to mysql
//
$conf = '/home/httpd/mail/admin/config.inc.php';
//
// Where's the homedir accounts stored. (GET THIS RIGHT OTHERWISE IT THINK NONE EXIST AND DELETES ALL)
//
$homedir = '/home/virtual';
//
// Make sure everything is everything before continuing
//
if ( ! file_exists( $conf ) )
die( "Cannot find config file $conf\n" );
if ( ! is_dir( $homedir ) )
die( "Cannot find home directory for virtual mailboxes in $homedir\n" );
//
// Load mysql authentication from postfixadmin
//
include( $conf );
//
// Recursive Delete Function
//
function deldir($dir)
{
$current_dir = opendir($dir);
while($entryname = readdir($current_dir))
{
if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!=".."))
{
deldir("${dir}/${entryname}");
}
elseif($entryname != "." and $entryname!="..")
{
unlink("${dir}/${entryname}");
}
}
closedir($current_dir);
@rmdir(${dir});
}
function deldir($dir) {
$current_dir = opendir($dir);
while ($entryname = readdir($current_dir)) {
if (is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")) {
deldir("{$dir}/{$entryname}");
} elseif ($entryname != "." and $entryname!="..") {
unlink("{$dir}/{$entryname}");
}
}
closedir($current_dir);
@rmdir($dir);
}
// --- Main Start ---
//
// Get list of directories
//
$fr = opendir( $homedir );
while ( ($domain = readdir($fr)) !== false)
{
//
// Check if it's a dir
//
if ( $domain != "." and $domain != ".." and filetype($homedir .'/'. $domain) == "dir" )
{
//
// Open the (assumed) DOMAIN directory
//
$ff = opendir( $homedir .'/'. $domain );
while ( ($user = readdir($ff)) !== false)
{
//
// Check for directories assuming it's a user account
//
if ( $user!="." and $user!=".." and filetype($homedir .'/'. $domain .'/'. $user) == "dir" )
{
//
// if the dir 'new' exists inside then it's an account
//
if ( file_exists($homedir .'/'. $domain .'/'. $user .'/'. "new") )
{
$dir[$domain][$user] = "";
}
else
{
//
// Alert that the dir doesn't have a 'new' dir, possibly not an account. Leave it.
//
echo "UNKNOWN : " . $homedir ."/". $domain ."/". $user ."/new NOT FOUND. Possibly not an account. Leaving untouched\n";
}
}
}
}
}
//
// OK, got an array of accounts from the dir, Now connect to the DB and check them
//
$conx = mysql_connect( $CONF['database_host'],$CONF['database_user'],$CONF['database_password'] );
//
// Is there a problem connecting?
//
if ( $conx != false )
{
//
// Select the database
//
mysql_select_db( $CONF['database_name'] , $conx) or die ("Can't access database postfix : " . mysql_error());
//
// Select all mailboxes to verify against dirs listed in array
//
$query = "SELECT * FROM mailbox";
$result = mysql_query( $query );
//
// Query the mailbox table
//
if ( $result != false )
{
//
// Fetch the list of results
//
while ( $row = mysql_fetch_assoc( $result ) )
{
//
// Pull apart the maildir field, needed to figure out the directory structure to compare
//
$strip = explode("/",$row['maildir']);
//
// Unset the array if it exists. This stops it being erased later.
//
unset( $dir[ $strip[0] ][ $strip[1] ] );
}
//
// If there are results. unset the domain too.
//
if ( count($dir[$strip[0]])==0 and mysql_num_rows($result)>0 )
unset( $dir[$strip[0]] );
}
else
die( "Failed SELECT in mailboxes\n" );
}
else
die( 'Cannot connect to the database!\n' );
//
// OK, time to clean up. All known users/domains have been removed from the list.
//
//
// If the array still exists (incase nothing there)
//
if ( is_array($dir) )
{
//
// Go through each dir
//
foreach ( $dir as $key => $value )
{
//
// Is this a user array?
//
if ( is_array( $value) )
{
//
// Go through and nuke the folders
//
foreach ( $value as $user => $value2 )
{
//
// Nuke.. need any more explanations?
//
echo "REMOVING : " . $homedir."/".$key."/".$user."\n" ;
deldir( $homedir."/".$key."/".$user ) ;
}
}
}
}
//
// And we are outta here....
//
echo "Cleanup process completed\n";
?>
$dir = [];
//
// Get list of directories
//
$fr = opendir($homedir);
// TODO: Would glob($homedir . '/**/*/new') be somewhat quicker/shorter/less effort?
while (($domain = readdir($fr)) !== false) {
//
// Check if it's a dir
//
if ($domain == "." || $domain == ".." || filetype($homedir .'/'. $domain) != "dir") {
continue;
}
//
// Open the (assumed) DOMAIN directory
//
$ff = opendir($homedir .'/'. $domain);
while (($user = readdir($ff)) !== false) {
//
// Check for directories assuming it's a user account
//
if ($user == "." || $user == ".." || filetype($homedir .'/'. $domain .'/'. $user) != "dir") {
continue;
}
//
// if the dir 'new' exists inside then it's an account
//
if (file_exists($homedir .'/'. $domain .'/'. $user .'/'. "new")) {
$dir[$domain][$user] = "";
} else {
//
// Alert that the dir doesn't have a 'new' dir, possibly not an account. Leave it.
//
echo "UNKNOWN : " . $homedir ."/". $domain ."/". $user ."/new NOT FOUND. Possibly not an account. Leaving untouched\n";
}
}
}
//
// OK, got an array of accounts from the dir, Now connect to the DB and check them
//
$conx = mysqli_connect($CONF['database_host'], $CONF['database_user'], $CONF['database_password'], $CONF['database_name']);
//
// Is there a problem connecting?
//
if (! $conx || mysqli_connect_errno()) {
echo "DB connection failed." . mysqli_connect_error() . "\n";
die("Problem connecting to the database. ");
}
//
// Select all mailboxes to verify against dirs listed in array
//
$query = "SELECT * FROM mailbox";
$result = mysqli_query($conx, $query);
//
// Query the mailbox table
//
if (! $result) {
die("Failed to query mailbox table.");
}
//
// Fetch the list of results
//
while ($row = mysqli_fetch_assoc($result)) {
//
// Pull apart the maildir field, needed to figure out the directory structure to compare
//
$strip = explode("/", $row['maildir']);
//
// Unset the array if it exists. This stops it being erased later.
//
unset($dir[ $strip[0] ][ $strip[1] ]);
}
//
// If there are results. unset the domain too.
//
if (count($dir[$strip[0]])==0 and mysqli_num_rows($result)>0) {
unset($dir[$strip[0]]);
}
//
// OK, time to clean up. All known users/domains have been removed from the list.
//
//
// If the array still exists (incase nothing there)
//
if (is_array($dir)) {
//
// Go through each dir
//
foreach ($dir as $key => $value) {
//
// Is this a user array?
//
if (!is_array($value)) {
continue;
}
//
// Go through and nuke the folders
//
foreach ($value as $user => $value2) {
// Nuke.. need any more explanations?
$path = $homedir . '/' . $key . '/' . $user;
$sieve_path = $homedir . '/.sieve/' . $key . '/' . $user;
$sieve_exists = file_exists($sieve_path);
// check if user has Sieve filters created
if ($MAKE_CHANGES) {
deldir($path);
if ($sieve_exists) {
deldir($sieve_path);
}
} else {
echo " - Would recursively delete : $path \n";
if ($sieve_exists) {
echo " - Would recursively delete Sieve filters : $sieve_path \n";
}
}
}
}
}
echo "Cleanup process completed\n";

@ -1,14 +1,697 @@
# Postfix Admin
#
# LICENSE
# This source file is subject to the GPL license that is bundled with
# this package in the file LICENSE.TXT.
#
# Further details on the project are available at :
# http://www.postfixadmin.com or http://postfixadmin.sf.net
# Postfix Admin
#
# Last update:
# $Id$
# LICENSE
# This source file is subject to the GPL license that is bundled with
# this package in the file LICENSE.TXT.
#
# Further details on the project are available at http://postfixadmin.sf.net
Version X.X - master
-------------------------------------------------
- Improve vacation.pl (better utf-8 support)
- Improve DB connections (PDO, SSL)
- Add sha512.b64 password hash support (see https://github.com/postfixadmin/postfixadmin/issues/58)
- Add support for password expiration (see https://github.com/postfixadmin/postfixadmin/pull/200 and README.password_expiration )
- Improve ADDITIONS/postfixadmin-mailbox-postcreate.sh
- Add Date header into smtp_from() (see https://github.com/postfixadmin/postfixadmin/issues/203 )
- PostgreSQL fixes ( 1e158245d613fd1d8d5c1d59e26e940eb71f5b32 )
- vacation.pl fixes (perl libraries; see https://github.com/postfixadmin/postfixadmin/pull/194 )
- Add bootstrap theme (default not changed yet) ( see https://github.com/postfixadmin/postfixadmin/pull/172 )
- Improve CSV export from list.php
- Various misc. changes from static analysis (psalm)
- Update installation instructions. (see: https://github.com/postfixadmin/postfixadmin/issues/189 https://github.com/postfixadmin/postfixadmin/issues/188 )
- Encryption improvements (see: php_crypt / encrypt_difficulty in sample config)
- Sqlite improvements (see https://github.com/postfixadmin/postfixadmin/issues/177 and https://github.com/postfixadmin/postfixadmin/issues/176 )
- MySQL 8 compatibility (see https://github.com/postfixadmin/postfixadmin/pull/175 )
- Internally the database functions have been refactored to use PDO rather than the lower level mysql_, mysqli_, pg_ etc functions. ( see: https://github.com/postfixadmin/postfixadmin/pull/231 )
- Usage of dovecot deliver as fetchmail mda
Version 3.2 - 2018/05/02
-------------------------------------------------
- move public facing stuff into public/, this allows us to stop exposing
templates_c/ etc. to the world (but also means you'll need to adjust your
webserver config)
- enable users to reset their passwords by mail or SMS
($CONF['forgotten_user_password_reset'],
$CONF['forgotten_admin_password_reset'], $CONF['sms_send_function'])
- allow local alias targets (without @domain) - see #134
- add $CONF['edit_alias'] to disable "edit_alias" function for users
- add php_crypt $CONF["encrypt"] option (see #170 for examples)
- add random_compat phar (see: https://github.com/paragonie/random_compat) to
support random_int()/random_string() in older PHP versions.
- add support for MySQL connections over SSL
- language updates: sk, ja, nl, bg, fr, cz
- update bundled smarty library (lib/smarty to 3.1.32; includes security fixes)
- split up pacrypt() into different functions; add some minimal test coverage
- add id autoincrement field to log table (#89)
- add token to login.php to prevent CSRF
- lots of bugfixes and code cleanup
- drop unused code in postfixadmin-cli
- introduce PHP-CS-Fixer to enforce code style
- vacation.pl:
- avoid answering to more known autoresponders
- add $no_vacation_pattern to avoid sending autoresponders based on the To:
address
- replace Deprecated Mail::Sender by Email::Sender
- use MIME:EncWords
- remove unused MIME::Base64
- add docker repo, see https://github.com/postfixadmin/docker
Version 3.1 - 2017/06/25
-------------------------------------------------
- broadcast improvements:
- allow to send to mailboxes only
- allow to send to only some domains
- allow domain admins to send to their domains - new config option
$CONF['sendmail_all_admins']
- don't send to inactive mailboxes or aliases
- update squirrelmail plugin
- better static DB connection cache to avoid hundreds of mysqli connection
when doing lots of escape_string() calls
- use $CONF[page_size] in viewlog.php
- fix problems with utf8mb4 as default charset in setup.php/upgrade.php
- fix default for $CONF[create_mailbox_subdirs_hostoptions]
- get rid of variables.inc.php (and initialize variables where needed)
- add favicon to fix session handling in chrome (#44)
- add check to ensure templates_c/ exists and is writeable
- recommend usage of config.local.php in setup.php
- remove php4 constructor from cNav_bar (page browser)
- update fr.lang
Version 3.0.2 - 2017/02/08 - SVN r1895
-------------------------------------------------
- SECURITY: don't allow to delete protected aliases (CVE-2017-5930, PR#23)
- fix VacationHandler for PostgreSQL
- AliasHandler: restrict mailbox subquery to allowed and specified domains
to improve performance on setups with lots of mailboxes
- allow switching between dovecot:* password schemes while still accepting
passwords hashed using the previous dovecot:* scheme
- FetchmailHandler: use a valid date as default for 'date'
- fix date formatting in non-english languages when using PostgreSQL
- debian packaging: improve dependencies, remove old templates_c/ files
- various small fixes
Version 3.0.1 - 2016/09/19 - SVN r1870
-------------------------------------------------
- add missing Smarty files to Debian package
(no changes to PostfixAdmin, therefore only released as Debian packages)
Version 3.0 - 2016/09/11 - SVN r1861
-------------------------------------------------
- add sqlite backend option
- add configurable smtp helo (CONF["smtp_client"])
- new translation: ro (Romanian)
- language update: tw, cs, de
- fix escaping in gen_show_status() (could be used to DOS list-virtual by
creating a mail address with special chars)
- add CSRF protection for POST requests
- list.tpl: base edit/editactive/delete links in list.tpl on $RAW_item to
avoid double escaping, and fix some corner cases
- editform.tpl: add {if} block for description column for easier customization
- use smarty html_options instead of select_options()
- remove advice about using SetEnv for database password
- include_once(config.local.php) instead of include()ing it to prevent include
loops if someone copies config.inc.php to config.local.php
- vacation.pl: encode wide-chars utf8 in mail body, mime-decode original subject
- fix db_quota_text() for postgresql (concat() vs. ||)
- change default date for 'created' and 'updated' columns from 0000-00-00
(which causes problems with MySQL strict mode) to 2000-01-01
- allow punicode even in TLDs
- update Smarty to 3.1.29
- add checks to login.php and cli to ensure database layout is up to date
- whitelist '-1' as valid value for postfixadmin-cli
- don't stripslashes() the password in pacrypt
- various small bugfixes
Version 3.0 beta3 (2.93) - 2015/09/26 - SVN r1802
-------------------------------------------------
Summary of major changes:
- add list.php and list.tpl for displaying lists
- based on *Handler $struct, which means list view can now be customized with
$CONF[*_struct_hook] functions (columns with display_in_list and non-empty
label will be displayed)
- add CSV export
- replaces list-domain.php, list-admin.php and fetchmail.php (including their
*.tpl files) and the alias and alias domain lists in list-virtual
- improved / more detailed search support by using URL parameters
(list.php?search[field]=value, optionally also ?searchmode[field]=< -
no pretty search form yet, limited to fields the user/admin can access)
- only display search input box if search fields are specified in *handler
(that effectively means no search box for admin, domain and fetchmail listings)
- can also be used for users (non-admins)
- add FetchmailHandler (replaces fetchmail.php and its template), which also
means postfixadmin-cli can configure fetchmail jobs now
- add $CONF['fetchmail_struct_hook']
- remove unused $CONF['users_domain_controle']
PFAHandler:
- new field types:
- enma - associative array (value => displayed value), must be specified in
the "options" column
- html - raw HTML, used for mailbox status markers which include HTML tags
- b64p - passwords stored as base64, used by FetchmailHandler
- vtxt, vnum - "virtual", read-only text/integer
- quot - formatted quota ("5/10", read-only)
- automatically skip quot, vtxt and vnum fields in store()
- add handling of users (non-admins), including permission checks
- add and use $this->label_field and $this->label for nicer messages
- add $this->order_by to allow ordering by any field(s)
- add getMsg() function (needed by list.php)
- add $msg['can_create'] (true by default, false will hide the 'create' button)
- add $is_superadmin to make admin vs. superadmin easier to handle
- add $can_edit and $can_delete (only available in edit/delete mode, set by
init() based on the '_can_edit' and '_can_delete' from database query)
- add $searchfields[] (list of fields to search by default, $search[_])
- add $this->msg['show_simple_search'] (true if $searchfields is non-empty)
- split off build_select_query() (also used for pagebrowser) from read_from_db()
and add support for $search['_'] (searching in $searchfields[])
- read_from_db(), getList(): add $searchmode parameter (_before_ $limit and
$offset!) to be able to use query different query modes, not only "="
- add getPagebrowser() (returns an array of pagebrowser keys)
AdminHandler:
- switch to using list.php (replaces list-admin.php)
DomainHandler:
- reduce required permissions to 'admin', restrict write operations to superadmins
- add optical quota indicators for aliases, mailboxes and domain quota
- fix counting of aliases for domains without any mailbox
- use list.php for displaying domain list (replaces list-domain.php)
MailboxHandler:
- check_quota(): deny creating an unlimited mailbox if domain quota is set
- storemore(): store maildir in the correct variable to fix running
mailbox_postedit script (bug#342)
AliasHandler:
- read_from_db_postprocess(): disable _can_edit and _can_delete for default
aliases if special_alias_control is off and not superadmin
- add 'status' column, move gen_show_status handling for aliases from
list-virtual into AliasHandler db_read_from_db_potprocess()
- change getList() to work with empty $condition
- add getPagebrowser() to filter out mailboxes
edit.php:
- Newer PHP versions (noticed with 5.6.6) don't include empty fields in
$_POST, which broke changing a field to empty. Make sure all !isset()
fields are set to ''.
- for not-set bool values, set $values instead of the (wrong) $inp_values
- add user (non-admin) mode
delete.php:
- allow users (non-admins) to use delete.php (not used in PostfixAdmin yet)
list-virtual:
- use AliasHandler, AliasdomainHandler and list.tpl for aliases and alias
domains (the mailbox list still uses the old code)
- replace $alias_pagebrowser_query and the create_page_browser() call
with $handler->getPagebrowser()
- adjust search to use ?search[_]=...
- drop $check_alias_owner variable and check_alias_owner() call
(replaced by the code added in AliasHandler)
misc:
- translation updates: cs (patch#126), pl (by marcin-github), sv (patch#128)
- add CliScheme.php to display the database scheme (for usage in upgrade.php)
- error_log() a warning if nameserver queries in check_domain() take more than 2
seconds in total
- add functions db_quota_text() and db_quota_percent() to generate SQL queries
for used quota ("x/y" and percentage)
- pacol(): replace $not_in_db with $multiopt - the remaining parameters can be
specified as associative array (backwards-compatible). Also add $linkto parameter
- db_where_clause(): add $additional_raw_where and $searchmode parameters,
split query into WHERE and HAVING
- delete no longer used check_alias_owner() function
- display "view log" menu entry only if logging is enabled (patch#127)
- smarty.inc.php assign(): additionally provide the unsanitized values as RAW_$key
- setup.php: after creating a superadmin, display a note that the setup is done
and it's possible to login now
- setup.php: stop relying on subversion keyword for database upgrades
- explictly set session_cache_limiter to nocache (bug#347)
- fetchmail.pl: honor the (newly added) active column
- change fetchmail.date field to date (no auto-update) (bug#351)
- several small changes and fixes at various places - too many to list them here
Version 3.0 beta2 (2.92) - 2014/10/28 - SVN r1706
-------------------------------------------------
- AliasHandler: don't clean goto field when making alias inactive (bug#316)
- list-virtual: display quota even if $CONF[used_quotas] == NO (bug#307)
- vacation.pl: fix postgresql queries in vacation.pl (bug#315)
- fix query in AliasHandler getList() which caused an empty list and breaks
deletion of aliases in MariaDB (bug#313, bug#325)
- fetchmail.pl: fix ssl extra options (cert check, cert path, fingerprint)
- fix logging (run setup.php to fix old log entries) (bug#317)
- fetchmail.php: change error_reporting() to exclude E_NOTICE (bug#322)
- translation updates: fr (patch#123), nl (patch#122)
- $CONF[default_aliases] can now use the new domain as alias target (patch#124)
- check that vacation start/end date are not in the past (patch#122)
- update vacation INSTALL.TXT with more secure locations
- update Smarty to 3.1.21
Version 3.0 beta1 (2.91) - 2014/05/06 - SVN r1670
-------------------------------------------------
Summary of major changes:
- new command-line interface "postfixadmin-cli"
- major rewrite:
- move lots of code into *Handler classes, which are used by web and
command-line interface
- replace various edit-*.php and create-*.php with a generic editform
(edit.php/editform.tpl)
- this also means it's easy to customize forms, add fields etc.
(see $CONF['*_struct_hook'])
- lots of code cleanup, remove/merge lots of duplicated code and templates
- use smarty for templates
- add ability to choose activation date, end date and reply interval for
vacation message
- various enhancements everywhere
- redesign login page, list and edit pages (goodbye, green!) and make them wider
- several new config options and changed defaults
- NOTE: changes from the 2.3.x releases also apply to this version
new config options:
- $CONF['language_hook']
Hook function to override or add translations to $PALANG.
Example hook function included (commented out).
- $CONF['password_validation'] - array with regular expressions to check
if a password is valid/good enough.
The default configuration enforces:
- minimum length 5 characters/digits/whatever
- at least 2 characters
- at least 2 digits
- $CONF['*_struct_hook'] - make $struct in the *Handler classes customizeable
- $CONF['vacation_choice_of_reply'] - list of reply interval options
- $CONF['domain_quota'] - total quota per domain
- $CONF['theme_custom_css'] - to add some custom CSS without editing the
default CSS file
- $CONF['motd_*'] - replaces motd*.txt
changed config defaults (with their new default value):
- $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
- $CONF[*_post*_script] - add empty defaults
- $CONF['admin_email'] = ''
IMPORTANT: If set, this will be used as mail sender for all mails
(2.3.x used the currently logged in admin's username in most cases).
$CONF['admin_email'] = '' will match the 2.3.x behaviour.
removed config options:
- $CONF['min_password_length'] - now handled in /.{5}/ in
$CONF['password_validation']
- $CONF['postfix_admin_url'] - relative paths are now used everywhere
list-virtual.php:
- display percentage of quota usage
- display alias domains less confusing (using From/To)
- list-virtual can now display only mailboxes, only aliases or only alias
domains - or all in one page as in 2.3
- extreme speedup of page browser in list-virtual if a large number of
mailboxes or aliases exist
- include search support (replaces search.php and brings various bug fixes
for free)
- fix: delivery to mailbox with a recipient delimiter (mailbox+foo@domain)
was marked as "forward only"
- fix: don't mark mailboxes with vacation active as undeliverable
- fix: undeliverable targets were not flagged if another target pointed to a
domain in $CONF[show_undeliverable_exceptions]
fetchmail.php, fetchmail.pl:
- add sslcertck, sslcertpath, sslfingerprint fields/check
(sslcertpath and sslfingerprint require $CONF[fetchmail_extra_options]
because they don't have input validation)
functions.inc.php
- allowed_quota: if $CONF[quota] == NO, just return 0 (unlimited)
- authentification_get_username() - honor POSTFIXADMIN_SETUP to avoid
a redirect to login.php after creating an admin with setup.php and to
get "SETUP.PHP" for db_log()
- check_domain(), check_email(): instead of calling flash_error(),
return string with error message - or empty string if everything is ok
- check_email():
- replace $CONF[vacation_domain] only at the end of the mail address
- don't trim() mail address to avoid that aliases starting with a space are
allowed. This fixes http://sourceforge.net/p/postfixadmin/bugs/210/
- check_language(): remove things like ";q=0.8" before checking if
a language exists
- check_owner():
- escape_string() $username and $domain to prevent SQL injections
- db_pgsql() - new function to replace lots of
"if ($CONF[database_type] == 'pgsql')) checks
- db_delete(): allow to specify additional conditions for the WHERE clause
- db_get_boolean(): allow 0 and 1 as parameters, not only boolean true/false
- db_log():
- allow log actions create_admin and edit_admin
- add edit_admin_state and delete_admin as comment/reminder that they
should also be logged
- db_query(): error_log() failed query
- db_where_clause($condition, $struct) - new function to create a WHERE clause
(bool values are converted with db_get_boolean() based on $struct)
- _flash_string():
- also accept an array of messages, not only a string
- html-escape messages to fix XSS if the message contains user-supplied input
- generate_password(): make generated password always 8 chars long
(instead of $CONF['min_password_length'])
- get_domain_properties(): use DomainHandler (function result mostly
unchanged, only difference: instead of quota_sum in bytes it now
returns total_quota in MB)
- list_domains_for_admin():
- rewrite to work for superadmins also (will list all domains now
instead of "ALL"), which means we can drop the admin vs. superadmin
check at various places
- pacrypt():
- no longer escape_string() the result. This fixes
http://sourceforge.net/p/postfixadmin/bugs/218/
- for 'system' encryption, use full hashed password as salt
https://sourceforge.net/p/postfixadmin/bugs/2/
- dovecot:*:
- add support for dovecot *-CRYPT passwords (needs dovecot >= 2.1)
- allow "." in dovecot method (to allow a suffix like ".b64")
- Also, the {METHOD} part is no longer removed (passwords without
{METHOD} still work)
- remove_from_array() - new function
- safesession() - new function (like safeget(), but for $_SESSION)
- smtp_mail(): error_log() the error message if fsockopen() fails
- table_by_key() now always prepends $CONF['database_prefix']
NOTE: If you have/had an incomplete database_tables array and use
$CONF['database_prefix'], you might need to rename the affected tables
manually (add the database_prefix in their name).
- moved several functions to the *Handler classes
- deleted no longer used functions:
- admin_exist()
- authentication_is_admin()
- authentication_is_user()
- boolconf() (moved to Config::bool())
- check_string()
- create_admin()
- check_alias() (moved to AliasHandler->create_allowed())
- db_boolean_to_int()
- domain_exist()
- get_admin_properties()
- get_mailbox_properties()
- get rid of global $table_* variables, use table_by_key() instead
PFAHandler.php:
- parent class for all *Handler classes
- contains code shared between all classes
AdminHandler.php:
- Handler class for admins
- for now, set the superadmin column and add "ALL" in domain_admins to
keep the database backwards-compatible with 2.3.x
AdminpasswordHandler.php:
- used for the "change password" form for admins
DomainHandler.php
- handler class for domains
- delete(): do not allow to delete a domain if it is an alias domain target
AliasdomainHandler.php:
- handler class for alias domains
- alias domains can now be edited
AliasHandler.php:
- rewrite based on PFAHandler
- we even get a "deliver to local mailbox" checkbox :-)
- only allow @domain as target if $this->id is a catchall
- remove deprecated functions:
- get()
- hasStoreAndForward()
- update()
- is_mailbox_alias()
- is_vacation_address()
- hasAliasRecord()
MailboxHandler (previously named UserHandler in 2.3):
- rewrite based on PFAHandler
- drop old __construct(), view() and change_pass()
- replace check of old password in change_pw() with $this->login
- delete(): also cleanup fetchmail, quota and quota2 tables
- always check password with validate_password()
- always display correct available quota (using allowed_quota())
- do not escape the password coming from $_POST. Fixes
http://sourceforge.net/p/postfixadmin/bugs/218/
VacationHandler:
- rewrite based on PFAHandler (not useable yet)
- add ability to choose activation date, end date and reply interval for
vacation message - http://sourceforge.net/p/postfixadmin/patches/111/
vacation.pl:
- allow to use original subject in vacation reply subject ("Re: $SUBJECT")
http://sourceforge.net/p/postfixadmin/patches/117/
- encode subject - https://sourceforge.net/p/postfixadmin/bugs/272/ ,
https://sourceforge.net/p/postfixadmin/patches/119/
- add a friendly from address to vacation messages ($friendly_from)
- make error handling if we cannot send the reply more robust
- add $smtp_client config option to specify the helo name
- added custom noreply detection ($noreply_pattern, $custom_noreply_pattern)
Config.php
- new class to store $CONF
- also used to store $PALANG texts (Config::Lang())
- contains functions to read config entries in various ways (bool etc.)
edit.php
- generic edit page for everything (admins, domains, mailboxes, aliases, ...)
- use ?table= parameter to decide what will be edited (basically $tableHandler)
- read handler-specific configuration from $handler->webformConfig()
and use it at various places
- always redirect to edit.php?table=$table after adding an item to
ensure correct initialization for next item
- call $handler->mergeId if $id_field is editable, but not displayed
in form (usecase: merge localpart + domain to address)
- set $form_fields and $id_field later (after $hander->init()) - needed
for AliasHandler to decide if goto_mailbox should be displayed
- only set $values if a field is editable and displayed in the form
editform.tpl:
- generic edit form template, uses $struct to render the form
- implement handling of 'list' fields (<select> with multiple choices
allowed)
- also include alternative implementation with checkboxes (commented out)
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.)
- change {BIGINT} to include "NOT NULL DEFAULT 0"
- upgrade_1283(): add a "superadmin" column to the admin table
This is the first step to get rid of the "ALL" dummy domain.
- upgrade_1284(): migrate the ALL domain to the superadmin column
Note: The ALL domain is not (yet) deleted to stay backwards-compatible
for now (will be done in a later upgrade function)
- change {BOOLEAN} to include "default false"
login.php
- when login.php is requested, logout the current admin/user
https://sourceforge.net/p/postfixadmin/bugs/284/
- this also means login.php is now used for logout
- error_log() failed login attemps
https://sourceforge.net/p/postfixadmin/feature-requests/111/
delete.php, editactive.php:
- require token for CSRF protection, see
https://sourceforge.net/p/postfixadmin/bugs/269/
xmlrpc.php:
- adopt to *Handler syntax
- setAway(): add (optional) new parameters for interval_time, activeFrom and
activeUntil - https://sourceforge.net/p/postfixadmin/patches/113/
- change $_SESSION['username'] to $_SESSION['sessid']['username']
*.lang:
- get rid of several duplicate texts
- removed HTML tags from $PALANG texts
- several translation updates
documentation updates:
- SECURITY.TXT: add note about templates_c directory
- DOCUMENTS/POSTFIX_CONF.TXT is now executable and can generate the
mysql_*.cf maps for postfix
- update DOCUMENTS/DOVECOT.TXT for dovecot 2.x
squirrelmail plugin:
- various bugfixes
- documentation update
Debian packaging:
- Changed source format to 3.0 (quilt)
- simplified the DB credential patch and removing ucf registrations on package
purge...
- control: added php5-cli dependency
- rules:
- some permission fixes to postfixadmin-cli scripts
- New target prep: Create a needed tar.gz file to build a non-nativ .dpkg
- New target build-package: Call this target to build a shiny new .dpkg file
- postfixadmin.docs: removed redundant changelog file
- debian/postfixadmin.postrm: Call wwwconfig scripts only if they are existing
Version 2.3.8 - 2015/10/07 - SVN r1814 (postfixadmin-2.3 branch)
----------------------------------------------------------------
- fix query to enable/disable alias in edit-mailbox for PostgreSQL (#311)
- don't prefill username in users/ login on failed logins - fixes (probably
harmless) XSS
- fix show_gen_status() to properly escape mail addresses in query (#356)
- fix escaping in create-admin, create-mailbox and fetchmail templates -
fixes (harmless) XSS on form validation errors
- don't echo the password back to the browser in the fetchmail form
- allow MariaDB in Debian package dependencies
Version 2.3.7 - 2014/02/20 - SVN r1651 (postfixadmin-2.3 branch)
----------------------------------------------------------------
- SECURITY: fix SQL injection in show_gen_status()
- lt.lang, da.lang translation update
- when enabling/disabling a mailbox, also update the corresponding alias
- fix creating superadmin in setup.php with MariaDB (more strict SQL)
- don't trim() mail address to avoid that aliases starting with a space are
allowed. This fixes http://sourceforge.net/p/postfixadmin/bugs/210/ and
https://sourceforge.net/p/postfixadmin/feature-requests/113/
- update regex in check_domain() to support new, longer TLDs like .international
- mark vacation_notification.notified field as latin1 to avoid overlong index
- vacation.pl: encode subject
- vacation.pl: disable use of TLS by default due to a bug in Mail::Sender 0.8.22
(you can re-enable it with $smtp_tls_allowed)
Version 2.3.6 - 2013/01/02 - SVN r1417 (postfixadmin-2.3 branch)
----------------------------------------------------------------
- display domain and mailbox description with correct encoding
- fix footer link
- focus username input field in login form
- fix double inclusion of config.inc.php in setup.php
- fix bool and date handling in fetchmail
Version 2.3.5 - 2012/01/16 - SVN r1335 (postfixadmin-2.3 branch)
----------------------------------------------------------------
- fix SQL injection in pacrypt() (if $CONF[encrypt] == 'mysql_encrypt')
- fix SQL injection in backup.php - the dump was not mysql_escape()d,
therefore users could inject SQL (for example in the vacation message)
which will be executed when restoring the database dump.
WARNING: database dumps created with backup.php from 2.3.4 or older might
contain malicious SQL. Double-check before using them!
- fix XSS with $_GET[domain] in templates/menu.php and edit-vacation
- fix XSS in some create-domain input fields
- fix XSS in create-alias and edit-alias error message
- fix XSS (by values stored in the database) in fetchmail list view,
list-domain and list-virtual
- create-domain: fix SQL injection (only exploitable by superadmins)
- add missing $LANG['pAdminDelete_admin_error']
- don't mark mailbox targets with recipient delimiter as "forward only"
- wrap hex2bin with function_exists() - PHP 5.3.8 has it as native function
Version 2.3.4 - 2011/09/16 - SVN r1180 (postfixadmin-2.3 branch)
----------------------------------------------------------------
- generate more secure random passwords
- squirrelmail plugin: fix typo in variable name
- list-domain: fix SELECT query to work with PgSQL even when using custom fields
- create-domain: force domain name to lowercase to avoid problems with PgSQL
foreign keys
- fix vacation.pl to log to "mail" syslog facility
- error_log() dovecotpw error messages
Version 2.3.3 - 2011/03/14 - SVN r1010 (postfixadmin-2.3 branch)
----------------------------------------------------------------
- create-alias: allow multiple alias targets
- create-alias, edit-alias: prevent input data loss on validation errors
- list-virtual: fix displaying of 'modified' column for aliases when using
postgres
- replaced deprecated split() with preg_split() or explode()
- functions.inc.php: better error messages when database functions are missing
- create domain: fixed typo in variable name that broke the default value for
default aliases
- postgres: changed mailbox.quota, domain.quota and domain.maxquota fields
to bigint to allow mailboxes >4 GB (run setup.php to upgrade your database)
- vacation.pl logged literal $variable instead of the variable content at two
places
- edit-vacation: log enabling/disabling vacation if done by admins
- POSTFIX_CONF.txt: fixed filename for quota map
- config.inc.php: removed double $CONF['database_prefix']
- config.inc.php: fixed comments about domain_post* script parameters
- updated INSTALL.TXT and UPGRADE.TXT
- sk translation update
- some more minor fixes
Version 2.3.2 - 2010/08/24 - SVN r860 (postfixadmin-2.3 branch)
---------------------------------------------------------------
- SUMMARY: PostfixAdmin 2.3.2 is a bugfix-only release for Postfix Admin 2.3.1
- SECURITY: attackers could find out if a admin exists (login pre-filled the
username after "only" a wrong password was entered)
- SECURITY: fix sql injection in list-domain (only exploitable by superadmins)
- alias targets in users/edit-alias are now validated
- invalid alias targets in users/edit-alias are shown to the user again
instead of dropping them
- fix dovecot:* password encryption (was broken in 2.3.1)
- fix displaying used quota for dovecot <= 1.1 (was broken in 2.3.1)
- when deleting a domain that is an alias domain (on the "from" side), the
alias domain is deleted
Version 2.3.1 - 2010/07/09 - SVN r847 (postfixadmin-2.3 branch)
---------------------------------------------------------------
- SUMMARY: PostfixAdmin 2.3.1 is a bugfix-only release for Postfix Admin 2.3.
The only visible change is displaying the alias target for mailboxes which
was a longstanding issue/"missing feature".
The ADDITIONS directory contains some new scripts.
- SECURITY: users could bypass checking the old password when changing the
password by entering a too short new password. Fortunately only
"exploitable" by authentificated users.
- merge in changes to /debain (thanks normes) from trunk
- display alias targets for mailboxes (if $CONF['special_alias_control'] = YES)
- add hook for custom maildir path generation
- add import_users_from_csv.py script (by Simone Piccardi)
- add mailbox_post* scripts for cyrus
- handle dovecot passwords without any tempfile (prevents safe_mode issues)
- fix MySQL 6.0 compatibility
- fix quota display (for dovecot >= 1.2)
- fix short open tags ("<?")
- translation updates and fixes
- documentation updates and fixes
- document commandline parameters for $CONF[*_script] options in config.inc.php
- list-virtual: added error message if the check_owner query returns more
than one result (can happen with pre-2.3 databases and prevents access for
superadmins)
- add in_array() check to avoid that superadmins can enter invalid domains
- fix delete link for alias domains (when on target domain)
- delete values from quota and quota2 table when deleting a mailbox
- fix hardcoded table names in list-domain.php
- fixed edit-alias.php not to drop alias to the mailbox if
special_alias_control = NO
- fix alias handling for mailboxes (special_alias_control vs.
alias_control_admin confusion)
- fix typo in upgrade.php that broke index creation and deletion when using
non-default table names
- fix creating 'ALL' domain (dummy for superadmins) when using non-default
table names
- fix: db_query did not return number of SELECTed rows if query starts with
with whitespace
- check for $CONF['encrypt'] = 'dovecot:md5-crypt' (postfixadmin login not
working because dovecotpw uses a new salt each time), recommend
internal md5crypt instead
- replaced terribly outdated, broken squirrelmail plugin with a fresh version.
Note: The new plugin version requires the Zend framework.
Version 2.3 - 2009/10/24 - SVN r739
-----------------------------------
@ -19,7 +702,7 @@ Version 2.3 - 2009/10/24 - SVN r739
- changed vacation.pl syslog facility from "user" to "mail"
- added config option for postregsql database port
- added config option to enable/disable XMLRPC interface (default: off)
- Fix check/query for alias with enabled vacation in vacation.pl
- Fix check/query for alias with enabled vacation in vacation.pl
- Fix db_get_boolean() to return t/f for postgresql, not true/false
- Fix missing quoting for boolean values in SQL queries at various places
- Allow SHA courier-authlib passwords
@ -44,7 +727,7 @@ Version 2.3rc5 - 2009/05/20 - SVN r658
- Improvements to the setup process
- Far better Debian packaging (we hope!) which should make installation much, much easier.
- Various bug fixes
- Various bug fixes
- Performance enhancements (or we fixed the regressions ...) in domain listing etc.
Version 2.3rc4 - 2009/04/18 - SVN r632
@ -56,7 +739,7 @@ Version 2.3rc4 - 2009/04/18 - SVN r632
to this page. Password is encrypted, and setup.php can be used to generate the initial value.
- Fix undefined variables problem(s)
- Fix PostgreSQL date timestamp issues...
Version 2.3rc3 - 2009/04/06 - SVN r611
--------------------------------------
@ -69,7 +752,7 @@ Version 2.3rc2 - 2009/02/03 - SVN r593
- Refactor /users (see /model) and provide XmlRpc interface for remote mail clients
(e.g. squirrelmail-postfixadmin)
- Add dovecotpw support - see:
- Add dovecotpw support - see:
https://sourceforge.net/tracker/index.php?func=detail&aid=2607332&group_id=191583&atid=937966
- Add unit tests for model/ directory (see /tests)
- Add additional scripts to ADDITIONS
@ -84,9 +767,9 @@ Version 2.3 Beta - 2009/01/15 - SVN r527
-----------------------------------------
- added support for domain aliases (from lenix) (can be disabled with $CONF['alias_domain'])
Important: If you update from a previous version, you'll have to adapt your postfix
configuration (see DOCUMENTS/POSTFIX_CONF.txt) - or just disable alias domain support,
your postfix configuration will continue to work
Important: If you update from a previous version, you'll have to adapt your postfix
configuration (see DOCUMENTS/POSTFIX_CONF.txt) - or just disable alias domain support,
your postfix configuration will continue to work
- updated postfix example configuration for domain aliases and to use the new mysql map format
- vacation.pl:
- add option for re-notification after definable timeout (patch from Luxten)
@ -106,7 +789,7 @@ Version 2.3 Beta - 2009/01/15 - SVN r527
- added clear error message for non-resolvable domains when creating mailboxes or aliases
- check for non-resolvable domains on domain creation
- new option $CONF['create_mailbox_subdirs_prefix'] for compatibility with more IMAP servers
- added support for mysql encrypt() password encrpytion
- added support for mysql encrypt() password encrpytion
- fix "illegal mix of collations" problem in MySQL by explicitely setting the charset everywhere
- fix: cleanup vacation_notification table when disabling vacation
- fix: config and fetchmail tables now honor $CONF['database_tables']
@ -169,20 +852,20 @@ Version 2.2.0 - 2008/04/29
- Added: Slovakian language posted on SourceForge by eszabo
- Changed: searches include mailbox.name matches (GregC)
- Fixed: function check_email will ignore vacation_domain if vacation==YES (GregC)
- Changed: applied patches from Christian Boltz posted at
- Changed: applied patches from Christian Boltz posted at
http://www.cboltz.de/tmp/postfixadmin-3.patch, referenced at
https://sourceforge.net/tracker/index.php?func=detail&aid=1696647&group_id=191583&atid=937966 (GregC)
- Added: main.php to admin dirctory (GregC)
- Added: Item "Main" on admin menu (GregC)
- Changed: Edit-vacation now edits for admins/superadmins (GregC)
- Added: Do not store local copy when forward mail. (Mihau) [24]
- Added: Do not store local copy when forward mail. (Mihau) [24]
- Added: Virtual Vacation for PostgreSQL. (Tarvin)
- Added: Virtual Vacation 3.2 (Thanx David)
- Added: SUBJECT tag for Virtual Vacation.
- Added: SUBJECT tag for Virtual Vacation.
- Added: Dovecot setup document for Postfix Admin. (Thanx Massimo)
- Added: SquirrelMail plugin to change_password.
- Changed: Starting to merge /admin in root. (Mihau)
- Changed: Moved some TXT files to DOCUMENTS.
- Changed: Moved some TXT files to DOCUMENTS.
- Changed: Updated tw.lang. (Thanx Bruce)
- Fixed: Usage of mysql_real_escape_string(). (Mihau)
- Fixed: Calculating of quotas. (Mihau)
@ -380,7 +1063,7 @@ Version 1.5.1 -- 2003/06/04
- Added: Option to completely control the stored aliases. (Thanx Alex)
- Changed: config.inc.php is renamed to config.inc.php.sample. (Thanx Alex)
- Fixed: $PHP_SELF in config.inc.php and my_lib.php. (Thanx Jim)
Version 1.5.0 -- 2003/05/28
----------------------------
@ -431,3 +1114,6 @@ Version 1.3.8 -- 2003/03/25
Version 1.3.7 -- 2002/12/24
----------------------------
- Initial public release of Postfix Admin.
# vim: set expandtab softtabstop=2 tabstop=2 shiftwidth=2:

@ -2,6 +2,7 @@
# Dovecot configuration for Postfix Admin
# Originally written by: Massimo <AndyCapp> Danieli
# Revised by: Sampsa Hario <shario> for Dovecot v1.0
# Revised by: David Goodwin <david@palepurple.co.uk> for Dovecot 2.1.x (2014/01/02)
#
More complete Dovecot documentation:
@ -10,7 +11,9 @@ http://wiki.dovecot.org/Quota
http://wiki.dovecot.org/Quota/Dict
http://www.opensourcehowto.org/how-to/mysql/mysql-users-postfixadmin-postfix-dovecot--squirrelmail-with-userprefs-stored-in-mysql.html
Here are the relevant parts of Dovecot v1.0.x configuration for Postfixadmin setup.
Here are the relevant parts of Dovecot v2.1.x configuration for Postfixadmin setup.
Please refer to Dovecot documentation for complete information.
The setup gets userdb and passdb info from MySQL as well as quotas, and
@ -21,32 +24,96 @@ be viewed real-time in Postfixadmin.
1. Dovecot setup
-----------------
default_mail_env = maildir:/usr/local/virtual/%u/
A basic /etc/dovecot/dovecot.conf is as follows, this was generated using 'dovecot -n' on a vanilla install and then
changing to talk to a PostgreSQL or MySQL database.
auth default {
userdb sql {
# Path for SQL configuration file, see doc/dovecot-sql-example.conf
args = /etc/dovecot-mysql.conf
# BEGIN /etc/dovecot/dovecot.conf:
# Change this to where your mail root is, this needs to match whatever structure postfix expects....
# See also: https://wiki.dovecot.org/MailLocation - %d domain, %u full username, %n user part (%u with no domain)
mail_location = maildir:/var/mail/vmail/%u/
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
passdb sql {
# Path for SQL configuration file, see doc/dovecot-sql-example.conf
args = /etc/dovecot-mysql.conf
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
# Valid UID range for users, defaults to 500 and above.
first_valid_uid = 1001 # Change this to your postfix UID
protocols = "imap pop3"
# change to 'no' if you don't have ssl cert/keys, and comment out ssl_cert/ssl_key
ssl = yes
ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
# login is for outlook express smtpd auth
auth_mechanisms = plain login
# If you're having trouble, try uncommenting these:
#auth_debug = yes
#auth_debug_passwords = yes
userdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf
}
passdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf
}
# Uncomment this if you want Postfix to be able to do smtpd auth through dovecot
# At a minimum Postfix probably needs smtpd_sasl_type = dovecot
# And additionally: smtpd_sasl_path = private/auth
#service auth {
# unix_listener /var/spool/postfix/private/auth {
# mode = 0660
# user = postfix
# group = postfix
# }
#}
# Needs to match Postfix virtual_uid_maps
first_valid_uid = 1001
# allow plaintext auth (change to 'yes' to block plaintext passwords)
disable_plaintext_auth = no
#END
2. Dovecot mysql setup
2. Dovecot *sql setup
----------------------
Below you'll find the relevant part of dovecot-mysql.conf file regarding our
setup. Things you may need to change are db_password, uid and gid:
Below you'll find the relevant part of dovecot-sql.conf file regarding our
setup.
Things you will probably need to change are db connection settings (connect=)
and the default_pass_scheme.
#BEGIN /etc/dovecot/dovecot-sql.conf
connect = host=localhost dbname=postfix user=postfix password=postfix
# Use either
driver = mysql
# Or
# driver = pgsql
# Default password scheme.
# Default password scheme - change to match your Postfixadmin setting.
# depends on your $CONF['encrypt'] setting:
# md5crypt -> MD5-CRYPT
# md5 -> PLAIN-MD5
@ -58,11 +125,18 @@ default_pass_scheme = MD5-CRYPT
password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' AND active='1'
# Query to retrieve user information.
# Query to retrieve user information, note uid matches dovecot.conf AND Postfix virtual_uid_maps parameter.
# MYSQL:
user_query = SELECT CONCAT('/var/mail/vmail/', maildir) AS home, 1001 AS uid, 1001 AS gid,
CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = '%u' AND active='1'
# PostgreSQL:
# user_query = SELECT '/var/mail/vmail/' || maildir AS home, 1001 AS uid, 1001 AS gid,
# '*:bytes=' || quota AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
#END /etc/dovecot/dovecot-sql.conf
user_query = SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox WHERE username = '%u' AND active='1'
NB! The GID and UID are for postfix user and group ID, NOT MySQL user and group ID.
3. Dovecot v1.0 quota support (optional)
@ -76,7 +150,7 @@ Add to dovecot.conf:
## IMAP quota
protocol imap {
quota = dict:storage=200000 proxy::quota
mail_plugins = quota
}
## POP quota
@ -100,12 +174,18 @@ quota = dict:storage=200000 proxy::quota
}
Change dovecot-mysql.conf to return quota values:
Change dovecot-sql.conf to return quota values:
for MySQL:
user_query = SELECT maildir, 1001 AS uid, 1001 AS gid, CONCAT('dict:storage=',floor(quota/1000),' ::proxy::quota') as quota FROM mailbox WHERE username = '%u' AND active='1'
user_query = SELECT maildir, 1001 AS uid, 1001 AS gid, CONCAT('dict:storage=',floor(quota/1000),' proxy::quota') as quota FROM mailbox WHERE username = '%u'
for PostgreSQL:
user_query = SELECT maildir, 1001 AS uid, 1001 AS gid, 'dict:storage=' || floor(quota/1000) || '::proxy::quota' as quota FROM mailbox WHERE username = '%u' AND active='1'
Create file dovecot-dict-quota.conf:
Create file dovecot-dict-quota.conf.
For dovecot 1.0 & 1.1, use this as a template:
driver = mysql
connect = host=localhost dbname=postfix user=postfix password=postfix
@ -115,6 +195,22 @@ select_field = current
where_field = path
username_field = username
If you use dovecot 1.2 or newer, use this:
connect = host=localhost dbname=postfix user=postfix password=postfix
map {
pattern = priv/quota/storage
table = quota2
username_field = username
value_field = bytes
}
map {
pattern = priv/quota/messages
table = quota2
username_field = username
value_field = messages
}
Create database in Mysql:
(This is automatically done by postfixadmin's setup.php)
@ -129,3 +225,4 @@ Note: The above text describes the configuration for dovecot 1.0 & 1.1 quota tab
If you use dovecot 1.2 or newer,
- use the 'quota2' table (also created by setup.php)
- set $CONF['new_quota_table'] = 'YES'

@ -1,3 +1,5 @@
#!/bin/bash
content="
Postfix configuration for use with PostfixAdmin
@ -18,14 +20,17 @@ virtual_mailbox_maps =
proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,
proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
# Additional for quota support
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his
diskspace quota, please try again later.
virtual_overquota_bounce = yes
# For transport map support, also use the following configuration:
relay_domains = proxy:mysql:/etc/postfix/sql/mysql_relay_domains.cf
transport_maps = proxy:mysql:/etc/postfix/sql/mysql_transport_maps.cf
# Also set the config.inc.php setting transport=YES
# and add the transport choices to transport_options.
# if you let postfix store your mails directly (without using maildrop, dovecot deliver etc.)
virtual_mailbox_base = /var/mail/vmail
# or whereever you want to store the mails
Where you chose to store the .cf files doesn't really matter, but they will
have database passwords stored in plain text so they should be readable only
@ -40,10 +45,21 @@ autoreply features.
Contents of the files
These are examples only, you will likely have to and want to make some
cumtomizations. You will also want to consider the config.inc.php
customizations. You will also want to consider the config.inc.php
settings for domain_path and domain_in_mailbox. These examples
use values of domain_path=YES and domain_in_mailbox=NO
You can create these files (with your values for user, password, hosts and
dbname) automatically by executing this file (sh POSTFIX_CONF.txt).
Please note that the generated files are for use with MySQL.
If you are using PostgreSQL, you'll need to do some changes to the queries:
- PostgreSQL uses a different implementation for boolean values, which means
you'll need to change active='1' to active='t' in all queries
- PostgreSQL does not have a concat() function, instead use e.g.
.... alias.address = '%u' || '@' || alias_domain.target_domain AND ....
mysql_virtual_alias_maps.cf:
user = postfix
password = password
@ -57,17 +73,15 @@ user = postfix
password = password
hosts = localhost
dbname = postfix
query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'
query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active='1' AND alias_domain.active='1'
(Note: PostgreSQL does not have a concat() function, instead use e.g. .... alias.address = '%u' || '@' || alias_domain.target_domain AND ....)
mysql_virtual_alias_domain_catchall_maps.cf:
# handles catch-all settings of target-domain
user = postfix
password = password
hosts = localhost
dbname = postfix
query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'
query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active='1' AND alias_domain.active='1'
(See above note re Concat + PostgreSQL)
@ -80,6 +94,8 @@ query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'
#query = SELECT domain FROM domain WHERE domain='%s'
#optional query to use when relaying for backup MX
#query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1'
#optional query to use for transport map support
#query = SELECT domain FROM domain WHERE domain='%s' AND active = '1' AND NOT (transport LIKE 'smtp%%' OR transport LIKE 'relay%%')
#expansion_limit = 100
mysql_virtual_mailbox_maps.cf:
@ -95,14 +111,28 @@ user = postfix
password = password
hosts = localhost
dbname = postfix
query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active='1'
query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active='1' AND alias_domain.active='1'
mysql_relay_domains.cf:
user = postfix
password = password
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s' AND active = '1' AND (transport LIKE 'smtp%%' OR transport LIKE 'relay%%')
mysql_transport_maps.cf:
user = postfix
password = password
hosts = localhost
dbname = postfix
query = SELECT transport FROM domain WHERE domain='%s' AND active = '1'
(See above note re Concat + PostgreSQL)
# For quota support
mysql-virtual-mailbox-limit-maps.cf:
mysql_virtual_mailbox_limit_maps.cf:
user = postfix
password = password
hosts = localhost
@ -116,4 +146,47 @@ query = SELECT quota FROM mailbox WHERE username='%s' AND active = '1'
http://postfix.wiki.xs4all.nl/index.php?title=Virtual_Users_and_Domains_with_Courier-IMAP_and_MySQL
http://wiki.dovecot.org/HowTo/DovecotLDAPostfixAdminMySQL
" # end content
# generate config files out of this file
# to do this, run sh POSTFIX_CONF.txt
POSTFIX_CONF="$0"
map_files="`sed -n '/^mysql.*cf:/ s/://p' < \"$0\"`"
tmpdir="`mktemp -d /tmp/postfixadmin-XXXXXX`" || { echo "Error: could not create tempdir" >&2 ; exit 1; }
echo $tmpdir
echo 'Database host? (often localhost)'
read hosts
test -z "$hosts" && hosts=localhost
echo 'Database name?'
read dbname
test -z "$dbname" && { echo "Error: you did not enter a database name" >&2 ; exit 1; }
echo Database user?
read user
test -z "$user" && { echo "Error: you did not enter a database username" >&2 ; exit 1; }
echo Database password?
read password
test -z "$password" && { echo "Error: you did not enter a database password" >&2 ; exit 1; }
for file in $map_files ; do
(
echo "# $file"
sed -n "/$file:/,/^$/ p" < "$POSTFIX_CONF" | sed "
1d ; # filename
s/^user =.*/user = $user/ ;
s/^password =.*/password = $password/ ;
s/^hosts =.*/hosts = $hosts/ ;
s/^dbname =.*/dbname = $dbname/ ;
"
) > "$tmpdir/$file"
done
echo "Config files have been written to $tmpdir. Please check their content and move them to /etc/postfix/sql/."
echo "Do not forget to edit /etc/postfix/main.cf as described in $POSTFIX_CONF."

@ -0,0 +1,221 @@
# Example configuration
The below covers some default(ish) configuration things for using Postfix, Dovecot with PostgreSQL.
# Postfix
Assumptions :
* Mail is delivered into /var/mail/vmail/foo@example.com/
* The user with id 8 is used for ownership of mail files.
* PostgreSQL is running on the local server
* Dovecot is running on the local server, and SASL is used to allow authenticated clients to mail out.
## /etc/postfix/main.cf
The proxy: bits are optional, you may need to install an additional postfix package on your server to enable them.
i.e. proxy:pgsql:/path/to/file is equivalent to pgsql:/path/to/file. Use of 'proxy:' may lead to a small performance boost.
```
relay_domains = $mydestination, proxy:pgsql:/etc/postfix/pgsql/relay_domains.cf
virtual_alias_maps = proxy:pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf
virtual_mailbox_domains = proxy:pgsql:/etc/postfix/pgsql/virtual_domains_maps.cf
virtual_mailbox_maps = proxy:pgsql:/etc/postfix/pgsql/virtual_mailbox_maps.cf
virtual_mailbox_base = /var/mail/vmail
virtual_mailbox_limit = 512000000
virtual_minimum_uid = 8
virtual_transport = virtual
virtual_uid_maps = static:8
virtual_gid_maps = static:8
local_transport = virtual
local_recipient_maps = $virtual_mailbox_maps
```
and for Postfix SASL support :
```
# SASL Auth for SMTP relaying
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_authenticated_header = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
```
## /etc/postfix/pgsql/relay_domains.cf
```
user = postfix
password = whatever
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s' and backupmx = true
```
## /etc/postfix/pgsql/virtual_alias_maps.cf
```
user = postfix
password = whatever
hosts = localhost
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND active = true
```
## /etc/postfix/pgsql/virtual_domains_maps.cf
```
user = postfix
password = whatever
hosts = localhost
dbname = postfix
#query = SELECT domain FROM domain WHERE domain='%s'
#optional query to use when relaying for backup MX
query = SELECT domain FROM domain WHERE domain='%s' and backupmx = false and active = true
```
## /etc/postfix/pgsql/virtual_mailbox_limits.cf
```
# Used for quota
user = postfix
password = whatever
hosts = localhost
dbname = postfix
query = SELECT quota FROM mailbox WHERE username='%s'
```
## /etc/postfix/pgsql/virtual_mailbox_maps.cf
```
user = postfix
password = whatever
hosts = localhost
dbname = postfix
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = true
```
# Dovecot
(This is from version 2.2.27, Debian Stretch)
## /etc/dovecot/dovecot.conf
```
mail_location = maildir:/var/mail/vmail/%u/
namespace inbox {
type = private
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
protocols = "imap pop3"
# Requires certificates ...
#ssl = yes
#ssl_cert = </etc/dovecot/private/something.pem
#ssl_key = </etc/letsencrypt/certs/something.key
login_greeting = My Mail Server
# http://wiki2.dovecot.org/Authentication/Mechanisms
# login is for outlook express ...
auth_mechanisms = plain login
#auth_debug = yes
#auth_debug_passwords=yes
# Postfix - Sasl auth support.
service auth {
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
# Auth process is run as this user.
user = postfix
group = postfix
}
service imap {
executable = imap
}
userdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf
}
passdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf
}
# Needs to match Postfix virtual_uid_maps
first_valid_uid = 8
# disallow or allow plaintext auth.
disable_plaintext_auth = yes
mail_plugins = $mail_plugins zlib
plugin {
zlib_save_level = 6
zlib_save = gz
}
protocol imap {
mail_plugins = $mail_plugins imap_zlib
}
mail_max_userip_connections = 50
log_path = /var/log/dovecot.log
```
## /etc/dovecot/dovecot-sql.conf
Ideally dovecot has a different read only database user.
```
connect = host=localhost dbname=postfix user=dovecot password=whatever
driver = pgsql
# Default password scheme - change to match your Postfixadmin setting.
# depends on your $CONF['encrypt'] setting:
# md5crypt -> MD5-CRYPT
# md5 -> PLAIN-MD5
# cleartext -> PLAIN
default_pass_scheme = MD5-CRYPT
# Query to retrieve password. user can be used to retrieve username in other
# formats also.
password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' AND active='1'
# Query to retrieve user information, note uid matches dovecot.conf AND Postfix virtual_uid_maps parameter.
user_query = SELECT '/var/vmail/mail/' || maildir AS home, 8 as uid, 8 as gid FROM mailbox WHERE username = '%u' AND active = '1'
```

@ -0,0 +1,48 @@
*Description
This extension adds support for password expiration.
It is designed to have expiration on users passwords. An email is sent when the password is expiring in 30 days, then 14 days, then 7 days.
It is strongly inspired by https://abridge2devnull.com/posts/2014/09/29/dovecot-user-password-expiration-notifications-updated-4122015/, and adapted to fit with Postfix Admin & Roundcube's password plugin
Expiration unit is day
Expiration value for domain is set through Postfix Admin GUI
*Installation
Perform the following changes:
**Changes in MySQL/MariaDB mailbox table (as defined in $CONF['database_tables'] from config.inc.php):
You are invited to backup your DB first, and ensure the table name is correct.
Execute the attached SQL script (password_expiration.sql) that will add the required columns. The expiration value for existing users will be set to 90 days. If you want a different value, edit line 2 in the script and replace 90 by the required value.
**Changes in Postfix Admin :
To enable password expiration, add the following to your config.inc.php file:
$CONF['password_expiration'] = 'YES';
All my tests are performed using $CONF['encrypt'] = 'md5crypt';
**If you are using Roundcube's password plugin, you should also adapt the $config['password_query'] value.
I recommend to use:
$config['password_query'] = 'UPDATE mailbox SET password=%c, modified = now(), password_expiry = now() + interval 90 day';
of cource you may adapt to the expected expiration value
All my tests are performed using $config['password_algorithm'] = 'md5-crypt';
**Changes in Dovecot (adapt if you use another LDA)
Edit dovecot-mysql.conf file, and replace the user_query (and only this one) by this query:
password_query = SELECT username as user, password, concat('/var/vmail/', maildir) as userdb_var, concat('maildir:/var/vmail/', maildir) as userdb_mail, 20001 as userdb_uid, 20001 as userdb_gid, m.domain FROM mailbox m, domain d where d.domain = m.domain and m.username = '%u' AND m.active = '1' AND (m.password_expiry > now() or d.password_expiry = 0)
Of course you may require to adapt the uid, gid, maildir and table to your setup
**Changes in system
You need to have a script running on a daily basis to check password expiration and send emails 30, 14 and 7 days before password expiration (script attached: check_mailpass_expiration.sh).
Edit the script to adapt the variables to your setup.
This script is using postfixadmin.my.cnf to read credentials. Edit this file to enter a DB user that is allowed to access (read-write) your database. This file should be protected from any user (chmod 400).

@ -23,6 +23,11 @@ You may wish to consider the following :
the vacation_notification table (and read alias and vacation).
3. PostfixAdmin itself needs to be able to READ and WRITE to
all the tables.
4. PostfixAdmin's setup.php additionally needs permissions to CREATE
and ALTER tables in the PostfixAdmin database. For PostgreSQL, also
permissions for CREATE FUNCTION and CREATE TRIGGER are needed.
In other words: setup.php needs all permissions on the PostfixAdmin
database.
Using the above, you can improve security by creating separate
database user accounts for each of the above roles, and limit
@ -33,5 +38,7 @@ FILE SYSTEM SECURITY
--------------------
PostfixAdmin does not require write support on the underlying
filesystem - aside from PHP creating session files.
filesystem with the following exceptions:
- the templates_c directory where Smarty caches the templates
- PHP's session.save_path to store session files

@ -9,29 +9,8 @@ With that login you can create new superadmins (and you should delete or change
password of admin@domain.tld). If that user is no longer there or you didn't use
the .TXT files, you could add another manually from the database.
(The example uses MySQL, the syntax will be similar for PostgreSQL)
In case you forgot your superadmin username or password, you can create a new
superadmin account using setup.php.
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8186 to server version: 5.0.27
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use postfix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> INSERT INTO domain_admins (username, domain, active) VALUES ('new@domain.tld','ALL','1');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO admin (username, password, active) VALUES ('new@domain.tld','$1$0fec9189$bgI6ncWrldPOsXnkUBIjl1','1');
Query OK, 1 row affected (0.00 sec)
mysql> exit
Bye
Then you can log in as new@domain.tld, password: admin
(The domain 'ALL' should already exist in the domain table; if not you'll need to recreate it)
If you also have forgotten your setup password, you can use setup.php to configure
a new setup password.

@ -33,10 +33,11 @@ When you install from a previous version make sure you backup your database
first. There are a lot of changes in the database structure since Postfix Admin
1.5.4.
$ mysqldump -a -u root -p > /tmp/postfixadmin-backup.sql
$ mysqldump -u root -p postfixdb > /tmp/postfixadmin-backup.sql
or
$ pg_dump -ad -u postfix postfix > /tmp/postfixadmin-backup.sql
$ pg_dump -ad -u postfix postfixdb > /tmp/postfixadmin-backup.sql
(Replace postfixdb with your Postfixadmin database's name)
2. Unarchive new Postfix Admin
------------------------------
@ -53,21 +54,35 @@ to have change the permissions for Postfix Admin.
$ cd /usr/local/www/postfixadmin
$ find -type f -print0 | xargs -0 chmod 640
$ find -type f -print0 | xargs -0 chown root:www
$ find -type f -print0 | xargs -0 chown root:www-data
(the last command assumes your Apache is running with group "www")
(the last command assumes your Apache is running with group "www-data")
Since version 3.0 we use smarty templates. That means the templates_c directory
needs to be writeable for your webserver.
$ cd /usr/local/www/postfixadmin
$ mkdir templates_c && chmod 750 templates_c && chown -R www-data templates_c
(if your Apache runs as user "www-data")
If you have SELinux enabled, also run (adust the path to match your setup)
$ sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/utils/pfadmin/public/templates_c(/.*)?"
$ sudo restorecon -Rv /var/www/utils/pfadmin/
4. Configure
------------
Check the config.inc.php file. There you can specify settings that are
relevant to your setup.
Comparing config.inc.php with your previous using "diff" might save you some
time.
You can use a config.local.php file to contain your local settings - these will override any
defined in config.inc.php
You can use a config.local.php file to contain your local settings.
These will override any defined in config.inc.php - and save some time when upgrading to a new version of PostfixAdmin ;-)
5. Run setup.php
----------------------------------------
@ -75,6 +90,7 @@ defined in config.inc.php
Access setup.php through a web browser.
It will attempt to upgrade your database, and also allow you to create a superadmin user.
(In case the database upgrade fails, you can run setup.php?debug=1 to see the last executed query.)
From version 2.3, you need to specify a setup_password in config.inc.php -
setup.php should guide you through this process. If you do not have a setup_password, type one
@ -89,9 +105,15 @@ If you update from 2.1 or older, also create a superadmin account using setup.ph
Note that admin/ has been merged into the main directory. Login with the
superadmin account to setup domains and domain admins.
6. Upgrade your postfix config
------------------------------
Since version 2.3, PostfixAdmin supports alias domains ($CONF['alias_domain']).
If you want to use them, you have to add some queries to your postfix config -
see POSTFIX_CONF for details.
6. Done
7. Done
-------
This is all that is needed. Fire up your browser and go to the site that you
specified to host Postfix Admin.

@ -5,36 +5,68 @@
# Licensed under GPL for more info check GPL-LICENSE.TXT
#
REQUIRED!!
----------
- You are using Postfix 2.0 or higher.
- You are using Apache 1.3.27 / Lighttpd 1.3.15 or higher.
- You are using PHP 5.1.2 or higher.
- You are using MySQL 3.23 or higher (5.x recommended) OR PostgreSQL 7.4 (or higher)
REQUIREMENTS
------------
- Postfix
- Apache / Lighttpd
- PHP (for web server)
- one of the following databases:
- MariaDB/MySQL
- PostgreSQL
- SQLite
READ THIS FIRST!
----------------
When this is an upgrade from Postfix Admin 1.5.4 please read DOCUMENTS/UPGRADE.TXT!!
When this is an upgrade from a previous version of Postfix Admin, please read
DOCUMENTS/UPGRADE.TXT also!
If you need to setup Postfix to be able to handle Virtual Domains and Virtual
Users check out :
Users check out:
- http://high5.net/howto/
- http://codepoets.co.uk/postfixadmin-postgresql-courier-squirrelmail-debian-etch-howto-tutorial (Debian+Courier+PostgreSQL+Postfix+Postfixadmin)
- the PostfixAdmin documentation in the DOCUMENTS/ directory
- our wiki at https://sourceforge.net/p/postfixadmin/wiki/
There are also lots of HOWTOs around the web. Be warned that many of them
(even those listed below) may be outdated or incomplete.
Please stick to the PostfixAdmin documentation, and use those HOWTOs only if
you need some additional information that is missing in the PostfixAdmin
DOCUMENTS/ folder.
- http://bliki.rimuhosting.com/space/knowledgebase/linux/mail/postfixadmin+on+debian+sarge (Postfix+MySQL+Postfixadmin+Dovecot)
- http://gentoo-wiki.com/HOWTO_Setup_a_Virtual_Postfix/Courier_Mail_System_with_PostfixAdmin (Postfix+MySQL+Postfixadmin+Courier)
- http://en.gentoo-wiki.com/wiki/Virtual_mail_server_using_Postfix,_Courier_and_PostfixAdmin (Postfix+MySQL+Postfixadmin+Courier)
1. Unarchive new Postfix Admin
------------------------------
Make sure that you are in your WWW directory and then unarchive the
Postfix Admin archive (whatever the filename is):
$ tar -zxvf postfixadmin-2.2.0.tgz
(if you installed PostfixAdmin as RPM or DEB package, you can obviously skip this step.)
Assuming we are installing Postfixadmin into /srv/postfixadmin, then something like this should work. Please check https://github.com/postfixadmin/postfixadmin/releases to get the latest stable release first (the 3.2.4 version/url below is probably stale)
$ cd /srv/
$ wget -O postfixadmin.tgz https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-3.2.4.tar.gz
$ tar -zxvf postfixadmin.tgz
$ mv postfixadmin-postfixadmin-3.2 postfixadmin
Alternatively :
$ cd /srv
$ git clone https://github.com/postfixadmin/postfixadmin.git
$ cd postfixadmin
$ git checkout postfixadmin-3.2.4
2. Setup a Database
2. Setup Web Server
-------------------
Assuming /var/www/html is where your webserver reads from, either create a symlink:
$ ln -s /srv/postfixadmin/public /var/www/html/postfixadmin
or setup an alias in your webserver config. For Apache, use:
Alias /postfixadmin /srv/postfixadmin/public
3. Setup a Database
-------------------
With your chosen/preferred database server (i.e. MySQL or PostgreSQL),
@ -52,16 +84,36 @@ For MySQL:
CREATE DATABASE postfix;
CREATE USER 'postfix'@'localhost' IDENTIFIED BY 'choose_a_password';
GRANT ALL PRIVILEGES ON `postfix` . * TO 'postfix'@'localhost';
FLUSH PRIVILEGES;
For PostgreSQL:
CREATE USER postfix WITH PASSWORD 'whatever';
CREATE DATABASE postfix OWNER postfix ENCODING 'unicode';
For SQLite:
$mkdir /srv/postfixadmin/database
$touch /srv/postfixadmin/database/postfixadmin.db
$sudo chown -R www-data:www-data /srv/postfixadmin/database
(both the directory and the database need to be writeable)
3. Configure PostfixAdmin so it can find the database
4. Configure PostfixAdmin so it can find the database
-----------------------------------------------------
Edit the config.inc.php file.
Create /srv/postfixadmin/config.local.php file for your local configuration:
<?php
$CONF['database_type'] = 'mysqli';
$CONF['database_user'] = 'postfix';
$CONF['database_password'] = 'postfixadmin';
$CONF['database_name'] = 'postfix';
$CONF['configured'] = true;
?>
See config.inc.php for all available config options and their default value.
You can also edit config.inc.php instead of creating a config.local.php,
but this will make updates harder and is therefore not recommended.
The most important settings are those for your database server.
@ -74,27 +126,22 @@ to
$CONF['configured'] = true;
PostfixAdmin does not require write access to any files. You can therefore
leave the files owned as root (or a.n.other user); as long as the web server
user (e.g. www-data) can read them, it will be fine.
The next 'step', is optional. Only do it, if other non-trusted users have access
to your user:
PostfixAdmin does not require write access to any files except the templates_c
directory (smarty cache). You can therefore leave the files owned by root (or
another user); as long as the web server user (e.g. www-data) can read them, it
will be fine.
Depending on your environment, you may want to protect the database username
and password stored in config.inc.php - if so, you could move them into the
Apache configuration file (which can be set to be visible only by root) using
something like the following in your VirtualHost definition :
For templates_c/, allow write access (only) for the web server user (e. g. www-data).
The easiest way to do this is
SetEnv DB_USER "postfix"
SetEnv DB_PASS "opensesame"
$ mkdir -p /srv/postfixadmin/templates_c
$ chown -R www-data /srv/postfixadmin/templates_c
config.inc.php would then be able to access these through :
(If you're using e.g. CentOS or another distribution which enables SELinux, something like the following may be necessary as well :
```chcon -R -t httpd_sys_content_rw_t /usr/share/postfixadmin/templates_c```
)
$CONF['database_user'] = $_SERVER['DB_USER']
4. Check settings, and create Admin user
5. Check settings, and create Admin user
----------------------------------------
Hit http://yourserver.tld/postfixadmin/setup.php in a web browser.
@ -111,17 +158,42 @@ out - with appropriate instructions on what to do with it).
create the admin user using the form displayed.
5. Use PostfixAdmin
6. Use PostfixAdmin
-------------------
This is all that is needed. Fire up your browser and go to the site that you
specified to host Postfix Admin.
6. More information
7. Integration with Postfix, Dovecot etc.
-----------------------------------------
Now that PostfixAdmin is working, you need to do some configuration in Postfix,
Dovecot etc. so that they use the domains, mailboxes and aliases you setup in
PostfixAdmin.
The files in the DOCUMENTS/ directory explain which settings you need to
do/change.
7. XMLRPC Integration (OPTIONAL!)
--------------------------------
See ADDITIONS/squirrelmail-plugin
See xmlrpc.php - only a subset of Postfixadmin's functionality is currently exposed.
See config.inc.php - see xmlrpc_enabled key (defaults to off).
You'll need to install a copy of the Zend Framework (version 1.12.x) within Postfixadmin
or your PHP include_path (see header within xmlrpc.php).
NOTE: The XMLRPC interface is _not compatible_ with Zend Framework version 2.x.
You'll need to enable the xmlrpc link (see config.inc.php)
8. More information
-------------------
As of March 2007, PostfixAdmin moved to SourceForge. For the
forum posts and source updates, see:
https://sourceforge.net/projects/postfixadmin
The code and issue tracker is on GitHub:
https://github.com/postfixadmin/postfixadmin
IRC - a community of people may be able to help in #postfixadmin on irc.freenode.net.
See http://webchat.freenode.net/
There is also #postfixadmin on irc.freenode.net.
Legacy forum posts are on SourceForce at
https://sourceforge.net/projects/postfixadmin

@ -18,7 +18,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Postfix Admin verion 2.1.1, Copyright (c) 2005 High5! (Mischa Peters & Contributors)
Postfix Admin version 2.1.1, Copyright (c) 2005 High5! (Mischa Peters & Contributors)
Postfix Admin comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
@ -29,4 +29,18 @@
Contributors: Mihau, Tarvin, SteveB, DJTremors, WhiteFox, David Osborn,
David Goodwin (GingerDog), Christian Boltz (cboltz) and GregC and others.
Postfix Admin uses some libraries that come with a different license.
a) libraries shipped with PostfixAdmin
- the Smarty templating engine is licensed under the GNU LESSER GENERAL PUBLIC
LICENSE Version 3 (see smarty/COPYING.lib)
- the CLI (commandline interface) is based on CakePHP which is licensed under
the MIT license.
b) libraries not shipped with PostfixAdmin
- the XMLRPC interface and the squirrelmail plugin use the Zend Framework which is
licensed under the New BSD License (3-clause), see http://framework.zend.com/license
- PHPUnit (used in tests/) is licensed under the BSD License (3-clause).

@ -0,0 +1,41 @@
![GitHubBuild](https://github.com/postfixadmin/postfixadmin/workflows/GitHubBuild/badge.svg)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/postfixadmin/Lobby)
[![Coverage Status](https://coveralls.io/repos/github/postfixadmin/postfixadmin/badge.svg?branch=master)](https://coveralls.io/github/postfixadmin/postfixadmin?branch=master)
![GitHub repo size](https://img.shields.io/github/repo-size/postfixadmin/postfixadmin)
[![Chat](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://kiwiirc.com/nextclient/irc.freenode.net/#postfixadmin)
# PostfixAdmin
An open source, web based interface for managing domains/mailboxes/aliases etc on a Postfix based mail server.
Integrates with :
- Postfix
- IMAP/POP3 server (e.g. Dovecot or Courier)
- Database backend (choose one of: sqlite, mysql, postgresql)
- Fetchmail (optional)
## Features
- Unlimited domains/aliases/mailboxes
- Optional storage quota support
- Optional password expiry (beta)
- Multiple password hashing formats
- Supports PostgreSQL, MySQL, MariaDB, SQLite database backends (choose one)
- Supports retrieval of mail from a remote POP3 server (via fetchmail)
- Vacation / Autoresponder / Out Of Office support
- Users have the ability to login, change their password or vacation (out of office) status.
- Integration with Squirrelmail / Roundcube (via plugins)
- Optional XMLRPC based API
- Supports PHP5.6+
## Useful Links
- [Probably all you need to read (pdf)](http://blog.cboltz.de/uploads/postfixadmin-30-english.pdf)
- http://postfixadmin.sf.net - the current homepage for the project
- [Docker Images](https://github.com/postfixadmin/docker)
- [What is it? (txt)](/DOCUMENTS/POSTFIXADMIN.txt)
- [Installation instructions](/INSTALL.TXT)
- [Wiki](https://sourceforge.net/p/postfixadmin/wiki/)
- [Mailing list](https://sourceforge.net/p/postfixadmin/discussion/676076)
- [IRC channel](irc://irc.freenode.net/postfixadmin) (#postfixadmin on irc.freenode.net).

@ -0,0 +1,93 @@
This file is not exhaustive.
Please feel free to add yourself and a summary of changes to this file at the bottom if creating a pull request.
Postfixadmin was originally written by Mischa Peters <mischa at high5 dot net>
Copyright (c) 2002 - 2005 High5!
Licensed under GPL for more info check GPL-LICENSE.TXT
Additional authors:
2004/07/13 David Osborn <ossdev at daocon.com>
strict, processes domain level aliases, more
subroutines, send reply from original to address
2004/11/09 David Osborn <ossdev at daocon.com>
Added syslog support
Slightly better logging which includes messageid
Avoid infinite loops with domain aliases
2005-01-19 Troels Arvin <troels at arvin.dk>
PostgreSQL-version.
Normalized DB schema from one vacation table ("vacation")
to two ("vacation", "vacation_notification"). Uses
referential integrity CASCADE action to simplify cleanup
when a user is no longer on vacation.
Inserting variables into queries stricly by prepare()
to try to avoid SQL injection.
International characters are now handled well.
2005-01-21 Troels Arvin <troels at arvin.dk>
Uses the Email::Valid package to avoid sending notices
to obviously invalid addresses.
2007-08-15 David Goodwin <david at palepurple.co.uk>
Use the Perl Mail::Sendmail module for sending mail
Check for headers that start with blank lines (patch from forum)
2007-08-20 Martin Ambroz <amsys at trustica.cz>
Added initial Unicode support
2008-05-09 Fabio Bonelli <fabiobonelli at libero.it>
Properly handle failed queries to vacation_notification.
Fixed log reporting.
2008-07-29 Patch from Luxten to add repeat notification after timeout. See:
https://sourceforge.net/tracker/index.php?func=detail&aid=2031631&group_id=191583&atid=937966
2008-08-01 Luigi Iotti <luigi at iotti dot biz>
Use envelope sender/recipient instead of using
From: and To: header fields;
Support to good vacation behavior as in
http://www.irbs.net/internet/postfix/0707/0954.html
(needs to be tested);
2008-08-04 David Goodwin <david at palepurple dot co dot uk>
Use Log4Perl
Added better testing (and -t option)
2009-06-29 Stevan Bajic <stevan at bajic.ch>
Add Mail::Sender for SMTP auth + more flexibility
2009-07-07 Stevan Bajic <stevan at bajic.ch>
Add better alias lookups
Check for more heades from Anti-Virus/Anti-Spam solutions
2009-08-10 Sebastian <reg9009 at yahoo dot de>
Adjust SQL query for vacation timeframe. It is now possible to set from/until date for vacation message.
2012-04-1 Nikolaos Topp <info at ichier.de>
Add configuration parameter $smtp_client in order to get mails through
postfix helo-checks, using check_helo_access whitelist without permitting 'localhost' default style stuff
2012-04-19 Jan Kruis <jan at crossreference dot nl>
change SQL query for vacation into function.
Add sub get_interval()
Gives the user the option to set the interval time ( 0 = one reply, 1 = autoreply, > 1 = Delay reply )
See https://sourceforge.net/tracker/?func=detail&aid=3508083&group_id=191583&atid=937966
2012-06-18 Christoph Lechleitner <christoph.lechleitner@iteg.at>
Add capability to include the subject of the original mail in the subject of the vacation message.
A good vacation subject could be: 'Re: $SUBJECT'
Also corrected log entry about "Already informed ..." to show the $orig_from, not $email
2017-07-14 Thomas Kempf <tkempf@hueper.de>
Replacing deprecated Mail::Sender by Email::Sender
Add configuration parameter $no_vacation_pattern in order to exlude specific alias-recipients from
sending vacation mails, even if one or multiple of the recipients the alias points to has vacation
currently active.

@ -1,43 +1,62 @@
##################################################
# Virtual Vacation for Postfix Admin Release 2.x #
##################################################
#
# Postfix Admin (Virtual Vacation)
# Originally authored by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# Licensed under GPL for more info check GPL-LICENSE.TXT
#
REQUIRED!
---------
There are a bunch of Perl modules which need installing, depending on your
distribution these may be available through your package management tool, or
will need installing through CPAN.
# About Virtual Vacation
A full list of required modules can be found in the source of vacation.pl.
AKA 'An out of office' automated email response.
It obviously relies on Perl
About Virtual Vacation
----------------------
The vacation script runs as service within Postfix's master.cf configuration file.
Mail is sent to the vacation service via a transport table mapping.
When users mark themselves as away on vacation, an alias is added to their account
sending a copy of all mail to them to the vacation service.
e.g. mail to billy@goat.com will be delivered to
billy@goat.com AND
billy#goat.com@autoreply.goat.com
* billy@goat.com AND
* billy#goat.com@autoreply.goat.com
Mail to @autoreply.goat.com is caught by the vacation.pl script and a reply
will be sent based on various settings. By default a reply is only sent once.
# Dependencies / Requirements
There are a bunch of Perl modules which need installing, depending on your
distribution these may be available through your package management tool, or
will need installing through CPAN.
```
Email::Valid
Email::Sender
Email::Simple
Email::Valid
Try::Tiny
MIME::Charset
MIME::EncWords
Log::Log4perl
Log::Dispatch
GetOpt::Std
Net::DNS;
```
You may install these via CPAN, or through your package tool.
CPAN: 'perl -MCPAN -e shell', then 'install Module::Whatever'
## Debian Systems
```bash
apt-get install libemail-sender-perl libemail-simple-perl libemail-valid-perl libtry-tiny-perl libdbd-pg-perl libemail-mime-perl liblog-log4perl-perl liblog-dispatch-perl libgetopt-argvfile-perl libmime-charset-perl libmime-encwords-perl libnet-dns-perl
```
and one of :
```bash
libdbd-pg-perl or libdbd-mysql-perl
```
# Installing Virtual Vacation
Install Virtual Vacation
------------------------
## 1. Create a local account
1. Create a local account
-------------------------
Create a dedicated local user account called "vacation".
This user handles all potentially dangerous mail content - that is why it
should be a separate account.
@ -46,112 +65,147 @@ Do not use "nobody", and most certainly do not use "root" or "postfix". The
user will never log in, and can be given a "*" password and non-existent
shell and home directory.
Also create a separate "vacation" group.
This should look like this:
```raw
#/etc/passwd
vacation:*:65501:65501::0:0:Virtual Vacation:/nonexistent:/sbin/nologin
vacation:*:65501:65501:Virtual Vacation:/nonexistent:/sbin/nologin
```
```raw
#/etc/group
vacation:*:65501:
```
## 2. Create a log directory or log file
If you want to log to a file ($log\_to\_file), create a log directory or an
empty log file.
This file or directory needs to be writeable for the "vacation" user.
2. Create a directory
---------------------
Create a directory, for example /var/spool/vacation, that is accessible
only to the "vacation" user. This is where the vacation script is supposed
to store its temporary files.
Note: If you are logging to syslog, you can skip this step.
3. Copy the files
-----------------
## 3. Install vacation.pl
Copy the vacation.pl file to the directory you created above:
Create a directory /usr/lib/postfixadmin/ and copy the vacation.pl file to it:
$ cp vacation.pl <HOME>/vacation.pl
$ chown -R vacation:vacation <HOME>
```bash
mkdir /usr/lib/postfixadmin
cp vacation.pl /usr/lib/postfixadmin/vacation.pl
chown -R root:vacation /usr/lib/postfixadmin
chmod 750 /usr/lib/postfixadmin/ /usr/lib/postfixadmin/vacation.pl
```
Which will then look something like:
-rwx------ 1 vacation vacation 3356 Dec 21 00:00 vacation.pl*
```raw
-rwxr-x--- 1 root vacation 3356 Dec 21 00:00 vacation.pl*
```
4. Setup the transport type
---------------------------
## 4. Setup the transport type
Define the transport type in the Postfix master file:
```raw
#/etc/postfix/master.cf:
vacation unix - n n - - pipe
flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}
flags=Rq user=vacation argv=/usr/lib/postfixadmin/vacation.pl -f ${sender} -- ${recipient}
```
5. Setup the transport maps file
--------------------------------
## 5. Setup the transport maps file
Tell Postfix to use a transport maps file, so add the following to your
Postfix main.cf:
```raw
#/etc/postfix/main.cf:
transport_maps = hash:/etc/postfix/transport
```
Then add the transport definition to the newly created transport file.
Obviously, change yourdomain.com to your own domain. This can be any
arbitrary domain, and it is easiest if you just choose one that will be used
for all your domains.
```raw
#/etc/postfix/transport
autoreply.yourdomain.com vacation:
```
(You may need to create an entry in /etc/hosts for your non-existant domain)
Execute "postmap /etc/postfix/transport" to build the hashed database.
Execute "postfix reload" to complete the change.
(You may need to create an entry in /etc/hosts for your non-existant domain)
Execute
```bash
postmap /etc/postfix/transport
```
Execute
```bash
postfix reload
```
to complete the change.
6. Configure vacation.pl
------------------------
## 6. Configure vacation.pl
The perl vacation.pl script needs to know which database you are using, and also
how to connect to the database.
Namely :
Change any variables starting with '$db_' and '$db_type' to either 'mysql' or 'pgsql'.
Change any variables starting with '$db\_' and '$db\_type' to either 'mysql' or 'pgsql'.
Change the $vacation_domain variable to match what you entered in your /etc/postfix/transport
Change the $vacation\_domain variable to match what you entered in your /etc/postfix/transport
file.
You can do this in two ways:
a) edit vacation.pl directly
a) edit vacation.pl directly (not recommended!)
b) create /etc/mail/postfixadmin/vacation.conf and enter your settings there
b) create /etc/postfixadmin/vacation.conf and enter your settings there
Just use perl syntax there to fill the config variables listed in vacation.pl
(without the "our" keyword). Example:
$db_username = 'mail';
```perl
$db_username = 'mail';
1; # required final line - keeps perl happy.
```
To make sure nobody except vacation.pl can read your vacation.conf (including the
database password), run
```bash
chown root:vacation /etc/postfixadmin/vacation.conf
chmod 640 /etc/postfixadmin/vacation.conf
```
7. Check the alias expansion
----------------------------
## 7. Check the alias expansion
Depending on your setup, you may have multiple 'smtpd' service definitions within
your postfix master.cf file. This is especially the case if you are also using AMAVIS or
another content filtering system when mail is re-injected into Postfix using the smtpd daemon.
If you are, it's likely that alias expansion may happen more than once, in which case you
may see vacation-style responses duplicated. To suppress this behaviour, you need to add :
may see vacation-style responses duplicated. To suppress this behaviour, you need to add:
```raw
-o receive_override_options=no_address_mappings
```
For example :
```raw
smtp inet n - - - 12 smtpd
-o content_filter=amavis:[127.0.0.50]:10024
^^^ Alias expansion occurs here, so we don't want it to happen again for the other smtpd daemon (below)
which receives email out of amavis on port 10025.
-o receive_override_options=no_address_mappings
127.0.0.1:10025 inet n - - - - smtpd
-o smtpd_autorized_xforward_hosts=127.0.0.0/8
@ -160,37 +214,28 @@ smtp inet n - - - 12 smtpd
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_address_mappings
-o receive_override_options=no_header_body_checks
```
^^^ Alias expansion occurs here, so we don't want it to happen again for the
first smtpd daemon (above). If you have per-user settings in amavis,
you might want to have no_address_mappings in the smtpd on port 10025
instead.
8. Security
-----------
If security is an issue for you, read ../DOCUMENTS/Security.txt
## 8. Security
If security is an issue for you, read ../DOCUMENTS/Security.txt
# Postfixadmin
What do these files do?
-----------------------
When a user enables a vacation message on their account, the alias
definition is changed so that in addition to delivering to their own
mailbox, it also delivers to a dummy alias which calls the vacation.pl
program. In other words, if joeuser@domain.com enables their vacation, the
entry in the alias database table will deliver mail to
joeuser@something.com, as well as
joeuser#something.com@autoreply.yourdomain.com
When this is all in place you need to have a look at the Postfix Admin
config.inc.php. Here you need to enable Virtual Vacation for the site.
vacation.pl then checks the database to see wether a user is on holiday and
what message to send back. Make sure that vacation.pl is able to communicate
to your database. In the first couple of lines you have to specify the
database, username and password for it.
NOTE: Make sure that the path to perl is correct.
# Help ! It's not working
I'm in trouble!
---------------
When something is not working there are a couple of files that you can have
a look at. The most important one is your maillog (usually in /var/log/).
@ -198,7 +243,3 @@ Vacation.pl also has some debugging and logging capabilties. Check the top
of vacation.pl.
Done!
-----
When this is all in place you need to have a look at the Postfix Admin
config.inc.php. Here you need to enable Virtual Vacation for the site.

@ -1,22 +0,0 @@
<?php
//
// Postfix Admin
// by Mischa Peters <mischa at high5 dot net>
// Copyright (c) 2002 - 2005 High5!
// Licensed under GPL for more info check GPL-LICENSE.TXT
//
// File: index.php
//
// Template File: -none-
//
// Template Variables:
//
// -none-
//
// Form POST \ GET Variables:
//
// -none-
//
header ("Location: ../login.php");
exit;
?>

@ -1,85 +1,13 @@
#!/usr/bin/perl -w
#!/usr/bin/perl
#
# Virtual Vacation 4.0
# $Revision$
# Originally by Mischa Peters <mischa at high5 dot net>
# Virtual Vacation 4.2
#
# Copyright (c) 2002 - 2005 High5!
# Licensed under GPL for more info check GPL-LICENSE.TXT
#
# Additions:
# 2004/07/13 David Osborn <ossdev at daocon.com>
# strict, processes domain level aliases, more
# subroutines, send reply from original to address
#
# 2004/11/09 David Osborn <ossdev at daocon.com>
# Added syslog support
# Slightly better logging which includes messageid
# Avoid infinite loops with domain aliases
#
# 2005-01-19 Troels Arvin <troels at arvin.dk>
# PostgreSQL-version.
# Normalized DB schema from one vacation table ("vacation")
# to two ("vacation", "vacation_notification"). Uses
# referential integrity CASCADE action to simplify cleanup
# when a user is no longer on vacation.
# Inserting variables into queries stricly by prepare()
# to try to avoid SQL injection.
# International characters are now handled well.
#
# 2005-01-21 Troels Arvin <troels at arvin.dk>
# Uses the Email::Valid package to avoid sending notices
# to obviously invalid addresses.
#
# 2007-08-15 David Goodwin <david at palepurple.co.uk>
# Use the Perl Mail::Sendmail module for sending mail
# Check for headers that start with blank lines (patch from forum)
#
# 2007-08-20 Martin Ambroz <amsys at trustica.cz>
# Added initial Unicode support
#
# 2008-05-09 Fabio Bonelli <fabiobonelli at libero.it>
# Properly handle failed queries to vacation_notification.
# Fixed log reporting.
#
# 2008-07-29 Patch from Luxten to add repeat notification after timeout. See:
# https://sourceforge.net/tracker/index.php?func=detail&aid=2031631&group_id=191583&atid=937966
#
# 2008-08-01 Luigi Iotti <luigi at iotti dot biz>
# Use envelope sender/recipient instead of using
# From: and To: header fields;
# Support to good vacation behavior as in
# http://www.irbs.net/internet/postfix/0707/0954.html
# (needs to be tested);
#
# 2008-08-04 David Goodwin <david at palepurple dot co dot uk>
# Use Log4Perl
# Added better testing (and -t option)
#
# 2009-06-29 Stevan Bajic <stevan@bajic.ch>
# Add Mail::Sender for SMTP auth + more flexibility
#
# 2009-07-07 Stevan Bajic <stevan@bajic.ch>
# Add better alias lookups
# Check for more heades from Anti-Virus/Anti-Spam solutions
#
# Requirements - the following perl modules are required:
# DBD::Pg or DBD::mysql
# Mail::Sender, Email::Valid MIME::Charset, Log::Log4perl, Log::Dispatch, MIME::EncWords and GetOpt::Std
#
# You may install these via CPAN, or through your package tool.
# CPAN: 'perl -MCPAN -e shell', then 'install Module::Whatever'
#
# On Debian based systems :
# libmail-sender-perl
# libdbd-pg-perl
# libemail-valid-perl
# libmime-perl
# liblog-log4perl-perl
# liblog-dispatch-perl
# libgetopt-argvfile-perl
# libmime-charset-perl (currently in testing, see instructions below)
# libmime-encwords-perl (currently in testing, see instructions below)
# See Contributions.txt for a list of contributions.
# https://github.com/postfixadmin/postfixadmin/blob/master/VIRTUAL_VACATION/Contributions.txt
# See INSTALL.txt for help installing (and lists of dependent packages etc)
# https://github.com/postfixadmin/postfixadmin/blob/master/VIRTUAL_VACATION/INSTALL.md
#
# Note: When you use this module, you may start seeing error messages
# like "Cannot insert a duplicate key into unique index
@ -87,23 +15,22 @@
# behavior, and not an indication of trouble (see the "already_notified"
# subroutine for an explanation).
#
# You must also have the Email::Valid and MIME-tools perl-packages
# installed. They are available in some package collections, under the
# names 'perl-Email-Valid' and 'perl-MIME-tools', respectively.
# One such package collection (for Linux) is:
# http://dag.wieers.com/home-made/apt/packages.php
#
use utf8;
use DBI;
use MIME::Base64;
use Encode qw(decode);
use MIME::EncWords qw(:all);
use Email::Valid;
use strict;
use Mail::Sender;
use Getopt::Std;
use Email::Sender::Simple qw(sendmail);
use Email::Sender::Transport::SMTP;
use Email::Simple;
use Email::Simple::Creator;
use Try::Tiny;
use Log::Log4perl qw(get_logger :levels);
use File::Basename;
use Net::DNS;
# ========== begin configuration ==========
# IMPORTANT: If you put passwords into this script, then remember
@ -124,46 +51,81 @@ our $db_name = 'postfix';
our $vacation_domain = 'autoreply.example.org';
# smtp server used to send vacation e-mails
our $smtp_server = 'localhost';
our $recipient_delimiter = '+';
# port to connect to; defaults to 25 for non-SSL, 465 for 'ssl', 587 for 'starttls'
our $smtp_server_port = 25;
# SMTP authentication protocol used for sending.
# Can be 'PLAIN', 'LOGIN', 'CRAM-MD5' or 'NTLM'
# Leave it blank if you don't use authentification
our $smtp_auth = undef;
# username used to login to the server
our $smtp_authid = 'someuser';
# password used to login to the server
our $smtp_authpwd = 'somepass';
# this is the helo we [the vacation script] use on connection; you may need to change this to your hostname or something,
# depending upon what smtp helo restrictions you have in place within Postfix.
our $smtp_client = 'localhost';
# send mail encrypted or plaintext
# if 'starttls', use STARTTLS; if 'ssl' (or 1), connect securely; otherwise, no security
our $smtp_ssl = 'starttls';
# maximum time in secs to wait for server; default is 120
our $smtp_timeout = '120';
# sasl_username: the username to use for auth; optional
our $smtp_authid = '';
# sasl_password: the password to use for auth; required if username is provided
our $smtp_authpwd = '';
# This specifies the mail 'from' name which is shown to recipients of vacation replies.
# If you leave it empty, the vacation mail will contain:
# From: <original@recipient.domain>
# If you specify something here you'd instead see something like :
# From: Some Friendly Name <original@recipient.domain>
our $friendly_from = '';
# Set to 1 to enable logging to syslog.
our $syslog = 0;
# path to logfile, when empty logging is supressed
# path to logfile, when empty logging is suppressed
# change to e.g. /dev/null if you want nothing logged.
# if we can't write to this, and $log_to_file is 1 (below) the script will abort.
our $logfile='/var/log/vacation.log';
# 2 = debug + info, 1 = info only, 0 = error only
our $log_level = 2;
# Whether to log to file or not, 0 = do not write to a log file
our $log_to_file = 0;
our $log_to_file = 0;
# notification interval, in seconds
# set to 0 to notify only once
# e.g. 1 day ...
#my $interval = 60*60*24;
#our $interval = 60*60*24;
# disabled by default
our $interval = 0;
# Send vacation mails to do-not-reply email addresses.
# By default vacation email addresses will be sent.
# For now emails from bounce|do-not-reply|facebook|linkedin|list-|myspace|twitter won't
# be answered when $custom_noreply_pattern is set to 1.
# default = 0
our $custom_noreply_pattern = 0;
our $noreply_pattern = 'bounce|do-not-reply|facebook|linkedin|list-|myspace|twitter';
# Never send vacation mails for the following recipient email addresses.
# Useful for e.g. aliases pointing to multiple recipients which have vacation active
# hence an email to the alias should not trigger vacation messages.
# By default vacation email addresses will be sent for all recipients.
# default = ''
# preventing vacation notifications for recipient info@example.org would look like this:
# our $no_vacation_pattern = 'info\@example\.org';
our $no_vacation_pattern = 'info\@example\.org';
# instead of changing this script, you can put your settings to /etc/mail/postfixadmin/vacation.conf
# or /etc/postfixadmin/vacation.conf just use Perl syntax there to fill the variables listed above
# (without the "our" keyword). Example:
# $db_username = 'mail';
if (-f "/etc/mail/postfixadmin/vacation.conf") {
require "/etc/mail/postfixadmin/vacation.conf";
} elsif (-f "/etc/postfixadmin/vacation.conf") {
require "/etc/postfixadmin/vacation.conf";
if (-f '/etc/mail/postfixadmin/vacation.conf') {
require '/etc/mail/postfixadmin/vacation.conf';
} elsif (-f '/etc/postfixadmin/vacation.conf') {
require '/etc/postfixadmin/vacation.conf';
} elsif (-f './vacation.conf') {
require './vacation.conf';
}
# =========== end configuration ===========
@ -175,7 +137,7 @@ if($log_to_file == 1) {
}
}
my ($from, $to, $cc, $replyto , $subject, $messageid, $lastheader, $smtp_sender, $smtp_recipient, %opts, $spam, $test_mode, $logger);
my ($from, $to, $cc, $replyto , $subject, $messageid, $lastheader, $smtp_sender, $smtp_recipient, %opts, $test_mode, $logger);
$subject='';
$messageid='unknown';
@ -183,12 +145,12 @@ $messageid='unknown';
# Setup a logger...
#
getopts('f:t:', \%opts) or die "Usage: $0 [-t yes] -f sender -- recipient\n\t-t for testing only\n";
$opts{f} and $smtp_sender = $opts{f} or die "-f sender not present on command line";
$opts{f} and $smtp_sender = $opts{f} or die '-f sender not present on command line';
$test_mode = 0;
$opts{t} and $test_mode = 1;
$smtp_recipient = shift or die "recipient not given on command line";
$smtp_recipient = shift or die 'recipient not given on command line';
my $log_layout = Log::Log4perl::Layout::PatternLayout->new("%d %p> %F:%L %M - %m%n");
my $log_layout = Log::Log4perl::Layout::PatternLayout->new('%d %p> %F:%L %M - %m%n');
if($test_mode == 1) {
$logger = get_logger();
@ -196,13 +158,14 @@ if($test_mode == 1) {
my $appender = Log::Log4perl::Appender->new('Log::Dispatch::Screen');
$appender->layout($log_layout);
$logger->add_appender($appender);
$logger->debug("Test mode enabled");
$logger->debug('Test mode enabled');
} else {
$logger = get_logger();
if($log_to_file == 1) {
# log to file
my $appender = Log::Log4perl::Appender->new(
'Log::Dispatch::File',
'Log::Dispatch::File',
filename => $logfile,
mode => 'append');
@ -213,7 +176,8 @@ if($test_mode == 1) {
if($syslog == 1) {
my $syslog_appender = Log::Log4perl::Appender->new(
'Log::Dispatch::Syslog',
Facility => 'mail',
facility => 'mail',
ident => 'vacation',
);
$logger->add_appender($syslog_appender);
}
@ -228,7 +192,7 @@ if($log_level == 2) {
$logger->level($DEBUG);
}
binmode (STDIN,':utf8');
binmode (STDIN,':encoding(UTF-8)');
my $dbh;
if ($db_host) {
@ -238,27 +202,62 @@ if ($db_host) {
}
if (!$dbh) {
$logger->error("Could not connect to database"); # eval { } etc better here?
$logger->error('Could not connect to database'); # eval { } etc better here?
exit(0);
}
my $db_true; # MySQL and PgSQL use different values for TRUE, and unicode support...
if ($db_type eq "mysql") {
$dbh->do("SET CHARACTER SET utf8;");
if ($db_type eq 'mysql') {
$dbh->do('SET CHARACTER SET utf8;');
$db_true = '1';
} else { # Pg
$dbh->do("SET CLIENT_ENCODING TO 'UTF8'");
$dbh->{pg_enable_utf8} = 1;
$db_true = 'True';
}
# used to detect infinite address lookup loops
my $loopcount=0;
#
# Get interval_time for email user from the vacation table
#
sub get_interval {
my ($to) = @_;
my $query = qq{SELECT interval_time FROM vacation WHERE email=? };
my $stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($to) or panic_execute($query," 'email='$to'");
my $rv = $stm->rows;
if ($rv == 1) {
my @row = $stm->fetchrow_array;
my $interval = $row[0] ;
return $interval ;
} else {
return 0 ;
}
}
sub already_notified {
my ($to, $from) = @_;
my $logger = get_logger();
my $query = qq{INSERT into vacation_notification (on_vacation,notified) values (?,?)};
my $query;
# delete old notifications
if ($db_type eq 'Pg') {
$query = qq{DELETE FROM vacation_notification USING vacation WHERE vacation.email = vacation_notification.on_vacation AND on_vacation = ? AND notified = ? AND notified_at < vacation.activefrom;};
} else { # mysql
$query = qq{DELETE vacation_notification.* FROM vacation_notification LEFT JOIN vacation ON vacation.email = vacation_notification.on_vacation WHERE on_vacation = ? AND notified = ? AND notified_at < vacation.activefrom};
}
my $stm = $dbh->prepare($query);
if (!$stm) {
$logger->error("Could not prepare query (trying to delete old vacation notifications) :'$query' to: $to, from:$from");
return 1;
}
$stm->execute($to,$from);
$query = qq{INSERT into vacation_notification (on_vacation,notified) values (?,?)};
$stm = $dbh->prepare($query);
if (!$stm) {
$logger->error("Could not prepare query '$query' to: $to, from:$from");
return 1;
@ -268,15 +267,22 @@ sub already_notified {
if (!$stm->execute($to,$from)) {
my $e=$dbh->errstr;
# Violation of a primay key constraint may happen here, and that's
# Violation of a primary key constraint may happen here, and that's
# fine. All other error conditions are not fine, however.
if ($e !~ /(?:_pkey|^Duplicate entry)/) {
$logger->error("Failed to insert into vacation_notification table (to:$to from:$from error:'$e' query:'$query')");
# Let's play safe and notify anyway
return 1;
}
$interval = get_interval($to);
if ($interval) {
$query = qq{SELECT NOW()-notified_at FROM vacation_notification WHERE on_vacation=? AND notified=?};
if ($db_type eq 'Pg') {
$query = qq{SELECT extract( epoch from (NOW()-notified_at))::int FROM vacation_notification WHERE on_vacation=? AND notified=?};
} else { # mysql
$query = qq{SELECT UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(notified_at) FROM vacation_notification WHERE on_vacation=? AND notified=?};
}
$stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($to,$from) or panic_execute($query,"on_vacation='$to', notified='$from'");
my @row = $stm->fetchrow_array;
@ -305,48 +311,56 @@ sub already_notified {
return 0;
}
# try and determine if email address has vacation turned on; we
#
# Check to see if there is a vacation record against a specific email address.
#
sub check_for_vacation {
my ($email_to_check) =@_;
my $query = qq{SELECT email FROM vacation WHERE email=? and active=$db_true and activefrom <= NOW() and activeuntil >= NOW()};
my $stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($email_to_check) or panic_execute($query,"email='$email_to_check'");
my $rv = $stm->rows;
return $rv;
}
# try and determine if email address has vacation turned on; we
# have to do alias searching, and domain aliasing resolution for this.
# If found, return ($num_matches, $real_email);
sub find_real_address {
my ($email) = @_;
my $logger = get_logger();
if (++$loopcount > 20) {
$logger->error("find_real_address loop! (more than 20 attempts!) currently: $email");
$logger->error("find_real_address loop! (more than 20 attempts!) currently: $email");
exit(1);
}
my $realemail = '';
my $query = qq{SELECT email FROM vacation WHERE email=? AND active=$db_true};
my $stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($email) or panic_execute($query,"email='$email'");
my $rv = $stm->rows;
my $rv = check_for_vacation($email);
# Recipient has vacation
if ($rv == 1) {
$realemail = $email;
$logger->debug("Found '\$email'\ has vacation active");
$logger->debug("Found '$email' has vacation active");
} else {
my $vemail = $email;
$vemail =~ s/\@/#/g;
$vemail = $vemail . "\@" . $vacation_domain;
$logger->debug("Looking for alias records that \'$email\' resolves to with vacation turned on");
$query = qq{SELECT goto FROM alias WHERE address=? AND (goto LIKE ? OR goto LIKE ? OR goto LIKE ? OR goto = ?)};
$stm = $dbh->prepare($query) or panic_prepare($query);
$logger->debug("Looking for alias records that '$email' resolves to with vacation turned on");
my $query = qq{SELECT goto FROM alias WHERE address=? AND (goto LIKE ? OR goto LIKE ? OR goto LIKE ? OR goto = ?)};
my $stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($email,"$vemail,%","%,$vemail","%,$vemail,%", "$vemail") or panic_execute($query,"address='$email'");
$rv = $stm->rows;
# Recipient is an alias, check if mailbox has vacation
if ($rv == 1) {
if ($rv == 1) {
my @row = $stm->fetchrow_array;
my $alias = $row[0];
if ($alias =~ /,/) {
for (split(/\s*,\s*/, lc($alias))) {
my $singlealias = $_;
$logger->debug("Found alias \'$singlealias\' for email \'$email\'. Looking if vacation is on for alias.");
$query = qq{SELECT email FROM vacation WHERE email=? AND active=$db_true};
$stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($singlealias) or panic_execute($query,"email='$singlealias'");
$rv = $stm->rows;
$rv = check_for_vacation($singlealias);
# Alias has vacation
if ($rv == 1) {
$realemail = $singlealias;
@ -354,10 +368,7 @@ sub find_real_address {
}
}
} else {
$query = qq{SELECT email FROM vacation WHERE email=? AND active=$db_true};
$stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($alias) or panic_prepare($query,"email='$alias'");
$rv = $stm->rows;
$rv = check_for_vacation($alias);
# Alias has vacation
if ($rv == 1) {
$realemail = $alias;
@ -380,7 +391,7 @@ sub find_real_address {
($rv, $realemail) = find_real_address ("$user\@$alias_domain_dest");
# We still have to look for domain level aliases...
} else {
} else {
my ($user, $domain) = split(/@/, $email);
$logger->debug("Looking for domain level aliases for $domain / $email / $user");
$query = qq{SELECT goto FROM alias WHERE address=?};
@ -388,17 +399,17 @@ sub find_real_address {
$stm->execute("\@$domain") or panic_execute($query,"address='\@$domain'");
$rv = $stm->rows;
# The receipient has a domain level alias
if ($rv == 1) {
# The recipient has a domain level alias
if ($rv == 1) {
my @row = $stm->fetchrow_array;
my $wildcard_dest = $row[0];
my ($wilduser, $wilddomain) = split(/@/, $wildcard_dest);
# Check domain alias
if ($wilduser) {
($rv, $realemail) = find_real_address ($wildcard_dest);
if ($wilduser) {
($rv, $realemail) = find_real_address ($wildcard_dest);
} else {
($rv, $realemail) = find_real_address ("$user\@$wilddomain");
($rv, $realemail) = find_real_address ("$user\@$wilddomain");
}
} else {
$logger->debug("No domain level alias present for $domain / $email / $user");
@ -412,7 +423,7 @@ sub find_real_address {
# sends the vacation mail to the original sender.
#
sub send_vacation_email {
my ($email, $orig_from, $orig_to, $orig_messageid, $test_mode) = @_;
my ($email, $orig_from, $orig_to, $orig_messageid, $orig_subject, $test_mode) = @_;
my $logger = get_logger();
$logger->debug("Asked to send vacation reply to $email thanks to $orig_messageid");
my $query = qq{SELECT subject,body FROM vacation WHERE email=?};
@ -421,48 +432,89 @@ sub send_vacation_email {
my $rv = $stm->rows;
if ($rv == 1) {
my @row = $stm->fetchrow_array;
if (already_notified($email, $orig_from) == 1) {
$logger->debug("Already notified $email, or some error prevented us from doing so");
return;
if (already_notified($email, $orig_from) == 1) {
$logger->debug("Already notified $orig_from, or some error prevented us from doing so");
return;
}
$logger->debug("Will send vacation response for $orig_messageid: FROM: $email (orig_to: $orig_to), TO: $orig_from; VACATION SUBJECT: $row[0] ; VACATION BODY: $row[1]");
my $subject = $row[0];
$subject = Encode::decode_utf8( $subject ) if( !Encode::is_utf8( $subject ) );
$orig_subject = decode("mime-header", $orig_subject);
$subject =~ s/\$SUBJECT/$orig_subject/g;
if ($subject ne $row[0]) {
$logger->debug("Patched Subject of vacation message to: $subject");
}
my $body = $row[1];
$body = Encode::decode_utf8( $body ) if( !Encode::is_utf8( $body ) );
my $from = $email;
my $to = $orig_from;
my %smtp_connection;
%smtp_connection = (
'smtp' => $smtp_server,
'port' => $smtp_server_port,
'auth' => $smtp_auth,
'authid' => $smtp_authid,
'authpwd' => $smtp_authpwd,
'skip_bad_recipients' => 'true',
'encoding' => 'Base64',
'ctype' => 'text/plain; charset=UTF-8',
'headers' => 'Precedence: junk',
'headers' => 'X-Loop: Postfix Admin Virtual Vacation',
);
my %mail;
# I believe Mail::Sender qp encodes the subject, so we no longer need to.
%mail = (
'subject' => $subject,
'from' => $from,
'to' => $to,
'msg' => encode_base64($body)
# part of the username in the email && part of the domain in the email
my ($email_username_part, $email_domain_part) = split(/@/, $email);
my $resolver = Net::DNS::Resolver->new;
my @mx = mx($resolver, $email_domain_part);
my $smtp_server;
if (@mx) {
$smtp_server = @mx[0]->exchange;
$logger->debug("Found MX record <$smtp_server> for user <$email>!");
} else {
$logger->error("Unable to find MX record for user <$email>, error message: ".$resolver->errorstring);
exit(0);
}
my $smtp_params = {
host => $smtp_server,
port => $smtp_server_port,
ssl_options => {
SSL_verifycn_name => $smtp_server
},
ssl => $smtp_ssl,
timeout => $smtp_timeout,
localaddr => $smtp_client,
debug => 0,
};
if($smtp_authid ne ''){
$smtp_params->{sasl_username}=$smtp_authid;
$smtp_params->{sasl_password}=$smtp_authpwd;
$logger->info("Doing SASL Authentication with user $smtp_params->{sasl_username}\n");
};
my $transport = Email::Sender::Transport::SMTP->new($smtp_params);
$subject = Encode::encode_utf8( $subject ) if( Encode::is_utf8( $subject ) );
$body = Encode::encode_utf8( $body ) if( Encode::is_utf8( $body ) );
$email = Email::Simple->create(
header => [
To => $to,
From => $from,
Subject => encode_mimewords($subject, 'Charset', 'UTF-8'),
Precedence => 'junk',
'Content-Type' => "text/plain; charset=utf-8",
'X-Loop' => 'Postfix Admin Virtual Vacation',
],
body => $body,
);
if($test_mode == 1) {
$logger->info("** TEST MODE ** : Vacation response sent to $to from $from subject $subject (not) sent\n");
$logger->info(%mail);
$logger->info($email);
return 0;
}
$Mail::Sender::NO_X_MAILER = 1;
my $sender = new Mail::Sender({%smtp_connection});
$sender->Open({%mail});
$sender->SendLineEnc($body);
$sender->Close() or $logger->error("Failed to send vacation response: " . $sender->{'error_msg'});
$logger->debug("Vacation response sent to $to, from $from");
try {
sendmail($email, { transport => $transport });
} finally {
if (@_) {
$logger->error("Failed to send vacation response to $to from $from subject $subject: @_");
} else {
$logger->debug("Vacation response sent to $to from $from subject $subject sent\n");
}
}
}
}
@ -492,12 +544,11 @@ sub strip_address {
# remove duplicates
my %seen = ();
my @uniq;
my $item;
foreach $item (@ok) {
foreach my $item (@ok) {
push(@uniq, $item) unless $seen{$item}++
}
my $result = lc(join(", ", @uniq));
my $result = lc(join(', ', @uniq));
#$logger->debug("Result: $result");
return $result;
}
@ -522,13 +573,14 @@ sub check_and_clean_from_address {
my ($address) = @_;
my $logger = get_logger();
if($address =~ /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i ||
$address =~ /\-(owner|request|bounces)\@/i ) {
$logger->debug("sender $address contains $1 - will not send vacation message");
exit(0);
}
if($address =~ /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i ||
$address =~ /\-(owner|request|bounces)\@/i ||
($custom_noreply_pattern == 1 && $address =~ /^.*($noreply_pattern).*/i) ) {
$logger->debug("sender $address contains $1 - will not send vacation message");
exit(0);
}
$address = strip_address($address);
if($address eq "") {
if($address eq '') {
$logger->error("Address $address is not valid; exiting");
exit(0);
}
@ -542,28 +594,31 @@ $cc = '';
$replyto = '';
$logger->debug("Script argument SMTP recipient is : '$smtp_recipient' and smtp_sender : '$smtp_sender'");
while (<STDIN>) {
last if (/^$/);
if (/^\s+(.*)/ and $lastheader) { $$lastheader .= " $1"; next; }
elsif (/^from:\s*(.*)\n$/i) { $from = $1; $lastheader = \$from; }
elsif (/^to:\s*(.*)\n$/i) { $to = $1; $lastheader = \$to; }
elsif (/^cc:\s*(.*)\n$/i) { $cc = $1; $lastheader = \$cc; }
elsif (/^Reply\-to:\s*(.*)\s*\n$/i) { $replyto = $1; $lastheader = \$replyto; }
elsif (/^subject:\s*(.*)\n$/i) { $subject = $1; $lastheader = \$subject; }
elsif (/^message\-id:\s*(.*)\s*\n$/i) { $messageid = $1; $lastheader = \$messageid; }
elsif (/^x\-spam\-(flag|status):\s+yes/i) { $logger->debug("x-spam-$1: yes found; exiting"); exit (0); }
if (/^\s+(.*)/ and $lastheader) { $$lastheader .= " $1"; next; }
elsif (/^from:\s*(.*)\n$/i) { $from = $1; $lastheader = \$from; }
elsif (/^to:\s*(.*)\n$/i) { $to = $1; $lastheader = \$to; }
elsif (/^cc:\s*(.*)\n$/i) { $cc = $1; $lastheader = \$cc; }
elsif (/^Reply\-to:\s*(.*)\s*\n$/i) { $replyto = $1; $lastheader = \$replyto; }
elsif (/^subject:\s*(.*)\n$/i) { $subject = $1; $lastheader = \$subject; }
elsif (/^message\-id:\s*(.*)\s*\n$/i) { $messageid = $1; $lastheader = \$messageid; }
elsif (/^x\-spam\-(flag|status):\s+yes/i) { $logger->debug("x-spam-$1: yes found; exiting"); exit (0); }
elsif (/^x\-facebook\-notify:/i) { $logger->debug('Mail from facebook, ignoring'); exit(0); }
elsif (/^precedence:\s+(bulk|list|junk)/i) { $logger->debug("precedence: $1 found; exiting"); exit (0); }
elsif (/^x\-loop:\s+postfix\ admin\ virtual\ vacation/i) { $logger->debug("x-loop: postfix admin virtual vacation found; exiting"); exit (0); }
elsif (/^Auto\-Submitted:\s*no/i) { next; }
elsif (/^Auto\-Submitted:/i) { $logger->debug("Auto-Submitted: something found; exiting"); exit (0); }
elsif (/^List\-(Id|Post):/i) { $logger->debug("List-$1: found; exiting"); exit (0); }
elsif (/^precedence:\s+(bulk|list|junk)/i) { $logger->debug("precedence: $1 found; exiting"); exit (0); }
elsif (/^x\-loop:\s+postfix\ admin\ virtual\ vacation/i) { $logger->debug('x-loop: postfix admin virtual vacation found; exiting'); exit (0); }
elsif (/^Auto\-Submitted:\s*no/i) { next; }
elsif (/^Auto\-Submitted:/i) { $logger->debug('Auto-Submitted: something found; exiting'); exit (0); }
elsif (/^List\-(Id|Post|Unsubscribe):/i) { $logger->debug("List-$1: found; exiting"); exit (0); }
elsif (/^(x\-(barracuda\-)?spam\-status):\s+(yes)/i) { $logger->debug("$1: $3 found; exiting"); exit (0); }
elsif (/^(x\-dspam\-result):\s+(spam|bl[ao]cklisted)/i) { $logger->debug("$1: $2 found; exiting"); exit (0); }
elsif (/^(x\-(anti|avas\-)?virus\-status):\s+(infected)/i) { $logger->debug("$1: $3 found; exiting"); exit (0); }
elsif (/^(x\-(avas\-spam|spamtest|crm114|razor|pyzor)\-status):\s+(spam)/i) { $logger->debug("$1: $3 found; exiting"); exit (0); }
elsif (/^(x\-osbf\-lua\-score):\s+[0-9\/\.\-\+]+\s+\[([-S])\]/i) { $logger->debug("$1: $2 found; exiting"); exit (0); }
else {$lastheader = "" ; }
elsif (/^x\-autogenerated:\s*reply/i) { $logger->debug('x-autogenerated found; exiting'); exit (0); }
elsif (/^x\-auto\-response\-suppress:\s*oof/i) { $logger->debug('x-auto-response-suppress: oof found; exiting'); exit (0); }
else {$lastheader = '' ; }
}
if($smtp_recipient =~ /\@$vacation_domain/) {
@ -571,50 +626,57 @@ if($smtp_recipient =~ /\@$vacation_domain/) {
my $tmp = $smtp_recipient;
$tmp =~ s/\@$vacation_domain//;
$tmp =~ s/#/\@/;
if ($recipient_delimiter) {
$tmp =~ s/[\Q$recipient_delimiter\E].+$//;
}
$logger->debug("Converted autoreply mailbox back to normal style - from $smtp_recipient to $tmp");
$smtp_recipient = $tmp;
undef $tmp;
}
# If either From: or To: are not set, exit
if(!$from || !$to || !$messageid || !$smtp_sender || !$smtp_recipient) {
$logger->info("One of from=$from, to=$to, messageid=$messageid, smtp sender=$smtp_sender, smtp recipient=$smtp_recipient empty");
exit(0);
if(!$from || !$to || !$messageid || !$smtp_sender || !$smtp_recipient) {
$logger->info("One of from=$from, to=$to, messageid=$messageid, smtp sender=$smtp_sender, smtp recipient=$smtp_recipient empty");
exit(0);
}
$logger->debug("Email headers have to: '$to' and From: '$from'");
if ($to =~ /^.*($no_vacation_pattern).*/i) {
$logger->debug("Will not send vacation reply for messages to $to");
exit(0);
}
$to = strip_address($to);
$cc = strip_address($cc);
$from = check_and_clean_from_address($from);
if($replyto ne "") {
if($replyto ne '') {
# if reply-to is invalid, or looks like a mailing list, then we probably don't want to send a reply.
$replyto = check_and_clean_from_address($replyto);
}
$smtp_sender = check_and_clean_from_address($smtp_sender);
$smtp_recipient = check_and_clean_from_address($smtp_recipient);
if ($smtp_sender eq $smtp_recipient) {
$logger->debug("smtp sender $smtp_sender and recipient $smtp_recipient are the same; aborting");
exit(0);
if ($smtp_sender eq $smtp_recipient) {
$logger->debug("smtp sender $smtp_sender and recipient $smtp_recipient are the same; aborting");
exit(0);
}
for (split(/,\s*/, lc($to)), split(/,\s*/, lc($cc))) {
my $header_recipient = strip_address($_);
if ($smtp_sender eq $header_recipient) {
$logger->debug("sender header $smtp_sender contains recipient $header_recipient (mailing myself?)");
exit(0);
if ($smtp_sender eq $header_recipient) {
$logger->debug("sender header $smtp_sender contains recipient $header_recipient (mailing myself?)");
exit(0);
}
}
my ($rv, $email) = find_real_address($smtp_recipient);
if ($rv == 1) {
$logger->debug("Attempting to send vacation response for: $messageid to: $smtp_sender, $smtp_recipient, $email (test_mode = $test_mode)");
send_vacation_email($email, $smtp_sender, $smtp_recipient, $messageid, $test_mode);
send_vacation_email($email, $smtp_sender, $smtp_recipient, $messageid, $subject, $test_mode);
} else {
$logger->debug("SMTP recipient $smtp_recipient which resolves to $email does not have an active vacation (rv: $rv, email: $email)");
}
0;
#/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
#/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */

@ -1,4 +0,0 @@
<?php
header ("Location: ../login.php");
exit(0);
?>

@ -1,133 +0,0 @@
<?php
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* File: backup.php
* Used to save all settings - but only works for MySQL databases.
* Template File: -none-
*
* Template Variables: -none-
*
* Form POST \ GET Variables: -none-
*/
require_once('common.php');
authentication_require_role('global-admin');
(($CONF['backup'] == 'NO') ? header("Location: " . $CONF['postfix_admin_url'] . "/main.php") && exit : '1');
// TODO: make backup supported for postgres
if ('pgsql'==$CONF['database_type'])
{
print '<p>Sorry: Backup is currently not supported for your DBMS.</p>';
}
/*
SELECT attnum,attname,typname,atttypmod-4,attnotnull,atthasdef,adsrc
AS def FROM pg_attribute,pg_class,pg_type,pg_attrdef
WHERE pg_class.oid=attrelid AND pg_type.oid=atttypid
AND attnum>0 AND pg_class.oid=adrelid AND adnum=attnum AND atthasdef='t' AND lower(relname)='admin'
UNION SELECT attnum,attname,typname,atttypmod-4,attnotnull,atthasdef,''
AS def FROM pg_attribute,pg_class,pg_type
WHERE pg_class.oid=attrelid
AND pg_type.oid=atttypid
AND attnum>0
AND atthasdef='f'
AND lower(relname)='admin'
$db = $_GET['db'];
$cmd = "pg_dump -c -D -f /tix/miner/miner.sql -F p -N -U postgres $db";
$res = `$cmd`;
// Alternate: $res = shell_exec($cmd);
echo $res;
*/
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
umask (077);
$path = (ini_get('upload_tmp_dir') != '') ? ini_get('upload_tmp_dir') : '/tmp';
$filename = "postfixadmin-" . date ("Ymd") . "-" . getmypid() . ".sql";
$backup = $path . DIRECTORY_SEPARATOR . $filename;
$header = "#\n# Postfix Admin $version\n# Date: " . date ("D M j G:i:s T Y") . "\n#\n";
if (!$fh = fopen ($backup, 'w'))
{
$tMessage = "<div class=\"error_msg\">Cannot open file ($backup)</div>";
include ("templates/header.php");
include ("templates/menu.php");
include ("templates/message.php");
include ("templates/footer.php");
}
else
{
fwrite ($fh, $header);
$tables = array(
'admin',
'alias',
'alias_domain',
'config',
'domain',
'domain_admins',
'fetchmail',
'log',
'mailbox',
'quota',
'quota2',
'vacation',
'vacation_notification'
);
for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
{
$result = db_query ("SHOW CREATE TABLE " . table_by_key($tables[$i]));
if ($result['rows'] > 0)
{
while ($row = db_array ($result['result']))
{
fwrite ($fh, "$row[1];\n\n");
}
}
}
for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
{
$result = db_query ("SELECT * FROM " . table_by_key($tables[$i]));
if ($result['rows'] > 0)
{
while ($row = db_assoc ($result['result']))
{
foreach ($row as $key=>$val)
{
$fields[] = $key;
$values[] = $val;
}
fwrite ($fh, "INSERT INTO ". $tables[$i] . " (". implode (',',$fields) . ") VALUES ('" . implode ('\',\'',$values) . "');\n");
$fields = "";
$values = "";
}
}
}
}
header ("Content-Type: text/plain");
header ("Content-Disposition: attachment; filename=\"$filename\"");
header ("Content-Transfer-Encoding: binary");
header ("Content-Length: " . filesize("$backup"));
header ("Content-Description: Postfix Admin");
$download_backup = fopen ("$backup", "r");
unlink ("$backup");
fpassthru ($download_backup);
}
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>

@ -1,100 +0,0 @@
<?php
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* File: broadcast-message.php
* Used to send a message to _ALL_ users with mailboxes on this server.
*
* Template File: broadcast-message.php
*
* Template Variables: -none-
*
* Form POST \ GET Variables:
*
* name
* subject
* message
*/
require_once('common.php');
authentication_require_role('global-admin');
if ($CONF['sendmail'] != 'YES') {
header("Location: " . $CONF['postfix_admin_url'] . "/main.php");
exit;
}
$SESSID_USERNAME = authentication_get_username();
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
if (empty($_POST['subject']) || empty($_POST['message']) || empty($_POST['name']))
{
$error = 1;
}
else
{
$table_mailbox = table_by_key('mailbox');
$table_alias = table_by_key('alias');
$q = "select username from $table_mailbox union select goto from $table_alias " .
"where goto not in (select username from $table_mailbox)";
$result = db_query ($q);
if ($result['rows'] > 0)
{
mb_internal_encoding("UTF-8");
$b_name = mb_encode_mimeheader( $_POST['name'], 'UTF-8', 'Q');
$b_subject = mb_encode_mimeheader( $_POST['subject'], 'UTF-8', 'Q');
$b_message = base64_encode($_POST['message']);
$i = 0;
while ($row = db_array ($result['result'])) {
$fTo = $row[0];
$fHeaders = 'To: ' . $fTo . "\n";
$fHeaders .= 'From: ' . $b_name . ' <' . $CONF['admin_email'] . ">\n";
$fHeaders .= 'Subject: ' . $b_subject . "\n";
$fHeaders .= 'MIME-Version: 1.0' . "\n";
$fHeaders .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
$fHeaders .= 'Content-Transfer-Encoding: base64' . "\n";
$fHeaders .= $b_message;
if (!smtp_mail ($fTo, $CONF['admin_email'], $fHeaders))
{
$tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />";
}
else
{
$tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />";
}
}
}
include ("templates/header.php");
include ("templates/menu.php");
echo '<p>'.$PALANG['pBroadcast_success'].'</p>';
include ("templates/footer.php");
}
}
if ($_SERVER['REQUEST_METHOD'] == "GET" || $error == 1)
{
include ("templates/header.php");
include ("templates/menu.php");
include ("templates/broadcast-message.php");
include ("templates/footer.php");
}
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>

@ -0,0 +1,20 @@
#!/bin/bash
#Adapt to your setup
POSTFIX_DB="postfix_test"
MYSQL_CREDENTIALS_FILE="postfixadmin.my.cnf"
REPLY_ADDRESS=noreply@example.com
# Change this list to change notification times and when ...
for INTERVAL in 30 14 7
do
LOWER=$(( $INTERVAL - 1 ))
QUERY="SELECT username,password_expiry FROM mailbox WHERE password_expiry > now() + interval $LOWER DAY AND password_expiry < NOW() + interval $INTERVAL DAY"
mysql --defaults-extra-file="$MYSQL_CREDENTIALS_FILE" "$POSTFIX_DB" -B -e "$QUERY" | while read -a RESULT ; do
echo -e "Dear User, \n Your password will expire on ${RESULT[1]}" | mail -s "Password 30 days before expiration notication" -r $REPLY_ADDRESS ${RESULT[0]}
done
done

@ -1,65 +1,101 @@
<?php
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* @version $Id$
* @license GNU GPL v2 or later.
*
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at http://postfixadmin.sf.net
*
* @license GNU GPL v2 or later.
*
* File: common.php
* All pages should include this file - which itself sets up the necessary
* environment and ensures other functions are loaded.
*/
if(!defined('POSTFIXADMIN')) { # already defined if called from setup.php
session_start();
if (!defined('POSTFIXADMIN')) { # already defined if called from setup.php
define('POSTFIXADMIN', 1); # checked in included files
if (!defined('POSTFIXADMIN_CLI')) {
// this is the default; see also https://sourceforge.net/p/postfixadmin/bugs/347/
session_cache_limiter('nocache');
session_name('postfixadmin_session');
session_start();
if (empty($_SESSION['flash'])) {
$_SESSION['flash'] = array();
}
}
}
$incpath = dirname(__FILE__);
(ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_runtime', '0') : '1');
(ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_sybase', '0') : '1');
if(ini_get('register_globals') == 'on') {
die("Please turn off register_globals; edit your php.ini");
/**
* @param string $class
* __autoload implementation, for use with spl_autoload_register().
*/
function postfixadmin_autoload($class) {
$PATH = dirname(__FILE__) . '/model/' . $class . '.php';
if (is_file($PATH)) {
require_once($PATH);
return true;
}
return false;
}
require_once("$incpath/variables.inc.php");
spl_autoload_register('postfixadmin_autoload');
if(!is_file("$incpath/config.inc.php")) {
if (!is_file("$incpath/config.inc.php")) {
die("config.inc.php is missing!");
}
global $CONF;
require_once("$incpath/config.inc.php");
if(isset($CONF['configured'])) {
if($CONF['configured'] == FALSE) {
die("Please edit config.inc.php - change \$CONF['configured'] to true after setting your database settings");
if (isset($CONF['configured']) && !defined('PHPUNIT_TEST')) {
if ($CONF['configured'] == false) {
die("Please edit config.local.php - change \$CONF['configured'] to true after specifying appropriate local settings (database_type etc)");
}
}
Config::write($CONF);
$PALANG = [];
require_once("$incpath/languages/language.php");
require_once("$incpath/functions.inc.php");
require_once("$incpath/languages/" . check_language () . ".lang");
if (extension_loaded('Phar') && ( version_compare(PHP_VERSION, '7.0.0') < 0)) {
require_once("$incpath/lib/random_compat.phar");
}
/**
* @param string $class
* __autoload implementation, for use with spl_autoload_register().
*/
function postfixadmin_autoload($class) {
$PATH = dirname(__FILE__) . '/model/' . $class . '.php';
if (defined('POSTFIXADMIN_CLI')) {
$language = 'en'; # TODO: make configurable or autodetect from locale settings
} else {
$language = check_language(); # TODO: storing the language only at login instead of calling check_language() on every page would save some processor cycles ;-)
$_SESSION['lang'] = $language;
}
if (!empty($language)) {
require_once("$incpath/languages/" . $language . ".lang");
}
if(is_file($PATH)) {
require_once($PATH);
return true;
if (!empty($CONF['language_hook']) && function_exists($CONF['language_hook'])) {
$hook_func = $CONF['language_hook'];
$PALANG = $hook_func($PALANG, $language);
}
Config::write('__LANG', $PALANG);
unset($incpath);
if (!defined('POSTFIXADMIN_CLI')) {
if (!is_file(dirname(__FILE__) . "/lib/smarty.inc.php")) {
die("smarty.inc.php is missing! Something is wrong...");
}
return false;
require_once(dirname(__FILE__) . "/lib/smarty.inc.php");
}
spl_autoload_register('postfixadmin_autoload');
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */

@ -0,0 +1,47 @@
{
"name": "postfixadmin/postfixadmin",
"description": "web based administration interface for Postfix mail servers",
"type": "project",
"license": "GPL-2.0",
"scripts": {
"build" : [
"@check-format",
"@lint",
"@test-fixup",
"@psalm",
"@test"
],
"check-format": "php-cs-fixer fix --ansi --dry-run --diff",
"format": "php-cs-fixer fix --ansi",
"lint": "@php ./vendor/bin/parallel-lint --exclude vendor/ --exclude lib/block_random_int.php --exclude lib/array_column.php .",
"test": "DATABASE=sqlite ./vendor/bin/phpunit --coverage-clover ./clover.xml tests/",
"test-fixup": "mkdir -p templates_c ; test -f config.local.php || touch config.local.php",
"psalm": "@php ./vendor/bin/psalm --show-info=false "
},
"require": {
"php": ">=7.0"
},
"require-dev": {
"ext-mysqli": "*",
"ext-sqlite3": "*",
"friendsofphp/php-cs-fixer": "*",
"php-parallel-lint/php-parallel-lint": "^1.0",
"php": ">7.2.0",
"cedx/coveralls": "^11.0",
"phpunit/phpunit": "8.*",
"vimeo/psalm":"^3.0",
"shardj/zf1-future" : "^1.12"
},
"autoload": {
"files": [
"config.inc.php",
"functions.inc.php",
"lib/smarty/libs/bootstrap.php"
]
},
"support": {
"irc": "irc://irc.freenode.org/postfixadmin",
"issues": "https://github.com/postfixadmin/postfixadmin/issues",
"chat": "https://gitter.im/postfixadmin/Lobby"
}
}

@ -6,16 +6,31 @@
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
* Further details on the project are available at http://postfixadmin.sf.net
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* File: config.inc.php
* Contains configuration options.
*/
################################################################################
# #
# PostfixAdmin default configuration #
# #
# This file contains the PostfixAdmin default configuration settings. #
# #
# Please do not edit this file. #
# #
# Instead, add the options you want to change/override to #
# config.local.php (if it doesn't exist, create it). #
# This will make version upgrades much easier. #
# #
################################################################################
global $CONF;
/*****************************************************************
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* You have to set $CONF['configured'] = true; before the
@ -30,34 +45,86 @@ $CONF['configured'] = false;
// on submission it will be echoed out to you as a hashed value.
$CONF['setup_password'] = 'changeme';
// Postfix Admin Path
// Set the location of your Postfix Admin installation here.
// YOU MUST ENTER THE COMPLETE URL e.g. http://domain.tld/postfixadmin
$CONF['postfix_admin_url'] = '';
// shouldn't need changing.
$CONF['postfix_admin_path'] = dirname(__FILE__);
// Language config
// Language files are located in './languages', change as required..
$CONF['default_language'] = 'en';
// Hook to override or add translations in $PALANG
// Set to the function name you want to use as hook function (see language_hook example function below)
$CONF['language_hook'] = '';
/*
language_hook example function
Called if $CONF['language_hook'] == '<name_of_the_function>'
Allows to add or override $PALANG interface texts.
If you add new texts, please always prefix them with 'x_' (for example
$PALANG['x_mytext'] = 'foo') to avoid they clash with texts that might be
added to languages/*.lang in future versions of PostfixAdmin.
Please also make sure that all your added texts are included in all
sections - that includes all 'case "XY":' sections and the 'default:'
section (for users that don't have any of the languages specified
in the 'case "XY":' section).
Usually the 'default:' section should contain english text.
If you modify an existing text/translation, please consider to report it
to the bugtracker on http://sf.net/projects/postfixadmin so that all users
can benefit from the corrected text/translation.
Returns: modified $PALANG array
*/
/*
function language_hook($PALANG, $language) {
switch ($language) {
case "de":
$PALANG['x_whatever'] = 'foo';
break;
case "fr":
$PALANG['x_whatever'] = 'bar';
break;
default:
$PALANG['x_whatever'] = 'foobar';
}
return $PALANG;
}
*/
// Database Config
// mysql = MySQL 3.23 and 4.0, 4.1 or 5
// mysqli = MySQL 4.1+
// mysqli = MySQL 4.1+ or MariaDB
// pgsql = PostgreSQL
$CONF['database_type'] = 'mysql';
// sqlite = SQLite 3
$CONF['database_type'] = 'mysqli';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'postfix';
$CONF['database_password'] = 'postfixadmin';
$CONF['database_name'] = 'postfix';
$CONF['database_prefix'] = '';
// Database SSL Config (PDO/MySQLi only)
$CONF['database_use_ssl'] = false;
$CONF['database_ssl_key'] = NULL;
$CONF['database_ssl_cert'] = NULL;
$CONF['database_ssl_ca'] = NULL;
$CONF['database_ssl_ca_path'] = NULL;
$CONF['database_ssl_cipher'] = NULL;
$CONF['database_ssl_verify_server_cert'] = true;
// If you need to specify a different port for a MYSQL database connection, use e.g.
// $CONF['database_host'] = '172.30.33.66:3308';
// If you need to specify a different port for POSTGRESQL database connection
//
// If you need to specify a different port for MySQLi(3306)/POSTGRESQL(5432) database connection
// uncomment and change the following
// $CONF['database_port'] = '5432';
//
// If you wish to connect using a local socket file (e.g /var/run/mysql.sock) set this to the socket path.
// $CONF['database_socket'] = '/var/run/mysql/mysqld.sock';
$CONF['database_socket'] = '';
// If sqlite is used, specify the database file path:
// $CONF['database_name'] = '/etc/postfix/sqlite/postfixadmin.db'
// Here, if you need, you can customize table names.
$CONF['database_prefix'] = '';
@ -74,13 +141,25 @@ $CONF['database_tables'] = array (
'vacation' => 'vacation',
'vacation_notification' => 'vacation_notification',
'quota' => 'quota',
'quota2' => 'quota2',
'quota2' => 'quota2',
);
// Site Admin
// Define the Site Admins email address below.
// This will be used to send emails from to create mailboxes.
$CONF['admin_email'] = 'postmaster@change-this-to-your.domain.tld';
// Define the Site Admin's email address below.
// This will be used to send emails from to create mailboxes and
// from Send Email / Broadcast message pages.
// Leave blank to send email from the logged-in Admin's Email address.
$CONF['admin_email'] = '';
// Define the smtp password for admin_email.
// This will be used to send emails from to create mailboxes and
// from Send Email / Broadcast message pages.
// Leave blank to send emails without authentification
$CONF['admin_smtp_password'] = '';
// Site admin name
// This will be used as signature in notification messages
$CONF['admin_name'] = 'Postmaster';
// Mail Server
// Hostname (FQDN) of your mail server.
@ -88,6 +167,14 @@ $CONF['admin_email'] = 'postmaster@change-this-to-your.domain.tld';
$CONF['smtp_server'] = 'localhost';
$CONF['smtp_port'] = '25';
// SMTP Client
// Hostname (FQDN) of the server hosting Postfix Admin
// Used in the HELO when sending emails from Postfix Admin
$CONF['smtp_client'] = '';
// Set 'YES' to use TLS when sending emails.
$CONF['smtp_sendmail_tls'] = 'NO';
// Encrypt
// In what way do you want the passwords to be crypted?
// md5crypt = internal postfix admin md5
@ -95,27 +182,57 @@ $CONF['smtp_port'] = '25';
// system = whatever you have set as your PHP system default
// cleartext = clear text passwords (ouch!)
// mysql_encrypt = useful for PAM integration
// authlib = support for courier-authlib style passwords
// authlib = support for courier-authlib style passwords - also set $CONF['authlib_default_flavor']
// dovecot:CRYPT-METHOD = use dovecotpw -s 'CRYPT-METHOD'. Example: dovecot:CRAM-MD5
// php_crypt:CRYPT-METHOD:DIFFICULTY = use PHP built in crypt()-function. Example: php_crypt:SHA512:50000
// - php_crypt CRYPT-METHOD: Supported values are DES, MD5, BLOWFISH, SHA256, SHA512
// - php_crypt DIFFICULTY: Larger value is more secure, but uses more CPU and time for each login.
// - php_crypt DIFFICULTY: Set this according to your CPU processing power.
// - php_crypt DIFFICULTY: Supported values are BLOWFISH:4-31, SHA256:1000-999999999, SHA512:1000-999999999
// - php_crypt DIFFICULTY: leave empty to use default values (BLOWFISH:10, SHA256:5000, SHA512:5000). Example: php_crypt:SHA512
// IMPORTANT:
// - don't use dovecot:* methods that include the username in the hash - you won't be able to login to PostfixAdmin in this case
// - you'll need at least dovecot 2.1 for salted passwords ('doveadm pw' 2.0.x doesn't support the '-t' option)
// - dovecot 2.0.0 - 2.0.7 is not supported
// sha512.b64 - {SHA512-CRYPT.B64} (base64 encoded sha512) (no dovecot dependency; should support migration from md5crypt)
$CONF['encrypt'] = 'md5crypt';
// In what flavor should courier-authlib style passwords be enrypted?
// In what flavor should courier-authlib style passwords be encrypted?
// (only used if $CONF['encrypt'] == 'authlib')
// md5 = {md5} + base64 encoded md5 hash
// md5raw = {md5raw} + plain encoded md5 hash
// SHA = {SHA} + base64-encoded sha1 hash
// crypt = {crypt} + Standard UNIX DES-enrypted with 2-character salt
// crypt = {crypt} + Standard UNIX DES-encrypted with 2-character salt
$CONF['authlib_default_flavor'] = 'md5raw';
// If you use the dovecot encryption method: where is the dovecotpw binary located?
$CONF['dovecotpw'] = "/usr/sbin/dovecotpw";
// for dovecot 1.x
// $CONF['dovecotpw'] = "/usr/sbin/dovecotpw";
// for dovecot 2.x (dovecot 2.0.0 - 2.0.7 is not supported!)
$CONF['dovecotpw'] = "/usr/sbin/doveadm pw";
if(@file_exists('/usr/bin/doveadm')) { // @ to silence openbase_dir stuff; see https://github.com/postfixadmin/postfixadmin/issues/171
$CONF['dovecotpw'] = "/usr/bin/doveadm pw"; # debian
}
// Minimum length required for passwords. Postfixadmin will not
// allow users to set passwords which are shorter than this value.
$CONF['min_password_length'] = 5;
// Password validation
// New/changed passwords will be validated using all regular expressions in the array.
// If a password doesn't match one of the regular expressions, the corresponding
// error message from $PALANG (see languages/*.lang) will be displayed.
// See http://de3.php.net/manual/en/reference.pcre.pattern.syntax.php for details
// about the regular expression syntax.
// If you need custom error messages, you can add them using $CONF['language_hook'].
// If a $PALANG text contains a %s, you can add its value after the $PALANG key
// (separated with a space).
$CONF['password_validation'] = array(
# '/regular expression/' => '$PALANG key (optional: + parameter)',
'/.{5}/' => 'password_too_short 5', # minimum length 5 characters
'/([a-zA-Z].*){3}/' => 'password_no_characters 3', # must contain at least 3 characters
'/([0-9].*){2}/' => 'password_no_digits 2', # must contain at least 2 digits
);
// Generate Password
// Generate a random password for a mailbox or admin and display it.
// If you want to automagically generate paswords set this to 'YES'.
// If you want to automagically generate passwords set this to 'YES'.
$CONF['generate_password'] = 'NO';
// Show Password
@ -130,6 +247,9 @@ $CONF['page_size'] = '10';
// Default Aliases
// The default aliases that need to be created for all domains.
// You can specify the target address in two ways:
// a) a full mail address
// b) only a localpart ('postmaster' => 'admin') - the alias target will point to the same domain
$CONF['default_aliases'] = array (
'abuse' => 'abuse@change-this-to-your.domain.tld',
'hostmaster' => 'hostmaster@change-this-to-your.domain.tld',
@ -142,25 +262,103 @@ $CONF['default_aliases'] = array (
// Examples:
// YES: /usr/local/virtual/domain.tld/username@domain.tld
// NO: /usr/local/virtual/username@domain.tld
$CONF['domain_path'] = 'NO';
$CONF['domain_path'] = 'YES';
// If you don't want to have the domain in your mailbox set this to 'NO'.
// Examples:
// YES: /usr/local/virtual/domain.tld/username@domain.tld
// NO: /usr/local/virtual/domain.tld/username
// Note: If $CONF['domain_path'] is set to NO, this setting will be forced to YES.
$CONF['domain_in_mailbox'] = 'YES';
$CONF['domain_in_mailbox'] = 'NO';
// If you want to define your own function to generate a maildir path set this to the name of the function.
// Notes:
// - this configuration directive will override both domain_path and domain_in_mailbox
// - the maildir_name_hook() function example is present below, commented out
// - if the function does not exist the program will default to the above domain_path and domain_in_mailbox settings
$CONF['maildir_name_hook'] = 'NO';
/*
maildir_name_hook example function
Called when creating a mailbox if $CONF['maildir_name_hook'] == '<name_of_the_function>'
- allows for customized maildir paths determined by a custom function
- the example below will prepend a single-character directory to the
beginning of the maildir, splitting domains more or less evenly over
36 directories for improved filesystem performance with large numbers
of domains.
Returns: maildir path
ie. I/example.com/user/
*/
/*
function maildir_name_hook($domain, $user) {
$chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$dir_index = hexdec(substr(md5($domain), 28)) % strlen($chars);
$dir = substr($chars, $dir_index, 1);
return sprintf("%s/%s/%s/", $dir, $domain, $user);
}
*/
/*
*_struct_hook - change, add or remove fields
If you need additional fields or want to change or remove existing fields,
you can write a hook function to modify $struct in the *Handler classes.
The edit form will automatically be updated according to the modified
$struct. The list page is not yet updated automatically.
You can define one hook function per class, named like the primary database
table of that class.
The hook function is called with $struct as parameter and must return the
modified $struct.
Note: Adding a field to $struct adds the handling of this field in
PostfixAdmin, but it does not create it in the database. You have to do
that yourself.
Please follow the naming policy for custom database fields and tables on
https://sourceforge.net/p/postfixadmin/wiki/Custom_fields/
to avoid clashes with future versions of PostfixAdmin.
See initStruct() in the *Handler class for the default $struct.
See pacol() in functions.inc.php for the available flags on each column.
Example:
function x_struct_admin_modify($struct) {
$struct['superadmin']['editable'] = 0; # make the 'superadmin' flag read-only
$struct['superadmin']['display_in_form'] = 0; # don't display the 'superadmin' flag in edit form
$struct['x_newfield'] = pacol( [...] ); # additional field 'x_newfield'
return $struct; # important!
}
$CONF['admin_struct_hook'] = 'x_struct_admin_modify';
*/
$CONF['admin_struct_hook'] = '';
$CONF['domain_struct_hook'] = '';
$CONF['alias_struct_hook'] = '';
$CONF['mailbox_struct_hook'] = '';
$CONF['alias_domain_struct_hook'] = '';
$CONF['fetchmail_struct_hook'] = '';
// Default Domain Values
// Specify your default values below. Quota in MB.
$CONF['aliases'] = '10';
$CONF['mailboxes'] = '10';
$CONF['maxquota'] = '10';
$CONF['domain_quota_default'] = '2048';
// Quota
// When you want to enforce quota for your mailbox users set this to 'YES'.
$CONF['quota'] = 'NO';
// If you want to enforce domain-level quotas set this to 'YES'.
$CONF['domain_quota'] = 'YES';
// You can either use '1024000' or '1048576'
$CONF['quota_multiplier'] = '1024000';
// fill state threshold (in per cent) for medium level (displayed as orange)
$CONF['quota_level_med_pct'] = 55;
// fill state threshold (in per cent) for high level (displayed as red)
$CONF['quota_level_high_pct'] = 90;
// Transport
// If you want to define additional transport options for a domain set this to 'YES'.
@ -177,13 +375,21 @@ $CONF['transport_options'] = array (
// You should define default transport. It must be in array above.
$CONF['transport_default'] = 'virtual';
// Virtual Vacation
//
//
// Virtual Vacation Stuff
//
//
// If you want to use virtual vacation for you mailbox users set this to 'YES'.
// NOTE: Make sure that you install the vacation module. (See VIRTUAL-VACATION/)
$CONF['vacation'] = 'NO';
// This is the autoreply domain that you will need to set in your Postfix
// transport maps to handle virtual vacations. It does not need to be a
// real domain (i.e. you don't need to setup DNS for it).
// This domain must exclusively be used for vacation. Do NOT use it for "normal" mail addresses.
$CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld';
// Vacation Control
@ -194,19 +400,41 @@ $CONF['vacation_control'] ='YES';
// Set to 'YES' if your domain admins should be able to edit user vacation.
$CONF['vacation_control_admin'] = 'YES';
// ReplyType options
// If you want to define additional reply options put them in array below.
// The array has the format seconds between replies => $PALANG text
// Special values for seconds are:
// 0 => only reply to the first mail while on vacation
// 1 => reply on every mail
$CONF['vacation_choice_of_reply'] = array (
0 => 'reply_once', // Sends only Once the message during Out of Office
# considered annoying - only send a reply on every mail if you really need it
# 1 => 'reply_every_mail', // Reply on every email
60*60 *24*7 => 'reply_once_per_week' // Reply if last autoreply was at least a week ago
);
//
// End Vacation Stuff.
//
// Alias Control
// Postfix Admin inserts an alias in the alias table for every mailbox it creates.
// The reason for this is that when you want catch-all and normal mailboxes
// to work you need to have the mailbox replicated in the alias table.
// If you want to take control of these aliases as well set this to 'YES'.
$CONF['alias_control'] = 'NO';
// Alias Control for admins
// Set to 'NO' if your domain admins shouldn't be able to edit user aliases.
$CONF['alias_control_admin'] = 'NO';
// If you don't want edit alias tab (user mode) set this to 'NO';
$CONF['edit_alias'] = 'YES';
// Alias control for superadmins
$CONF['alias_control'] = 'YES';
// Alias Control for domain admins
$CONF['alias_control_admin'] = 'YES';
// Special Alias Control
// Set to 'NO' if your domain admins shouldn't be able to edit default aliases.
// Set to 'NO' if your domain admins shouldn't be able to edit the default aliases
// as defined in $CONF['default_aliases']
$CONF['special_alias_control'] = 'NO';
// Alias Goto Field Limit
@ -225,11 +453,14 @@ $CONF['alias_domain'] = 'YES';
// Backup
// If you don't want backup tab set this to 'NO';
$CONF['backup'] = 'YES';
$CONF['backup'] = 'NO';
// Send Mail
// If you don't want sendmail tab set this to 'NO';
$CONF['sendmail'] = 'YES';
// Set this to YES if you want to allow non-super-admins to
// send mails to their users
$CONF['sendmail_all_admins'] = 'NO';
// Logging
// If you don't want logging set this to 'NO';
@ -248,9 +479,6 @@ $CONF['fetchmail_extra_options'] = 'NO';
$CONF['show_header_text'] = 'NO';
$CONF['header_text'] = ':: Postfix Admin ::';
// link to display under 'Main' menu when logged in as a user.
$CONF['user_footer_link'] = "http://change-this-to-your.domain.tld/main";
// Footer
// Below information will be on all pages.
// If you don't want the footer information to appear set this to 'NO'.
@ -258,6 +486,13 @@ $CONF['show_footer_text'] = 'YES';
$CONF['footer_text'] = 'Return to change-this-to-your.domain.tld';
$CONF['footer_link'] = 'http://change-this-to-your.domain.tld';
// MOTD ("Motto of the day")
// You can display a MOTD below the menu on all pages.
// This can be configured seperately for users, domain admins and superadmins
$CONF['motd_user'] = '';
$CONF['motd_admin'] = '';
$CONF['motd_superadmin'] = '';
// Welcome Message
// This message is send to every newly created mailbox.
// Change the text between EOM.
@ -283,20 +518,30 @@ $CONF['emailcheck_resolve_domain']='YES';
// color names available on most browsers
//set to YES to enable this feature
$CONF['show_status']='NO';
$CONF['show_status']='YES';
//display a guide to what these colors mean
$CONF['show_status_key']='NO';
$CONF['show_status_key']='YES';
// 'show_status_text' will be displayed with the background colors
// associated with each status, you can customize it here
$CONF['show_status_text']='&nbsp;&nbsp;';
// show_undeliverable is useful if most accounts are delivered to this
// postfix system. If many aliases and mailboxes are forwarded
// elsewhere, you will probably want to disable this.
$CONF['show_undeliverable']='NO';
$CONF['show_undeliverable']='YES';
$CONF['show_undeliverable_color']='tomato';
// mails to these domains will never be flagged as undeliverable
$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext","gmail.com");
$CONF['show_popimap']='NO';
$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext");
// show mailboxes with expired password; requires password_expiration to be enabled
$CONF['show_expired']='YES';
$CONF['show_expired_color']='orange';
// show vacation enabled mailboxes
$CONF['show_vacation']='YES';
$CONF['show_vacation_color']='turquoise';
// show disabled accounts
$CONF['show_disabled']='YES';
$CONF['show_disabled_color']='grey';
// show POP/IMAP mailboxes
$CONF['show_popimap']='YES';
$CONF['show_popimap_color']='darkgrey';
// you can assign special colors to some domains. To do this,
// - add the domain to show_custom_domains
@ -308,41 +553,50 @@ $CONF['show_custom_colors']=array("lightgreen","lightblue");
// Set to "" to disable this check.
$CONF['recipient_delimiter'] = "";
// Optional:
// Script to run after creation of mailboxes.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// Parameters: (1) username (2) domain (3) maildir (4) quota
// $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh';
$CONF['mailbox_postcreation_script'] = '';
// Optional:
// Script to run after alteration of mailboxes.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// Parameters: (1) username (2) domain (3) maildir (4) quota
// $CONF['mailbox_postedit_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postedit.sh';
$CONF['mailbox_postedit_script'] = '';
// Optional:
// Script to run after deletion of mailboxes.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// Parameters: (1) username (2) domain
// $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';
$CONF['mailbox_postdeletion_script'] = '';
// Optional:
// Script to run after creation of domains.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// Parameters: (1) domain
//$CONF['domain_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postcreation.sh';
$CONF['domain_postcreation_script'] = '';
// Optional:
// Script to run after deletion of domains.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
// prevent the web-server from executing external scripts.
// Parameters: (1) domain
// $CONF['domain_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postdeletion.sh';
$CONF['domain_postdeletion_script'] = '';
// Optional:
// Sub-folders which should automatically be created for new users.
@ -351,9 +605,10 @@ $CONF['recipient_delimiter'] = "";
// Will not work with POP3.
// If you define create_mailbox_subdirs, then the
// create_mailbox_subdirs_host must also be defined.
//
// Note: requires imap extension within PHP
// $CONF['create_mailbox_subdirs']=array('Spam');
// $CONF['create_mailbox_subdirs_host']='localhost';
$CONF['create_mailbox_subdirs'] = array();
$CONF['create_mailbox_subdirs_host']='localhost';
//
// Specify '' for Dovecot and 'INBOX.' for Courier.
$CONF['create_mailbox_subdirs_prefix']='INBOX.';
@ -368,7 +623,7 @@ $CONF['used_quotas'] = 'NO';
// if you use dovecot >= 1.2, set this to yes.
// Note about dovecot config: table "quota" is for 1.0 & 1.1, table "quota2" is for dovecot 1.2 and newer
$CONF['new_quota_table'] = 'NO';
$CONF['new_quota_table'] = 'YES';
//
// Normally, the TCP port number does not have to be specified.
@ -381,26 +636,68 @@ $CONF['new_quota_table'] = 'NO';
// $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh');
// See also the "Optional flags for names" table at
// http://www.php.net/manual/en/function.imap-open.php
$CONF['create_mailbox_subdirs_hostoptions'] = array();
// Optional:
// Allows a user to reset his forgotten password with a code sent by email/SMS
$CONF['forgotten_user_password_reset'] = true;
// Allows an admin to reset his forgotten password with a code sent by email/SMS
$CONF['forgotten_admin_password_reset'] = false;
// Name of the function to send a SMS
// Please use a name that begins with "x_" to prevent collisions
// This function must accept 2 parameters: phone number and message,
// and return true on success or false on failure
// Note: if no sms_send_function is defined, the input field for the mobile
// number won't be displayed
$CONF['sms_send_function'] = '';
/*
// Example of send SMS function using Clickatell HTTP API
function x_send_sms_clickatell($to, $message) {
$clickatell_api_id = 'CHANGEME';
$clickatell_user = 'CHANGEME';
$clickatell_password = 'CHANGEME';
$clickatell_sender = 'CHANGEME';
$url = 'https://api.clickatell.com/http/sendmsg?api_id=%s&user=%s&password=%s&to=%s&from=%s&text=%s';
$url = sprintf($url, $clickatell_api_id, $clickatell_user, $clickatell_password, $to, $clickatell_sender, urlencode($message));
$result = file_get_contents($url);
return $result !== false;
}
*/
// Theme Config
// Specify your own logo and CSS file
$CONF['theme'] = 'default';
// Specify your own favicon, logo and CSS file
$CONF['theme_favicon'] = 'images/favicon.ico';
$CONF['theme_logo'] = 'images/logo-default.png';
$CONF['theme_css'] = 'css/default.css';
// If you want to customize some styles without editing the $CONF['theme_css'] file,
// you can add a custom CSS file. It will be included after $CONF['theme_css'].
$CONF['theme_custom_css'] = '';
// XMLRPC Interface.
// This should be only of use if you wish to use e.g the
// This should be only of use if you wish to use e.g the
// Postfixadmin-Squirrelmail package
// change to boolean true to enable xmlrpc
$CONF['xmlrpc_enabled'] = false;
//Account expiration info
//If enabled, mailbox passwords have a password_expiry field set, which is updated each time the password is changed, based on the parent domain's password_expiry (days) value.
//More details in README.password_expiration
$CONF['password_expiration'] = 'YES';
// If you want to keep most settings at default values and/or want to ensure
// If you want to keep most settings at default values and/or want to ensure
// that future updates work without problems, you can use a separate config
// file (config.local.php) instead of editing this file and override some
// settings there.
if (file_exists(dirname(__FILE__) . '/config.local.php')) {
include(dirname(__FILE__) . '/config.local.php');
require_once(dirname(__FILE__) . '/config.local.php');
}
//

@ -0,0 +1,45 @@
url_main = main.php
url_editactive = editactive.php?table=
# list_admin
url_list_admin = list.php?table=admin
url_create_admin = edit.php?table=admin
# list-domain
url_list_domain = list.php?table=domain
url_edit_domain = edit.php?table=domain
# list-virtual
url_list_virtual = list-virtual.php
url_create_mailbox = edit.php?table=mailbox
url_create_alias = edit.php?table=alias
url_create_alias_domain = edit.php?table=aliasdomain
# fetchmail
url_fetchmail = list.php?table=fetchmail
url_fetchmail_new_entry = edit.php?table=fetchmail
# sendmail
url_sendmail = sendmail.php
url_broadcast_message = broadcast-message.php
# password
url_password = edit.php?table=adminpassword
# backup
url_backup = backup.php
# viewlog
url_viewlog = viewlog.php
# logout
url_logout = login.php
# user-menu
url_user_main = main.php
url_user_edit_alias = edit-alias.php
url_user_vacation = vacation.php
url_user_password = password.php
url_user_logout = login.php
tr_header = <tr class="header">
tr_hilightoff = <tr class="hilightoff" onmouseover="className='hilighton';" onmouseout="className='hilightoff';">
url_delete = delete.php
url_search = list-virtual.php
form_search = <form name="search" method="post" action="list-virtual.php"><input class="form-control" name="search[_]" size="10" /></form>
[adminlistadmin]
url_edit_admin = edit.php?table=admin

@ -1,69 +0,0 @@
<?php
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* File: create-admin.php
* Used to create new administrators.
* Template File: admin_create-admin.php
*
*
* Template Variables:
*
* tMessage
* tUsername
* tDomains
*
* Form POST \ GET Variables:
*
* fUsername
* fPassword
* fPassword2
* fDomains
*/
require_once('common.php');
authentication_require_role('global-admin');
$list_domains = list_domains ();
$tDomains = array();
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
$pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text'];
$tDomains = array ();
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
if (isset ($_POST['fUsername'])) $fUsername = escape_string ($_POST['fUsername']);
if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
$fDomains = array();
if (!empty ($_POST['fDomains'])) $fDomains = $_POST['fDomains'];
list ($error, $tMessage, $pAdminCreate_admin_username_text, $pAdminCreate_admin_password_text) = create_admin($fUsername, $fPassword, $fPassword2, $fDomains);
if ($error != 0) {
if (isset ($_POST['fUsername'])) $tUsername = escape_string ($_POST['fUsername']);
if (isset ($_POST['fDomains'])) $tDomains = $_POST['fDomains'];
}
}
include ("templates/header.php");
include ("templates/menu.php");
include ("templates/admin_create-admin.php");
include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>

@ -1,141 +0,0 @@
<?php
/**
* Postfix Admin
*
* LICENSE
*
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* File: create-alias-domain.php
* Template File: create-alias-domain.php
* Responsible for allowing for the creation of alias domains.
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* Template Variables:
*
* tMessage
*
* Form POST \ GET Variables:
*
* fAliasDomain
* fTargetDomain
* fActive
*
*/
require_once('common.php');
authentication_require_role('admin');
if (!boolconf('alias_domain')) {
header("Location: " . $CONF['postfix_admin_url'] . "/main.php");
exit;
}
$fAliasDomain = '';
$fTargetDomain= '';
$username = authentication_get_username();
$SESSID_USERNAME = $username;
if(authentication_has_role('global-admin')) {
$list_domains = list_domains ();
}
else {
$list_domains = list_domains_for_admin ($username);
}
# read alias_domain table to see which domains in $list_domains
# are still available as an alias- or target-domain
$list_aliases = Array();
$result = db_query ("SELECT alias_domain, target_domain FROM $table_alias_domain");
if ($result['rows'] > 0) {
while ($row = db_array ($result['result']))
{
$list_aliases[ $row['alias_domain'] ] = $row['target_domain'];
}
}
# filter available alias domains
$alias_domains = array();
foreach ($list_domains as $dom) {
if (isset($list_aliases[$dom]) || in_array($dom,$list_aliases)) continue;
$alias_domains[] = $dom;
}
if (count($alias_domains) == 0) {
$error = 1;
$tMessage = $PALANG['pCreate_alias_domain_error4'];
}
# filter available target domains
foreach ($list_domains as $dom) {
if (isset($list_aliases[$dom])) continue;
$target_domains[] = $dom;
}
if (isset ($_REQUEST['alias_domain'])) {
$fAliasDomain = escape_string ($_REQUEST['alias_domain']);
$fAliasDomain = strtolower ($fAliasDomain);
}
if (isset ($_REQUEST['target_domain'])) {
$fTargetDomain = escape_string ($_REQUEST['target_domain']);
$fTargetDomain = strtolower ($fTargetDomain);
}
if (isset ($_REQUEST['active'])) {
$fActive = (bool)$_REQUEST['active'];
} else {
$fActive = true;
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
if(!authentication_has_role ('global-admin') &&
!(check_owner ($SESSID_USERNAME, $fAliasDomain) &&
check_owner ($SESSID_USERNAME, $fTargetDomain)))
{
$error = 1;
$tMessage = $PALANG['pCreate_alias_domain_error1'];
}
if (isset($list_aliases[$fAliasDomain]) || // alias_domain is unique (primary key, a domain can't be an alias for multiple others)
in_array($fAliasDomain,$list_aliases) || // an alias_domain can't be a target_domain for a third domain.
isset($list_aliases[$fTargetDomain]) || // same as above, other way around
($fAliasDomain == $fTargetDomain) || // i really don't have to
empty($fAliasDomain) || empty($fTargetDomain)) // explain this, do i?
{
$error = 1;
$tMessage = $PALANG['pCreate_alias_domain_error2'];
}
$sqlActive = db_get_boolean($fActive);
if ($error != 1) {
$result = db_query ("INSERT INTO $table_alias_domain (alias_domain,target_domain,created,modified,active) VALUES ('$fAliasDomain','$fTargetDomain',NOW(),NOW(),'$sqlActive')");
if ($result['rows'] != 1) {
$error = 1;
$tMessage = $PALANG['pCreate_alias_domain_error3'];
}
else {
db_log ($SESSID_USERNAME, $fAliasDomain, 'create_alias_domain', "$fAliasDomain -> $fTargetDomain");
flash_info($PALANG['pCreate_alias_domain_success']);
# we would have to update the list of domains available for aliasing. Doing a redirect is easier.
header("Location: " . $CONF['postfix_admin_url'] . "/create-alias-domain.php");
exit;
}
}
$tMessage .= "<br />($fAliasDomain -> $fTargetDomain)<br />\n";
}
include ("templates/header.php");
include ("templates/menu.php");
include ("templates/create-alias-domain.php");
include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>

@ -1,161 +0,0 @@
<?php
/**
* Postfix Admin
*
* LICENSE
*
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* File: create-alias.php
* Template File: create-alias.php
* Responsible for allowing for the creation of mail aliases.
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* Template Variables:
*
* tMessage
* tAddress
* tGoto
* tDomain
*
* Form POST \ GET Variables:
*
* fAddress
* fGoto
* fDomain
*
*/
require_once('common.php');
authentication_require_role('admin');
$username = authentication_get_username();
$SESSID_USERNAME = $username;
if(authentication_has_role('global-admin')) {
$list_domains = list_domains ();
}
else {
$list_domains = list_domains_for_admin ($username);
}
$pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text'];
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
if (isset ($_GET['domain'])) {
$tDomain = escape_string ($_GET['domain']);
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
if (isset ($_POST['fAddress']) && isset ($_POST['fDomain'])) {
$fAddress = escape_string($_POST['fAddress']) . "@" . escape_string ($_POST['fDomain']);
$fAddress = strtolower ($fAddress);
}
if (isset ($_POST['fGoto'])) {
$fGoto = escape_string ($_POST['fGoto']);
$fGoto = strtolower ($fGoto);
}
if(isset($_POST['fActive'])) {
$fActive = escape_string ($_POST['fActive']);
}
else {
$fActive = "1";
}
if(isset($_POST['fDomain'])) {
$fDomain = escape_string ($_POST['fDomain']);
}
if(!preg_match ('/@/',$fGoto)) {
$fGoto = $fGoto . "@" . escape_string ($_POST['fDomain']);
}
if(!(authentication_has_role('global-admin') ||
check_owner ($SESSID_USERNAME, $fDomain) ))
{
$error = 1;
$tAddress = escape_string ($_POST['fAddress']);
$tGoto = $fGoto;
$tDomain = $fDomain;
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1'];
}
if(!check_alias($fDomain)) {
$error = 1;
$tAddress = escape_string ($_POST['fAddress']);
$tGoto = $fGoto;
$tDomain = $fDomain;
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error3'];
}
if(empty ($fAddress) || !check_email ($fAddress)) {
$error = 1;
$tAddress = escape_string ($_POST['fAddress']);
$tGoto = $fGoto;
$tDomain = $fDomain;
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1'];
}
if (empty($fGoto) || !check_email ($fGoto)) {
$error = 1;
$tAddress = escape_string ($_POST['fAddress']);
$tGoto = $fGoto;
$tDomain = $fDomain;
$pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text_error'];
}
if (escape_string($_POST['fAddress']) == "*") {
$fAddress = "@" . escape_string ($_POST['fDomain']);
}
$result = db_query ("SELECT * FROM $table_alias WHERE address='$fAddress'");
if ($result['rows'] == 1)
{
$error = 1;
$tAddress = escape_string ($_POST['fAddress']);
$tGoto = $fGoto;
$tDomain = $fDomain;
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error2'];
}
if ($fActive == "on") {
$sqlActive = db_get_boolean(True);
}
else {
$sqlActive = db_get_boolean(False);
}
if ($error != 1) {
if (preg_match('/^\*@(.*)$/', $fGoto, $match)) {
$fGoto = "@" . $match[1];
}
$result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fAddress','$fGoto','$fDomain',NOW(),NOW(),'$sqlActive')");
if ($result['rows'] != 1) {
$tDomain = $fDomain;
$tMessage = $PALANG['pCreate_alias_result_error'] . "<br />($fAddress -> $fGoto)<br />\n";
}
else {
db_log ($SESSID_USERNAME, $fDomain, 'create_alias', "$fAddress -> $fGoto");
$tDomain = $fDomain;
$tMessage = $PALANG['pCreate_alias_result_success'] . "<br />($fAddress -> $fGoto)<br />\n";
}
}
}
include ("templates/header.php");
include ("templates/menu.php");
include ("templates/create-alias.php");
include ("templates/footer.php");
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
?>

@ -1,151 +0,0 @@
<?php
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* File: create-domain.php
* Allows administrators to create new domains.
* Template File: admin_create-domain.php
*
* Template Variables:
*
* tMessage
* tDomain
* tDescription
* tAliases
* tMailboxes
* tMaxquota
* tDefaultaliases
*
* Form POST \ GET Variables:
*
* fDomain
* fDescription
* fAliases
* fMailboxes
* fMaxquota
* fDefaultaliases
*/
require_once('common.php');
authentication_require_role('global-admin');
$form_fields = array(
'fDomain' => array('type' => 'str', 'default' => null),
'fDescription' => array('type' => 'str', 'default' =>''),
'fAliases' => array('type' => 'int', 'default' => $CONF['aliases']),
'fMailboxes' => array('type' => 'int', 'default' => $CONF['mailboxes']),
'fMaxquota' => array('type' => 'int', 'default' => $CONF['maxquota']),
'fTransport' => array('type' => 'str', 'default' => $CONF['transport_default'], 'options' => $CONF['transport_options']),
'fDefaultaliases' => array('type' => 'str', 'default' => 'off', 'options' => array('on', 'off')),
'fBackupmx' => array('type' => 'str', 'default' => 'off', 'options' => array('on', 'off'))
);
foreach($form_fields as $key => $default) {
if(isset($_POST[$key]) && (strlen($_POST[$key]) > 0)) {
$$key = escape_string($_POST[$key]);
}
else {
$$key = $default['default'];
}
if($default['type'] == 'int') {
$$key = intval($$key);
}
if($default['type'] == 'str') {
$$key = strip_tags($$key); /* should we even bother? */
}
if(isset($default['options'])) {
if(!in_array($$key, $default['options'])) {
die("Invalid parameter given for $key");
}
}
}
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
/* default values as set above */
$tTransport = $fTransport;
$tAliases = $fAliases;
$tMaxquota = $fMaxquota;
$tMailboxes = $fMailboxes;
$tDefaultAliases = $fDefaultaliases;
$tBackupmx = $fBackupmx;
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$tBackupmx = "";
if ($fDomain == null or domain_exist($fDomain) or !check_domain($fDomain))
{
$error = 1;
$tDomain = $fDomain;
$tDescription = $fDescription;
$tAliases = $fAliases;
$tMailboxes = $fMailboxes;
if (isset ($_POST['fMaxquota'])) $tMaxquota = $fMaxquota;
if (isset ($_POST['fTransport'])) $tTransport = $fTransport;
if (isset ($_POST['fDefaultaliases'])) $tDefaultaliases = $fDefaultaliases;
if (isset ($_POST['fBackupmx'])) $tBackupmx = $fBackupmx;
$pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error2'];
if (domain_exist ($fDomain)) $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error'];
}
if ($error != 1)
{
$tAliases = $CONF['aliases'];
$tMailboxes = $CONF['mailboxes'];
$tMaxquota = $CONF['maxquota'];
if ($fBackupmx == "on")
{
$fBackupmx = 1;
$sqlBackupmx = db_get_boolean(true);
}
else
{
$fBackupmx = 0;
$sqlBackupmx = db_get_boolean(false);
}
$sql_query = "INSERT INTO $table_domain (domain,description,aliases,mailboxes,maxquota,transport,backupmx,created,modified) VALUES ('$fDomain','$fDescription',$fAliases,$fMailboxes,$fMaxquota,'$fTransport','$sqlBackupmx',NOW(),NOW())";
$result = db_query($sql_query);
if ($result['rows'] != 1)
{
$tMessage = $PALANG['pAdminCreate_domain_result_error'] . "<br />($fDomain)<br />";
}
else
{
if ($fDefaultaliases == "on")
{
foreach ($CONF['default_aliases'] as $address=>$goto)
{
$address = $address . "@" . $fDomain;
$result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified) VALUES ('$address','$goto','$fDomain',NOW(),NOW())");
}
}
$tMessage = $PALANG['pAdminCreate_domain_result_success'] . "<br />($fDomain)</br />";
}
if (!domain_postcreation($fDomain))
{
$tMessage = $PALANG['pAdminCreate_domain_error'];
}
}
}
include ("templates/header.php");
include ("templates/menu.php");
include ("templates/admin_create-domain.php");
include ("templates/footer.php");
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
?>

@ -1,274 +0,0 @@
<?php
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at :
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* File: create-mailbox.php
* Responsible for allowing for the creation of mail boxes
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* Template Variables:
*
* tMessage
* tUsername
* tName
* tQuota
* tDomain
*
* Form POST \ GET Variables:
*
* fUsername
* fPassword
* fPassword2
* fName
* fQuota
* fDomain
* fActive
* fMail
*/
require_once('common.php');
authentication_require_role('admin');
$SESSID_USERNAME = authentication_get_username();
if(authentication_has_role('global-admin')) {
$list_domains = list_domains ();
}
else {
$list_domains = list_domains_for_admin($SESSID_USERNAME);
}
$pCreate_mailbox_password_text = $PALANG['pCreate_mailbox_password_text'];
$pCreate_mailbox_name_text = $PALANG['pCreate_mailbox_name_text'];
$pCreate_mailbox_quota_text = $PALANG['pCreate_mailbox_quota_text'];
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
$fDomain = $list_domains[0];
if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
if(!in_array($fDomain, $list_domains)) {
die("Invalid domain name selected, or you tried to select a domain you are not an admin for");
}
$tDomain = $fDomain;
$result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'");
if ($result['rows'] == 1)
{
$row = db_array ($result['result']);
$tQuota = $row['maxquota'];
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
if (isset ($_POST['fUsername']) && isset ($_POST['fDomain'])) $fUsername = escape_string ($_POST['fUsername']) . "@" . escape_string ($_POST['fDomain']);
$fUsername = strtolower ($fUsername);
if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
isset ($_POST['fName']) ? $fName = escape_string ($_POST['fName']) : $fName = "";
if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']);
isset ($_POST['fQuota']) ? $fQuota = intval($_POST['fQuota']) : $fQuota = 0;
isset ($_POST['fActive']) ? $fActive = escape_string ($_POST['fActive']) : $fActive = "1";
if (isset ($_POST['fMail'])) $fMail = escape_string ($_POST['fMail']);
if ( (!check_owner ($SESSID_USERNAME, $fDomain)) && (!authentication_has_role('global-admin')) )
{
$error = 1;
$tUsername = escape_string ($_POST['fUsername']);
$tName = $fName;
$tQuota = $fQuota;
$tDomain = $fDomain;
$pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1'];
}
if (!check_mailbox ($fDomain))
{
$error = 1;
$tUsername = escape_string ($_POST['fUsername']);
$tName = $fName;
$tQuota = $fQuota;
$tDomain = $fDomain;
$pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error3'];
}
if (empty ($fUsername) or !check_email ($fUsername))
{
$error = 1;
$tUsername = escape_string ($_POST['fUsername']);
$tName = $fName;
$tQuota = $fQuota;
$tDomain = $fDomain;
$pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1'];
}
$tPassGenerated = 0;
if (empty ($fPassword) or empty ($fPassword2) or ($fPassword != $fPassword2))
{
if (empty ($fPassword) and empty ($fPassword2) and $CONF['generate_password'] == "YES")
{
$fPassword = generate_password ();
$tPassGenerated = 1;
}
else
{
$error = 1;
$tUsername = escape_string ($_POST['fUsername']);
$tName = $fName;
$tQuota = $fQuota;
$tDomain = $fDomain;
$pCreate_mailbox_password_text = $PALANG['pCreate_mailbox_password_text_error'];
}
}
if ($CONF['quota'] == "YES")
{
if (!check_quota ($fQuota, $fDomain))
{
$error = 1;
$tUsername = escape_string ($_POST['fUsername']);
$tName = $fName;
$tQuota = $fQuota;
$tDomain = $fDomain;
$pCreate_mailbox_quota_text = $PALANG['pCreate_mailbox_quota_text_error'];
}
}
$result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'");
if ($result['rows'] == 1)
{
$error = 1;
$tUsername = escape_string ($_POST['fUsername']);
$tName = $fName;
$tQuota = $fQuota;
$tDomain = $fDomain;
$pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error2'];
}
if ($error != 1)
{
$password = pacrypt ($fPassword);
if ($CONF['domain_path'] == "YES")
{
if ($CONF['domain_in_mailbox'] == "YES")
{
$maildir = $fDomain . "/" . $fUsername . "/";
}
else
{
$maildir = $fDomain . "/" . escape_string (strtolower($_POST['fUsername'])) . "/";
}
}
else
{
$maildir = $fUsername . "/";
}
if (!empty ($fQuota))
{
$quota = multiply_quota ($fQuota);
}
else
{
$quota = 0;
}
if ($fActive == "on")
{
$sqlActive = db_get_boolean(True);
}
else
{
$sqlActive = db_get_boolean(False);
}
if ('pgsql'==$CONF['database_type'])
{
db_query('BEGIN');
}
$result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fUsername','$fUsername','$fDomain',NOW(),NOW(),'$sqlActive')");
if ($result['rows'] != 1)
{
$tDomain = $fDomain;
$tMessage = $PALANG['pAlias_result_error'] . "<br />($fUsername -> $fUsername)</br />";
}
// apparently uppercase usernames really confuse some IMAP clients.
$fUsername = strtolower($fUsername);
$local_part = '';
if(preg_match('/^(.*)@/', $fUsername, $matches)) {
$local_part = $matches[1];
}
$result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,local_part,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$local_part','$quota','$fDomain',NOW(),NOW(),'$sqlActive')");
if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir, $quota))
{
$tDomain = $fDomain;
$tMessage .= $PALANG['pCreate_mailbox_result_error'] . "<br />($fUsername)<br />";
db_query('ROLLBACK');
}
else
{
db_query('COMMIT');
db_log ($SESSID_USERNAME, $fDomain, 'create_mailbox', "$fUsername");
$tDomain = $fDomain;
$tQuota = $CONF['maxquota'];
if ($fMail == "on")
{
$fTo = $fUsername;
$fFrom = $SESSID_USERNAME;
$fHeaders = "To: " . $fTo . "\n";
$fHeaders .= "From: " . $fFrom . "\n";
$fHeaders .= "Subject: " . encode_header ($PALANG['pSendmail_subject_text']) . "\n";
$fHeaders .= "MIME-Version: 1.0\n";
$fHeaders .= "Content-Type: text/plain; charset=utf-8\n";
$fHeaders .= "Content-Transfer-Encoding: 8bit\n";
$fHeaders .= $CONF['welcome_text'];
if (!smtp_mail ($fTo, $fFrom, $fHeaders))
{
$tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />";
}
else
{
$tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />";
}
}
$tShowpass = "";
if ( $tPassGenerated == 1 || $CONF['show_password'] == "YES") $tShowpass = " / $fPassword";
if (create_mailbox_subfolders($fUsername,$fPassword))
{
$tMessage .= $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername$tShowpass)";
} else {
$tMessage .= $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)";
}
}
}
}
include ("templates/header.php");
include ("templates/menu.php");
include ("templates/create-mailbox.php");
include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>

@ -1,20 +1,13 @@
PostfixAdmin for Debian
=======================
After installing the package, you should find that :
http://youserver/postfixadmin/setup.php works. This should
guide you through the appropriate process.
You will need to create a database (either MySQL or PostgreSQL)
and know the username and password for it. The Database does not need
to be on the same server as the Postfixadmin install.
Recommended and Suggested Packages
==================================
- Postfix
- MySQL or PostgreSQL
- Courier or Dovecot
@ -22,25 +15,8 @@ Recommended and Suggested Packages
Where to get help
=================
The first stop would be the Postfixadmin Website, Forum or IRC channel.
See :
- http://postfixadmin.sf.net
- #postfixadmin on irc.freenode.net
How to build this package for Debian/lenny
==========================================
If you want to build this package for Debian/lenny, you have to execute
DIST="lenny" dpkg-buildpackage -rfakeroot
This will include the confd-link.sh script into the package. That script
is included in wwwconfig-common >0.2, but we have an older version in
lenny at the moment.
We (upstream and myself) want to provide also an lenny ready package,
which will be available via sf.net. Just as an easy way for interested
people which are running lenny.

@ -0,0 +1,27 @@
This package is using the quilt framework.
All patches are located in debian/patches.
Adding a new patch: quilt new <date-patch_name>
This will create a new file debian/patches/patch/date-patch_name.
Please use the current date (e.g. 20100221 - YYYYMMDD) as prefix!
Editing a file to include it into the patch: quilt edit <filename>
This will open your $EDITOR.
To write your changes into the new patchfile: quilt refresh.
quilt push:
Apply patch(es) from the series file. Without options, the next
patch in the series file is applied. When a number is specified,
apply the specified number of patches. When a patch name is
specified, apply all patches up to and including the specified patch.
Patch names may include the patches/ prefix, which means that
filename completion can be used.
quilt pop:
Remove patch(es) from the stack of applied patches. Without options,
the topmost patch is removed. When a number is specified, remove the
specified number of patches. When a patch name is specified, remove
patches until the specified patch end up on top of the stack.
Patch names may include the patches/ prefix, which means that
filename completion can be used.

21
debian/README.txt vendored

@ -0,0 +1,21 @@
Random instructions for help:
This 'debian' directory is used by dpkg-buildpackage when creating a .deb.
You'll need to install :
apt-get install dpkg-dev quilt debhelper
Then from within the trunk directory (or whatever forms the root of the
postfixadmin project), do the following :
1. Update debian/changelog; include your email address in the last change
(this is used to determine a gpg key to use)
2. debian/rules prep
3. dpkg-buildpackage -rfakeroot
4. Look in ../ at the shiny .deb / .tar.gz
5. Profit.

1
debian/TODO vendored

@ -1,4 +1,3 @@
* Do all necessary things automatically (maybe with dbconfig?) (database, setp password...)
* DebTags
* dbconfig: DOCUMENTS/SECURITY.txt
* include postfix configuration templates

@ -1,5 +0,0 @@
# BEGIN FOR POSTFIXADMIN
Alias /postfixadmin /usr/share/postfixadmin
# END FOR POSTFIXADMIN

@ -0,0 +1,5 @@
# BEGIN FOR POSTFIXADMIN
Alias /postfixadmin /usr/share/postfixadmin/public
# END FOR POSTFIXADMIN

78
debian/changelog vendored

@ -1,25 +1,77 @@
postfixadmin (2.3) unstable; urgency=low
postfixadmin (3.2-1) unstable; urgency=low
* New 'upstream' release.
* New upstream release - PostfixAdmin v3.2
-- David Goodwin <david.goodwin@palepurple.co.uk> Mon, 27 Jul 2009 22:08:26 +0100
-- David Goodwin <david@palepurple.co.uk> Wed, 02 May 2018 21:36:01 +0100
postfixadmin (2.3rc7) unstable; urgency=low
postfixadmin (3.1-1) unstable; urgency=low
* Fix issue with pre.rm script
* New 'upstream' release.
* New upstream release
-- David Goodwin <david.goodwin@palepurple.co.uk> Mon, 27 Jul 2009 22:08:26 +0100
-- David Goodwin <david@palepurple.co.uk> Sun, 25 Jun 2017 16:27:01 +0000
postfixadmin (2.3rc6) unstable; urgency=low
postfixadmin (3.0.2-1) unstable; urgency=low
* Bump version number; etc.
* Security fix (don't delete protected aliases, CVE-2017-5930)
* Fix MySQL vacation.cache column (regression fix)
-- David Goodwin <david.goodwin@palepurple.co.uk> Mon, 20 Jul 2009 19:56:26 +0100
-- David Goodwin <david@palepurple.co.uk> Wed, 08 Feb 2017 19:30:00 +0000
postfixadmin (2.3rc5) unstable; urgency=low
postfixadmin (3.0.1-2) unstable; urgency=low
* Initial release (Closes: #247225)
* Try and make dependencies less strict (and perhaps work for Ubuntu Precise as well)
-- Norman Messtorff <normes@normes.org> Sat, 09 May 2009 22:36:26 +0200
-- David Goodwin <david@palepurple.co.uk> Mon, 10 Oct 2016 20:00:00 +0100
postfixadmin (3.0.1-1) unstable; urgency=low
* Fix packaging issues (missing: smarty/ and configs/)
-- David Goodwin <david@palepurple.co.uk> Mon, 19 Sep 2016 10:08:00 +0100
postfixadmin (3.0-1) unstable; urgency=low
* New upstream release
-- David Goodwin <david@palepurple.co.uk> Sun, 11 Sep 2016 18:42:00 +0100
postfixadmin (2.93-2) unstable; urgency=low
* Replace debian/ using Debian v2.3.7-2. See Debian's #821643
* This adds : PHP7 and Apache 2.4 support.
-- David Goodwin <david@palepurple.co.uk> Sun, 22 May 2016 19:41:01 +0100
postfixadmin (2.93-1) unstable; urgency=low
* New upstream release (effectively beta3 for v3.0)
* update dependencies to allow mariadb as database
-- David Goodwin <david@palepurple.co.uk> Sat, 26 Sep 2015 15:05:00 +0100
postfixadmin (2.92-1) unstable; urgency=low
* New upstream release (effectively beta2 for v3.0)
-- David Goodwin <david@palepurple.co.uk> Wed, 28 Oct 2014 21:02:00 +0100
postfixadmin (2.91-1) unstable; urgency=low
* New upstream release (effectively beta for v3.0)
-- David Goodwin <david@palepurple.co.uk> Tue, 06 May 2014 21:36:00 +0100
postfixadmin (2.3.5-2) unstable; urgency=low
* Added .po translation files (Closes: 667951, #667962, #668202, #668288)
* Closes: #668298, #668301, #668405, #668635
* Updated standards version to 3.9.3 without changes.
-- Norman Messtorff <normes@normes.org> Thu, 26 Apr 2012 20:55:57 +0200
postfixadmin (2.3.5-1) unstable; urgency=low
* Initial Debian release (Closes: #247225)
-- Norman Messtorff <normes@normes.org> Sun, 15 Jan 2012 12:27:28 +0100

@ -1,86 +0,0 @@
#!/bin/sh
# File: confd-link.sh
# Changes:
# 20081109 Norman Messtorff <normes@normes.org>
# Initial version.
#
# Needs: $servers - the servers to link configurations in.
# $linkname - specify the link name
# $linkdestination_apache - specify the link destination (Apache config)
# $linkdestination_lighttpd - specify the link destination (lighttpd config)
# Description: Linking configurations into Webservers conf.d
# Sets: $status = {error, nothing, linked, removed}
# $error = error message (if $status = error)
status="nothing"
error=""
#
# Checking needed settings...
#
if [ -z "$servers" ]; then
status="error"
error="No servers specified in confd-link.sh"
elif [ -z "$linkname" ]; then
status="error"
error="No linkname specified in confd-link.sh"
else
#
# The link removal part...
#
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
for A in $servers ; do
A=${A%,}
#
# lighttpd has no conf.d
#
if [ "$A" = "lighttpd" ]; then
linkpath="/etc/lighttpd/conf-available"
else
linkpath="/etc/$A/conf.d"
fi
#
# Is it existing and a symbolic link or are we going to do some unwished things?
#
if [ -L $linkpath/$linkname ]; then
if rm -f $linkpath/$linkname 2>&1 ; then
status="removed"
else
status="error"
error="ERROR! Couln't remove $linkpath/$linkname "
fi
else
status="error"
error="ERROR! $linkpath/$linkname is no symbolic link or doesn't exists."
fi
done
else
for A in $servers ; do
A=${A%,}
#
# lighttpd has no conf.d
#
if [ "$A" = "lighttpd" ]; then
linkpath="/etc/lighttpd/conf-available"
linkdestination=$linkdestination_lighttpd
else
linkpath="/etc/$A/conf.d"
linkdestination=$linkdestination_apache
fi
if [ -d $linkpath ]; then
if ln -s $linkdestination $linkpath/$linkname >/dev/null 2>&1 ; then
status="linked"
else
status="error"
error="ERROR! 'ln -s' returned an error. Could not create link in $linkpath"
fi
else
status="error"
error="ERROR! $linkpath doesn't exists. Could not create link in $linkpath"
fi
done
fi
fi

28
debian/control vendored

@ -2,24 +2,26 @@ Source: postfixadmin
Section: admin
Priority: optional
Maintainer: Norman Messtorff <normes@normes.org>
Build-Depends: debhelper (>= 7), po-debconf, quilt (>= 0.46)
Standards-Version: 3.8.2
Uploaders: Gaudenz Steinlin <gaudenz@debian.org>, Christoph Martin <martin@uni-mainz.de>
Build-Depends: debhelper (>= 7), po-debconf, dh-apache2
Standards-Version: 3.9.5
Vcs-Git: git://anonscm.debian.org/collab-maint/postfixadmin.git
Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/postfixadmin.git
Homepage: http://postfixadmin.sourceforge.net
XS-Vcs-Svn: https://postfixadmin.svn.sourceforge.net/svnroot/postfixadmin/trunk
XS-Vcs-Browse: http://postfixadmin.svn.sourceforge.net/viewvc/postfixadmin/trunk/
Package: postfixadmin
Architecture: all
Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd, libapache2-mod-php5 | php5-cgi | php5, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends}
Recommends: postfix-mysql | postfix-pgsql, mysql-server | postgresql-server
Suggests: squirrelmail-postfixadmin, dovecot-common | courier-authlib-mysql | courier-authlib-postgresql
Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd | httpd, libapache2-mod-php | php-cgi | php-fpm | php, php-mysql | php-mysqlnd | php-pgsql | php-pgsql | php-sqlite3, php-mbstring, default-mysql-client | mysql-client | postgresql-client | mariadb-client
Recommends: postfix-mysql | postfix-pgsql, virtual-mysql-server | postgresql | sqlite (>= 3.12.0) | mariadb-server, zendframework, php-imap, dovecot-core | courier-authlib-mysql | courier-authlib-postgresql, php-cli
Description: Virtual mail hosting interface for Postfix
Postfixadmin is a web interface to managing virtual users and domains
for a Postfix mail transport agent. The web interface is written in PHP.
It supports Virtual mailboxes, aliases, forwarders and vacation.
Postfixadmin is a web interface to manage virtual users and domains
for a Postfix mail transport agent. It supports Virtual mailboxes,
aliases, forwarders and vacation.
.
Allows administrators to delegate the handling of domains to the
domain administrators. Allows users to login and change their own
Postfixadmin allows administrators to delegate account handling
to domain administrators and allows users to login and change their own
settings (e.g. forwarders, vacation, passwords etc).
.
Provides easy integration into dovecot, courier or cyrus.
It provides easy integration into dovecot, courier or cyrus.
.
Postfixadmin is written in PHP.

@ -1,4 +0,0 @@
# Alias for Postfixadmin
alias.url += (
"/postfixadmin" => "/usr/share/postfixadmin",
)

@ -0,0 +1,4 @@
# Alias for Postfixadmin
alias.url += (
"/postfixadmin" => "/usr/share/postfixadmin/public",
)

@ -1,30 +0,0 @@
Index: config.inc.php
===================================================================
--- config.inc.php (revision 690)
+++ config.inc.php (working copy)
@@ -23,7 +23,7 @@
* Doing this implies you have changed this file as required.
* i.e. configuring database etc; specifying setup.php password etc.
*/
-$CONF['configured'] = false;
+$CONF['configured'] = true;
// In order to setup Postfixadmin, you MUST specify a hashed password here.
// To create the hash, visit setup.php in a browser and type a password into the field,
@@ -46,11 +46,11 @@
// mysql = MySQL 3.23 and 4.0, 4.1 or 5
// mysqli = MySQL 4.1+
// pgsql = PostgreSQL
-$CONF['database_type'] = 'mysql';
-$CONF['database_host'] = 'localhost';
-$CONF['database_user'] = 'postfix';
-$CONF['database_password'] = 'postfixadmin';
-$CONF['database_name'] = 'postfix';
+$CONF['database_type'] = '_DBC_DBTYPE_';
+$CONF['database_host'] = '_DBC_DBSERVER_';
+$CONF['database_user'] = '_DBC_DBUSER_';
+$CONF['database_password'] = '_DBC_DBPASS_';
+$CONF['database_name'] = '_DBC_DBNAME_';
$CONF['database_prefix'] = '';
// Here, if you need, you can customize table names.

@ -0,0 +1,45 @@
--- a/config.inc.php
+++ b/config.inc.php
@@ -31,6 +31,16 @@
################################################################################
+// Debian: This loads the automatic generated DB credentials from /etc/postfixadmin/dbconfig.inc.php
+$db_config = dirname(__FILE__) . '/dbconfig.inc.php';
+if (file_exists($db_config) && !is_readable($db_config)) {
+ die("Could not read: $db_config\n");
+}
+require_once($db_config);
+
+if (!isset($dbserver) || empty($dbserver)) {
+ $dbserver = 'localhost';
+}
/*****************************************************************
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -39,7 +49,7 @@
* Doing this implies you have changed this file as required.
* i.e. configuring database etc; specifying setup.php password etc.
*/
-$CONF['configured'] = false;
+$CONF['configured'] = true;
// In order to setup Postfixadmin, you MUST specify a hashed password here.
// To create the hash, visit setup.php in a browser and type a password into the field,
@@ -98,11 +108,11 @@ function language_hook($PALANG, $language) {
// mysqli = MySQL 4.1+ or MariaDB
// pgsql = PostgreSQL
// sqlite = SQLite 3
-$CONF['database_type'] = 'mysqli';
-$CONF['database_host'] = 'localhost';
-$CONF['database_user'] = 'postfix';
-$CONF['database_password'] = 'postfixadmin';
-$CONF['database_name'] = 'postfix';
+$CONF['database_type'] = $dbtype;
+$CONF['database_host'] = $dbserver;
+$CONF['database_user'] = $dbuser;
+$CONF['database_password'] = $dbpass;
+$CONF['database_name'] = $dbname;
// Database SSL Config
$CONF['database_use_ssl'] = false;

@ -1 +1 @@
01-20090509_database-credentials -p0
config-debian.diff

@ -1 +0,0 @@
[type: gettext/rfc822deb] templates

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save