diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 930cc369..b2193354 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -21,6 +21,7 @@ SVN changes since 3.0 beta1 (2.91) - fix logging (run setup.php to fix old log entries) (bug#317) - fetchmail.php: change error_reporting() to exclude E_NOTICE (bug#322) - fr.lang translation update (patch#123) +- $CONF[default_aliases] can now use the new domain as alias target (patch#124) Version 3.0 beta1 (2.91) - 2014/05/06 - SVN r1670 ------------------------------------------------- diff --git a/VIRTUAL_VACATION/INSTALL.TXT b/VIRTUAL_VACATION/INSTALL.TXT index e8ab73d0..c7046a9e 100644 --- a/VIRTUAL_VACATION/INSTALL.TXT +++ b/VIRTUAL_VACATION/INSTALL.TXT @@ -1,6 +1,6 @@ -################################################## -# Virtual Vacation for Postfix Admin Release 2.x # -################################################## +###################################### +# Virtual Vacation for Postfix Admin # +###################################### # # Postfix Admin (Virtual Vacation) # Originally authored by Mischa Peters @@ -38,6 +38,7 @@ Install Virtual Vacation 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,6 +47,8 @@ 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: #/etc/passwd @@ -55,24 +58,30 @@ vacation:*:65501:65501:Virtual Vacation:/nonexistent:/sbin/nologin vacation:*:65501: -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. +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. -3. Copy the files ------------------ +Note: If you are logging to syslog, you can skip this step. -Copy the vacation.pl file to the directory you created above: - $ cp vacation.pl /vacation.pl - $ chown -R vacation:vacation +3. Install vacation.pl +---------------------- + +Create a directory /usr/lib/postfixadmin/ and copy the vacation.pl file to it: + + $ 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* +-rwxr-x--- 1 root vacation 3356 Dec 21 00:00 vacation.pl* 4. Setup the transport type @@ -81,7 +90,7 @@ Define the transport type in the Postfix master file: #/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 -------------------------------- @@ -124,14 +133,20 @@ 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'; + To make sure nobody except vacation.pl can read your vacation.conf (including the + database password), run + + $ chown root:vacation /etc/postfixadmin/vacation.conf + $ chmod 640 /etc/postfixadmin/vacation.conf + 7. Check the alias expansion ---------------------------- @@ -141,7 +156,7 @@ your postfix master.cf file. This is especially the case if you are also using A 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: -o receive_override_options=no_address_mappings @@ -186,9 +201,10 @@ joeuser#something.com@autoreply.yourdomain.com 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. +to your database. You have to specify the database, username and password for +it as described in the "Configure vacation.pl" section. + +NOTE: Make sure that the path to perl in vacation.pl is correct. I'm in trouble! diff --git a/broadcast-message.php b/broadcast-message.php index 0b60ddd4..0487658a 100644 --- a/broadcast-message.php +++ b/broadcast-message.php @@ -73,11 +73,11 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") if (!smtp_mail ($fTo, $smtp_from_email, $fHeaders)) { - flash_error("
" . $PALANG['pSendmail_result_error'] . "
"); + flash_error($PALANG['pSendmail_result_error']); } else { - flash_info("
" . $PALANG['pSendmail_result_success'] . "
"); + flash_info($PALANG['pSendmail_result_success']); } } } diff --git a/config.inc.php b/config.inc.php index 294fefdd..7dd1b132 100644 --- a/config.inc.php +++ b/config.inc.php @@ -180,6 +180,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', @@ -314,6 +317,7 @@ $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 diff --git a/languages/bg.lang b/languages/bg.lang index 3c61feb7..9ae2037c 100644 --- a/languages/bg.lang +++ b/languages/bg.lang @@ -193,6 +193,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; $PALANG['pViewlog_action_edit_password'] = 'change password'; # XXX $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = 'Не мога да открия логовете!'; @@ -241,6 +242,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; # XXX +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Редактиране на домейн'; $PALANG['pAdminEdit_domain_aliases_text'] = '0 = изключени | -1 = неограничени'; diff --git a/languages/ca.lang b/languages/ca.lang index 0c5ae994..e64d479d 100644 --- a/languages/ca.lang +++ b/languages/ca.lang @@ -191,6 +191,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; $PALANG['pViewlog_action_edit_password'] = 'change password'; # XXX $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = 'Imposible trobar els logs!'; @@ -239,6 +240,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; # XXX +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Editar un domini'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = ilimitat | 0 = deshabilitar'; diff --git a/languages/cn.lang b/languages/cn.lang index 12f8024a..327b5212 100644 --- a/languages/cn.lang +++ b/languages/cn.lang @@ -192,6 +192,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; $PALANG['pViewlog_action_edit_password'] = 'change password'; # XXX $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = '未找到相关的日志!'; @@ -240,6 +241,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; # XXX +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = '修改域'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = 禁止 | 0 = 无限制'; # XXX check / compare with pAdminCreate_domain_aliases_text - should be "-1 = disable | ..." diff --git a/languages/cs.lang b/languages/cs.lang index 48b6d276..4e1d4883 100644 --- a/languages/cs.lang +++ b/languages/cs.lang @@ -200,6 +200,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; $PALANG['pViewlog_action_edit_password'] = 'změna hesla'; $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = 'Nepodařilo se najít záznamy!'; @@ -249,6 +250,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; # XXX +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Upravit doménu'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = znepřístupnit | 0 = neomezeně'; diff --git a/languages/da.lang b/languages/da.lang index c6466a15..9d8f0688 100644 --- a/languages/da.lang +++ b/languages/da.lang @@ -200,6 +200,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'ændr domæne-alias status $PALANG['pViewlog_action_edit_password'] = 'ændr adgangskode'; $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = 'Loggen kan ikke findes.'; @@ -249,6 +250,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Domæne-aliaset kunne ikke slettes!'; +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Redigér et domæne'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = annullér | 0 = uendeligt'; diff --git a/languages/de.lang b/languages/de.lang index 7574b855..5ff5bcd8 100644 --- a/languages/de.lang +++ b/languages/de.lang @@ -197,6 +197,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'Alias-Domain Aktiv bearbei $PALANG['pViewlog_action_edit_password'] = 'Passwort ändern'; $PALANG['pViewlog_action_create_admin'] = 'Admin erstellen'; $PALANG['pViewlog_action_edit_admin'] = 'Admin ändern'; +$PALANG['pViewlog_action_delete_admin'] = 'Admin löschen'; $PALANG['pViewlog_action_edit_vacation'] = 'Automatische Antwort ändern'; $PALANG['pViewlog_result_error'] = 'Kann keine Einträge finden!'; @@ -246,6 +247,7 @@ $PALANG['mailbox_postdel_failed'] = 'Fehler beim Ausführen des mailbox postdele $PALANG['mailbox_postedit_failed'] = 'Fehler beim Ausführen des mailbox postedit-Scripts, überprüfen Sie das Error-Log für Details!'; $PALANG['mailbox_postcreate_failed'] = 'Fehler beim Ausführen des mailbox postcreate-Scripts, überprüfen Sie das Error-Log für Details!'; $PALANG['pAdminDelete_alias_domain_error'] = 'Alias-Domain konnte nicht gelöscht werden!'; +$PALANG['domain_conflict_vacation_domain'] = 'Sie können die Vacation-Domain nicht als Maildomain benutzen!'; $PALANG['pAdminEdit_domain_welcome'] = 'Domain bearbeiten'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = ausschalten | 0 = kein Limit'; diff --git a/languages/en.lang b/languages/en.lang index bb6e5b9b..542817da 100644 --- a/languages/en.lang +++ b/languages/en.lang @@ -198,6 +198,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; $PALANG['pViewlog_action_edit_password'] = 'change password'; $PALANG['pViewlog_action_create_admin'] = 'create admin'; $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; $PALANG['pViewlog_result_error'] = 'Unable to find the logs!'; @@ -247,6 +248,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; $PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; $PALANG['pAdminEdit_domain_welcome'] = 'Edit a domain'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = disable | 0 = unlimited'; diff --git a/languages/es.lang b/languages/es.lang index 7a7da710..ccc01038 100644 --- a/languages/es.lang +++ b/languages/es.lang @@ -193,6 +193,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'editar alias de dominio ac $PALANG['pViewlog_action_edit_password'] = 'cambiar contraseña'; $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = '¡Imposible encontrar los logs!'; @@ -241,6 +242,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = '¡No se pudo eliminar el alias de dominio!'; +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Editar un dominio'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = deshabilitar | 0 = ilimitado'; diff --git a/languages/et.lang b/languages/et.lang index 13f9975a..5c643fd8 100644 --- a/languages/et.lang +++ b/languages/et.lang @@ -192,6 +192,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; $PALANG['pViewlog_action_edit_password'] = 'change password'; # XXX $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = 'Logi ei leitud!'; @@ -240,6 +241,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; # XXX +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Redigeeri domeeni'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = keelatud | 0 = piiramatult'; diff --git a/languages/eu.lang b/languages/eu.lang index 987e4445..9c1aee6e 100644 --- a/languages/eu.lang +++ b/languages/eu.lang @@ -190,6 +190,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; $PALANG['pViewlog_action_edit_password'] = 'change password'; # XXX $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = 'Ezinezkoa logak aurkitzea!'; @@ -238,6 +239,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; # XXX +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Domeinu bat aldatu'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = desegokitu | 0 = mugagabea'; diff --git a/languages/fi.lang b/languages/fi.lang index 4efba378..ea8def4e 100644 --- a/languages/fi.lang +++ b/languages/fi.lang @@ -192,6 +192,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'muokkaa aktiivista alias d $PALANG['pViewlog_action_edit_password'] = 'vaihda salasana'; $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = 'Lokeja ei löydy!'; @@ -240,6 +241,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Domainin aliasta ei voitu poistaa!'; +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Muokkaa domainia'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = ei käytössä | 0 = rajoittamaton'; diff --git a/languages/fo.lang b/languages/fo.lang index a6fea4a5..80c86da7 100644 --- a/languages/fo.lang +++ b/languages/fo.lang @@ -192,6 +192,7 @@ $PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; $PALANG['pViewlog_action_edit_password'] = 'change password'; # XXX $PALANG['pViewlog_action_create_admin'] = 'create admin'; # XXX $PALANG['pViewlog_action_edit_admin'] = 'edit admin'; # XXX +$PALANG['pViewlog_action_delete_admin'] = 'delete admin'; # XXX $PALANG['pViewlog_action_edit_vacation'] = 'edit vacation'; # XXX $PALANG['pViewlog_result_error'] = 'Finni ikki loggarnar!'; @@ -240,6 +241,7 @@ $PALANG['mailbox_postdel_failed'] = 'The mailbox postdeletion script failed, che $PALANG['mailbox_postedit_failed'] = 'The mailbox postedit script failed, check the error log for details!'; # XXX $PALANG['mailbox_postcreate_failed'] = 'The mailbox postcreate script failed, check the error log for details!'; # XXX $PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; # XXX +$PALANG['domain_conflict_vacation_domain'] = 'You can\'t use the vacation domain as mail domain!'; # XXX $PALANG['pAdminEdit_domain_welcome'] = 'Broyt navnaøki'; $PALANG['pAdminEdit_domain_aliases_text'] = '-1 = óvirkja | 0 = óavmarkað'; diff --git a/languages/fr.lang b/languages/fr.lang index f4386ff5..a7ba035e 100644 --- a/languages/fr.lang +++ b/languages/fr.lang @@ -1,4 +1,4 @@ -id); + protected function validate_new_id() { + $domain_check = check_domain($this->id); - if ($domain_check == '') { - return true; - } else { + if ($domain_check != '') { $this->errormsg[$this->id_field] = $domain_check; return false; - } - } + } + + if (Config::read('vacation_domain') == $this->id) { + $this->errormsg[$this->id_field] = Config::Lang('domain_conflict_vacation_domain'); + return false; + } + + # still here? good. + return true; + } - # init $this->struct, $this->db_table and $this->id_field protected function initStruct() { # TODO: shorter PALANG labels ;-) @@ -104,6 +109,10 @@ class DomainHandler extends PFAHandler { if ($this->new && $this->values['default_aliases']) { foreach (Config::read('default_aliases') as $address=>$goto) { $address = $address . "@" . $this->id; + # if $goto doesn't contain @, let the alias point to the same domain + if(!strstr($goto, '@')) { + $goto = $goto . "@" . $this->id; + } # TODO: use AliasHandler->add instead of writing directly to the alias table $arr = array( 'address' => $address, diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index d2335eae..2cce7521 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -247,12 +247,7 @@ class MailboxHandler extends PFAHandler { } if ( !$this->create_mailbox_subfolders() ) { - # TODO: implement $tShowpass - $this->infomsg[] = Config::lang_f('pCreate_mailbox_result_succes_nosubfolders', "$fUsername$tShowpass"); - } else { # everything ok - # TODO: implement $tShowpass - # $this->infomsg[] = Config::lang_f('pCreate_mailbox_result_success'], "$fUsername$tShowpass"); - # TODO: currently edit.php displays the default success message from webformConfig + $this->infomsg[] = Config::lang_f('pCreate_mailbox_result_succes_nosubfolders', $this->id); } } else { # edit mode @@ -659,7 +654,7 @@ class MailboxHandler extends PFAHandler { $i=@imap_open($s, $this->id, $this->values['password']); if (FALSE==$i) { - error_log('Could not log into IMAP/POP server: '.imap_last_error()); + error_log('Could not log into IMAP/POP server: ' . $this->id . ': ' . imap_last_error()); return FALSE; } @@ -668,7 +663,7 @@ class MailboxHandler extends PFAHandler { $f='{'.$s_host.'}'.$s_prefix.$f; $res=imap_createmailbox($i,$f); if (!$res) { - error_log('Could not create IMAP folder $f: '.imap_last_error()); + error_log('Could not create IMAP folder $f: ' . $this->id . ': ' . imap_last_error()); @imap_close($i); return FALSE; }