Distinguish local and external alias destinations on 4.x (#1168)

Port the final merged behavior of #1150 to `postfixadmin_4.0`, completing the wording-only port in #1152 (discussion #886).

Alias destinations with no matching local record within the administrator's managed domains are marked red; destinations outside those domains are marked blue without inspecting another administrator's
records. Mixed destinations can show both indicators. 

thanks @TrapoSAMA
This commit is contained in:
Rodrigo Cortés Cano authored and GitHub committed 2026-10-03 14:58:25 +01:00
1 parent 0985ce9d90
commit 6c7146d2ea
42 files changed
+247 -85

No files matched your search

+1
View File
@@ -8,6 +8,7 @@
Version 4.0.6 (2026/XX/XX)
--------------------------
- Distinguish undeliverable local alias destinations from external destinations within authorized domains (follow-up to #1152, port of #1150).
- Show the configured TOTP status and Reset TOTP action without reserving space for the hidden form.
- Clarify the alias destination status legend (see discussion #886, thanks @TrapoSAMA)
- Restore the legacy md5crypt password scheme compatibility (see #1123, thanks @8ctopus)
+4 -3
View File
@@ -597,11 +597,12 @@ $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']='  ';
// 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.
// Highlight undeliverable destinations in locally managed domains.
// This checks PostfixAdmin records, not actual mail delivery.
$CONF['show_undeliverable']='YES';
$CONF['show_undeliverable_color']='tomato';
// Destinations outside the administrator's managed domains (no existence check).
$CONF['show_external_color']='lightblue';
// mails to these domains will never be flagged as undeliverable
$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext");
// show mailboxes with expired password; requires password_expiration to be enabled
+41 -45
View File
@@ -2208,9 +2208,10 @@ function check_db_version($error_out = true)
* addresses list in show_custom_domains
*
* @param string $show_alias
* @param array $allowed_domains Domains authorized for the caller. Domains not listed here are marked as external.
* @return string
*/
function gen_show_status($show_alias)
function gen_show_status($show_alias, array $allowed_domains)
{
global $CONF;
$table_alias = table_by_key('alias');
@@ -2230,60 +2231,55 @@ function gen_show_status($show_alias)
$delimiter_regex = '/' . $delimiter . '[^' . $delimiter . '@]*@/';
}
// UNDELIVERABLE CHECK
// Only inspect destination records within the caller's authorized domains.
if ($CONF['show_undeliverable'] == 'YES') {
$gotos = array();
$gotos = explode(',', $stat_goto);
$undel_string = "";
$external_destination_tooltip = htmlspecialchars(
Config::lang('pStatus_undeliverable_tooltip'),
ENT_QUOTES,
'UTF-8'
);
//make sure this alias goes somewhere known
$stat_ok = 1;
foreach ($gotos as $g) {
if (!$stat_ok) {
break;
$destination_status = ['undeliverable' => false, 'external' => false];
foreach (explode(',', $stat_goto) as $destination) {
$destination = trim($destination);
if (strpos($destination, '@') === false) {
continue;
}
if (strpos($g, '@') === false) {
[$local_part, $domain] = explode('@', $destination, 2);
if ($domain == $CONF['vacation_domain'] || in_array($domain, $CONF['show_undeliverable_exceptions'])) {
continue;
}
if (!in_array($domain, $allowed_domains, true)) {
$destination_status['external'] = true;
continue;
}
list($local_part, $stat_domain) = explode('@', $g);
$v = array();
$stat_delimiter = "";
$alias_domain = db_query_one(
'SELECT target_domain FROM ' . table_by_key('alias_domain') . ' WHERE alias_domain = ? AND active = ?',
[$domain, db_get_boolean(true)]
);
if ($alias_domain) {
$domain = $alias_domain['target_domain'];
if (!in_array($domain, $allowed_domains, true)) {
$destination_status['external'] = true;
continue;
}
$destination = $local_part . '@' . $domain;
}
$sql = "SELECT address FROM $table_alias WHERE address = ? OR address = ?";
$v[] = $g;
$v[] = '@' . $stat_domain;
if (!empty($CONF['recipient_delimiter']) && isset($delimiter_regex)) {
$v[] = preg_replace($delimiter_regex, "@", $g);
$sql .= " OR address = ? ";
$values = [$destination, '@' . $domain];
if ($delimiter_regex !== null) {
$sql .= ' OR address = ?';
$values[] = preg_replace($delimiter_regex, '@', $destination);
}
$stat_result = db_query_one($sql, $v);
if (empty($stat_result)) {
$stat_ok = 0;
if (!db_query_one($sql, $values)) {
$destination_status['undeliverable'] = true;
}
if ($stat_ok == 0) {
if ($stat_domain == $CONF['vacation_domain'] || in_array($stat_domain, $CONF['show_undeliverable_exceptions'])) {
$stat_ok = 1;
}
}
foreach ($destination_status as $status => $present) {
if ($present) {
$tooltip = htmlspecialchars(Config::lang('pStatus_' . $status . '_tooltip'), ENT_QUOTES, 'UTF-8');
$color = htmlspecialchars($CONF['show_' . $status . '_color'], ENT_QUOTES, 'UTF-8');
$stat_string .= "<span role='img' aria-label='$tooltip' title='$tooltip' style='background-color:$color'>" .
$CONF['show_status_text'] . '</span>&nbsp;';
} else {
$stat_string .= $CONF['show_status_text'] . '&nbsp;';
}
} // while
if ($stat_ok == 0) {
$stat_string .= "<span role='img' aria-label='$external_destination_tooltip'" .
" title='$external_destination_tooltip' style='background-color:" .
$CONF['show_undeliverable_color'] . "'>" . $CONF['show_status_text'] . "</span>&nbsp;";
} else {
$stat_string .= $CONF['show_status_text'] . "&nbsp;";
}
}
+3 -1
View File
@@ -377,8 +377,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Съобщение до всички'
$PALANG['pBroadcast_error_empty'] = 'Полетата Име, Заглавие и Съобщение са задължителни!';
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -376,8 +376,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -376,8 +376,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -390,8 +390,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Poslat email všem';
$PALANG['pBroadcast_error_empty'] = 'Pole Od, Předmět a Zpráva by neměly být prázdné!';
$PALANG['broadcast_mailboxes_only'] = 'Pouze poslat do schránek';
$PALANG['broadcast_to_domains'] = 'Poslat na domény:';
$PALANG['pStatus_undeliverable'] = 'možná NEDORUČITELNÉ ';
$PALANG['pStatus_undeliverable'] = 'možná NEDORUČITELNÉ '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Účet pozastaven ';
$PALANG['pStatus_expired'] = 'Heslo expirováno ';
$PALANG['pStatus_vacation'] = 'Aktivní mód dovolené ';
+3 -1
View File
@@ -388,8 +388,10 @@ $PALANG['pBroadcast_error_empty'] = 'Felterne "Dit navn", "Emne" og "Medde
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'kan måske ikke leveres ';
$PALANG['pStatus_undeliverable'] = 'kan måske ikke leveres '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -386,8 +386,10 @@ $PALANG['pBroadcast_error_empty'] = 'Die Felder Name, Betreff und Nachricht dür
$PALANG['broadcast_mailboxes_only'] = "Nur an Postfächer senden";
$PALANG['broadcast_to_domains'] = "Senden an Domains:";
$PALANG['pStatus_undeliverable'] = 'möglicherweise UNZUSTELLBAR ';
$PALANG['pStatus_undeliverable'] = 'möglicherweise UNZUSTELLBAR '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Konto deaktiviert ';
$PALANG['pStatus_expired'] = 'Passwort abgelaufen ';
$PALANG['pStatus_vacation'] = 'Automatische Antwort aktiviert ';
+3 -1
View File
@@ -455,8 +455,10 @@ $PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message should
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes';
$PALANG['broadcast_to_domains'] = 'Send to domains:';
$PALANG['pStatus_undeliverable'] = 'Possible external destination';
$PALANG['pStatus_undeliverable'] = 'Undeliverable local destination';
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.';
$PALANG['pStatus_external'] = 'External destination';
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.';
$PALANG['pStatus_disabled'] = 'Account disabled ';
$PALANG['pStatus_expired'] = 'Password expired ';
$PALANG['pStatus_vacation'] = 'Vacation enabled ';
+3 -1
View File
@@ -378,8 +378,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Mensajería GLOBAL';
$PALANG['pBroadcast_error_empty'] = '¡Los campos Nombre, Asunto y Mensaje no pueden estar vacíos!';
$PALANG['broadcast_mailboxes_only'] = 'Envíar solo a los buzones';
$PALANG['broadcast_to_domains'] = 'Envíar a los dominios:';
$PALANG['pStatus_undeliverable'] = 'Posible destino externo';
$PALANG['pStatus_undeliverable'] = 'Destino local no entregable';
$PALANG['pStatus_undeliverable_tooltip'] = 'No figura como destino local.';
$PALANG['pStatus_external'] = 'Destino externo';
$PALANG['pStatus_external_tooltip'] = 'Fuera de tus dominios administrados.';
$PALANG['pStatus_disabled'] = 'Cuenta desactivada ';
$PALANG['pStatus_expired'] = 'Contraseña vencida ';
$PALANG['pStatus_vacation'] = 'Mensaje de vacaciones activado ';
+3 -1
View File
@@ -380,8 +380,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -375,8 +375,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -376,8 +376,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Tiedotusviesti';
$PALANG['pBroadcast_error_empty'] = 'Nimi, Aihe tai Viesti kenttien ei pidä olla tyhjiä!';
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'ehkä ei voida toimittaa ';
$PALANG['pStatus_undeliverable'] = 'ehkä ei voida toimittaa '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -381,8 +381,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -381,8 +381,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Message général';
$PALANG['pBroadcast_error_empty'] = 'Les champs "Nom", "Sujet" et "Message" ne peuvent pas être vides !';
$PALANG['broadcast_mailboxes_only'] = 'Envoyer seulement aux comptes courriel';
$PALANG['broadcast_to_domains'] = 'Envoyer aux domaines:';
$PALANG['pStatus_undeliverable'] = 'Non délivrable ';
$PALANG['pStatus_undeliverable'] = 'Non délivrable '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Compte désactivé ';
$PALANG['pStatus_expired'] = 'Mot de passe expiré ';
$PALANG['pStatus_vacation'] = 'Répondeur activé ';
+3 -1
View File
@@ -376,8 +376,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Mensaxe de Broadcast'; # XXX
$PALANG['pBroadcast_error_empty'] = 'Os campos Nome, Asunto e Mensaxe non poden estar baleiros!';
$PALANG['broadcast_mailboxes_only'] = 'Só enviar a buzóns'; # XXX
$PALANG['broadcast_to_domains'] = 'Enviar a dominios:'; # XXX
$PALANG['pStatus_undeliverable'] = 'posiblemente NON SE ENTREGOU';
$PALANG['pStatus_undeliverable'] = 'posiblemente NON SE ENTREGOU'; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Conta desabilitada '; # XXX
$PALANG['pStatus_expired'] = 'Contrasinal vencido '; # XXX
$PALANG['pStatus_vacation'] = 'Ausencia activada '; # XXX
+3 -1
View File
@@ -374,8 +374,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -387,8 +387,10 @@ $PALANG['pBroadcast_error_empty'] = 'A név, téma és üzenet mezők nem lehetn
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'lehet hogy nem kézbesíthető ';
$PALANG['pStatus_undeliverable'] = 'lehet hogy nem kézbesíthető '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -376,8 +376,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -377,8 +377,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Invio di gruppo';
$PALANG['pBroadcast_error_empty'] = 'Nome, oggetto e testo del messaggio non possono restare vuoti!';
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'presumibilmente NON CONSEGNABILE ';
$PALANG['pStatus_undeliverable'] = 'presumibilmente NON CONSEGNABILE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -385,8 +385,10 @@ $PALANG['pBroadcast_error_empty'] = '名前、件名、メッセージは入力
$PALANG['broadcast_mailboxes_only'] = 'メールアドレスだけに送信';
$PALANG['broadcast_to_domains'] = '送信先のドメイン:';
$PALANG['pStatus_undeliverable'] = 'おそらく配送不可能 ';
$PALANG['pStatus_undeliverable'] = 'おそらく配送不可能 '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -382,8 +382,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -377,8 +377,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -376,8 +376,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Send masseutsendelse';
$PALANG['pBroadcast_error_empty'] = 'Feltene Ditt navn, Emne og Melding kan ikke være tomme!';
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'kan kanskje IKKE LEVERES ';
$PALANG['pStatus_undeliverable'] = 'kan kanskje IKKE LEVERES '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -379,8 +379,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Algemeen bericht';
$PALANG['pBroadcast_error_empty'] = 'De velden Naam, Onderwerp en Bericht mogen niet leeg zijn !';
$PALANG['broadcast_mailboxes_only'] = 'Verstuur alleen aan mailboxen';
$PALANG['broadcast_to_domains'] = 'Verstuur aan de domeinen:';
$PALANG['pStatus_undeliverable'] = 'Misschien niet af te leveren ';
$PALANG['pStatus_undeliverable'] = 'Misschien niet af te leveren '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account uitgeschakeld ';
$PALANG['pStatus_expired'] = 'Wachwoord is verlopen ';
$PALANG['pStatus_vacation'] = 'Vakatie toegestaan ';
+3 -1
View File
@@ -375,8 +375,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -382,8 +382,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Wiadomość do wszystkich';
$PALANG['pBroadcast_error_empty'] = 'Pola Nazwa, Temat i Wiadomość nie powinny być puste !';
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'może być NIEDOSTARCZALNA ';
$PALANG['pStatus_undeliverable'] = 'może być NIEDOSTARCZALNA '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -387,8 +387,10 @@ $PALANG['pBroadcast_error_empty'] = 'Os campos Nome, Assunto e Mensagem devem se
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'talvez NÃO-ENTREGÁVEL ';
$PALANG['pStatus_undeliverable'] = 'talvez NÃO-ENTREGÁVEL '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -387,8 +387,10 @@ $PALANG['pBroadcast_error_empty'] = 'Os campos Nome, Assunto e Mensagem devem se
$PALANG['broadcast_mailboxes_only'] = 'Apenas envia para mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Enviar para os domínios:'; # XXX
$PALANG['pStatus_undeliverable'] = 'talvez NÃO-ENTREGÁVEL ';
$PALANG['pStatus_undeliverable'] = 'talvez NÃO-ENTREGÁVEL '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Conta desctivada '; # XXX
$PALANG['pStatus_expired'] = 'Password expirada '; # XXX
$PALANG['pStatus_vacation'] = 'Férias activadas '; # XXX
+3 -1
View File
@@ -385,8 +385,10 @@ $PALANG['pBroadcast_error_empty'] = 'Campurile Nume, Subiect si Mesaj nu pot fi
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'probabil UNDELIVERABLE ';
$PALANG['pStatus_undeliverable'] = 'probabil UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -388,8 +388,10 @@ $PALANG['pBroadcast_error_empty'] = 'Поля Имя, Тема и Сообщен
$PALANG['broadcast_mailboxes_only'] = 'Отправить только на почтовые ящики';
$PALANG['broadcast_to_domains'] = 'Отправить на домены:';
$PALANG['pStatus_undeliverable'] = 'возможно НЕ ДОСТАВЛЕНО ';
$PALANG['pStatus_undeliverable'] = 'возможно НЕ ДОСТАВЛЕНО '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Учетная запись отключена ';
$PALANG['pStatus_expired'] = 'Срок действия пароля истек ';
$PALANG['pStatus_vacation'] = 'Автоответчик включен ';
+3 -1
View File
@@ -377,8 +377,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Hromadná správa';
$PALANG['pBroadcast_error_empty'] = 'Polia Vaše meno, Predmet a Obsah nemôžu byť prázdne!';
$PALANG['broadcast_mailboxes_only'] = 'Posielať len do schránok';
$PALANG['broadcast_to_domains'] = 'Posielať na domény:';
$PALANG['pStatus_undeliverable'] = 'možno NEDORUČITEĽNÉ ';
$PALANG['pStatus_undeliverable'] = 'možno NEDORUČITEĽNÉ '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -376,8 +376,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -386,8 +386,10 @@ $PALANG['pBroadcast_error_empty'] = 'Fälten namn, ämne och meddelande ska inte
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = 'kan eventuellt ej levereras ';
$PALANG['pStatus_undeliverable'] = 'kan eventuellt ej levereras '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -376,8 +376,10 @@ $PALANG['pAdminMenu_broadcast_message'] = 'Sistem mesajı';
$PALANG['pBroadcast_error_empty'] = 'İsim, Konu ve Mesaj gibi alanlar boş bırakılmamalı!';
$PALANG['broadcast_mailboxes_only'] = 'Sadece belirtilen e-posta hesaplarına gönder';
$PALANG['broadcast_to_domains'] = 'Domainlere gönder:';
$PALANG['pStatus_undeliverable'] = 'GÖNDERİLEMEMİŞ veya gönderilemeyen olabilir ';
$PALANG['pStatus_undeliverable'] = 'GÖNDERİLEMEMİŞ veya gönderilemeyen olabilir '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Hesap pasif ';
$PALANG['pStatus_expired'] = 'Şifrenin süresi doldu ';
$PALANG['pStatus_vacation'] = 'Tatil modu aktif ';
+3 -1
View File
@@ -378,8 +378,10 @@ $PALANG['pAdminMenu_broadcast_message'] = '發送給所有用戶';
$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message shouldn\'t be empty!'; # XXX
$PALANG['broadcast_mailboxes_only'] = 'Only send to mailboxes'; # XXX
$PALANG['broadcast_to_domains'] = 'Send to domains:'; # XXX
$PALANG['pStatus_undeliverable'] = '可能無法送遞 ';
$PALANG['pStatus_undeliverable'] = '可能無法送遞 '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Account disabled '; # XXX
$PALANG['pStatus_expired'] = 'Password expired '; # XXX
$PALANG['pStatus_vacation'] = 'Vacation enabled '; # XXX
+3 -1
View File
@@ -387,8 +387,10 @@ $PALANG['pBroadcast_error_empty'] = 'Поля Ім&#0039;я, Тема і Пов
$PALANG['broadcast_mailboxes_only'] = 'Відправити тільки на поштові скриньки';
$PALANG['broadcast_to_domains'] = 'Надіслати на домени:';
$PALANG['pStatus_undeliverable'] = 'може бути НЕМОЖЛИВО ДОСТАВИТИ ';
$PALANG['pStatus_undeliverable'] = 'може бути НЕМОЖЛИВО ДОСТАВИТИ '; # XXX English text changed: Undeliverable local destination. Please retranslate.
$PALANG['pStatus_undeliverable_tooltip'] = 'Not listed as a local destination.'; # XXX
$PALANG['pStatus_external'] = 'External destination'; # XXX
$PALANG['pStatus_external_tooltip'] = 'Outside your managed domains.'; # XXX
$PALANG['pStatus_disabled'] = 'Обліковий запис відключений ';
$PALANG['pStatus_expired'] = 'Термін дії пароля минув ';
$PALANG['pStatus_vacation'] = 'Автовідповідач увімкнено ';
+1 -1
View File
@@ -346,7 +346,7 @@ class AliasHandler extends PFAHandler
}
if ($this->struct['status']['display_in_list'] && Config::bool('show_status')) {
$db_result[$key]['status'] = gen_show_status($db_result[$key]['address']);
$db_result[$key]['status'] = gen_show_status($db_result[$key]['address'], $this->allowed_domains);
}
}
+1 -1
View File
@@ -349,7 +349,7 @@ $gen_show_status_mailbox = array();
$divide_quota = array('current' => [], 'quota' => [], 'percent' => [], 'quota_width' => []);
for ($i = 0; $i < sizeof($tMailbox); $i++) {
$gen_show_status_mailbox[$i] = gen_show_status($tMailbox[$i]['username']);
$gen_show_status_mailbox[$i] = gen_show_status($tMailbox[$i]['username'], $list_domains);
$divide_quota['current'][$i] = Config::Lang('unknown');
$divide_quota['quota_width'][$i] = 0;
+5
View File
@@ -114,6 +114,11 @@
<span style='background-color:{$CONF.show_undeliverable_color};'>{$CONF.show_status_text}</span>
={$PALANG.pStatus_undeliverable}
</span>
&nbsp;
<span title="{$PALANG.pStatus_external_tooltip|escape:"html"}">
<span style='background-color:{$CONF.show_external_color};'>{$CONF.show_status_text}</span>
={$PALANG.pStatus_external}
</span>
{/if}
{if $CONF.show_popimap===YES}
&nbsp;
+89
View File
@@ -0,0 +1,89 @@
<?php
class AliasDestinationStatusTest extends \PHPUnit\Framework\TestCase
{
private array $savedConfig;
protected function setUp(): void
{
global $CONF;
$this->savedConfig = $CONF;
$CONF['show_undeliverable'] = 'YES';
$CONF['show_undeliverable_color'] = 'tomato';
$CONF['show_external_color'] = 'lightblue';
$CONF['show_undeliverable_exceptions'] = ['exception.test'];
$CONF['vacation_domain'] = 'vacation.test';
$CONF['recipient_delimiter'] = '+';
$CONF['show_popimap'] = 'NO';
$CONF['show_vacation'] = 'NO';
$CONF['show_disabled'] = 'NO';
$CONF['password_expiration'] = 'NO';
$CONF['show_custom_domains'] = [];
foreach (['local.test', 'alias.test', 'private.test'] as $domain) {
db_insert('domain', ['domain' => $domain, 'description' => 'status test', 'transport' => '']);
}
}
protected function tearDown(): void
{
global $CONF;
$CONF = $this->savedConfig;
db_execute('DELETE FROM ' . table_by_key('alias'));
db_execute('DELETE FROM ' . table_by_key('alias_domain'));
db_execute('DELETE FROM ' . table_by_key('domain'));
}
private function alias(string $address, string $goto): void
{
db_execute('INSERT INTO ' . table_by_key('alias') . ' (address, goto, domain) VALUES (?, ?, ?)', [$address, $goto, explode('@', $address)[1]]);
}
private function renderStatus(string $goto, array $domains = ['local.test', 'alias.test']): string
{
db_execute('DELETE FROM ' . table_by_key('alias') . ' WHERE address = ?', ['source@local.test']);
$this->alias('source@local.test', $goto);
return gen_show_status('source@local.test', $domains);
}
public function testMissingLocalAndExternalDestinationsAreIndependent(): void
{
$local = $this->renderStatus('missing@local.test');
self::assertStringContainsString('background-color:tomato', $local);
self::assertStringNotContainsString('background-color:lightblue', $local);
$mixed = $this->renderStatus('missing@local.test, person@outside.test');
self::assertStringContainsString('background-color:tomato', $mixed);
self::assertStringContainsString('background-color:lightblue', $mixed);
}
public function testOtherAdministratorsRecordsDoNotAffectOutput(): void
{
$before = $this->renderStatus('person@private.test');
$this->alias('person@private.test', 'person@private.test');
self::assertSame($before, $this->renderStatus('person@private.test'));
self::assertStringContainsString('background-color:lightblue', $before);
self::assertStringNotContainsString('background-color:tomato', $before);
self::assertStringContainsString('background-color:lightblue', $this->renderStatus('missing@local.test', []));
}
public function testKnownRecipientsCatchallsAndExceptions(): void
{
$this->alias('person@local.test', 'person@local.test');
self::assertStringNotContainsString('background-color:', $this->renderStatus('person+tag@local.test'));
$this->alias('@local.test', 'person@local.test');
self::assertStringNotContainsString('background-color:', $this->renderStatus('anything@local.test'));
self::assertStringNotContainsString('background-color:', $this->renderStatus('person@exception.test,person@vacation.test'));
}
public function testAliasDomainsRespectTargetPermissions(): void
{
db_execute('INSERT INTO ' . table_by_key('alias_domain') . ' (alias_domain, target_domain, active) VALUES (?, ?, ?)', ['alias.test', 'local.test', db_get_boolean(true)]);
$this->alias('person@local.test', 'person@local.test');
self::assertStringNotContainsString('background-color:', $this->renderStatus('person@alias.test'));
self::assertStringContainsString('background-color:tomato', $this->renderStatus('missing@alias.test'));
$hidden = $this->renderStatus('person@alias.test', ['alias.test']);
db_execute('DELETE FROM ' . table_by_key('alias') . ' WHERE address = ?', ['person@local.test']);
self::assertSame($hidden, $this->renderStatus('person@alias.test', ['alias.test']));
self::assertStringContainsString('background-color:lightblue', $hidden);
}
}