From c74fe67a7d6093cc4951a00b05a839d3d11b7d14 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 28 Oct 2006 04:49:40 +0000 Subject: [PATCH] SMTP queue display: * Chop off local node name from sender if it's from our node * Add a delete button for each message in the queue * Add a Refresh button for the screen (wholesome AJAX goodness) --- webcit/po/da.po | 23 ++++++----- webcit/po/de.po | 23 ++++++----- webcit/po/en_GB.po | 22 ++++++----- webcit/po/es.po | 23 ++++++----- webcit/po/fr.po | 23 ++++++----- webcit/po/it.po | 23 ++++++----- webcit/po/webcit.pot | 22 ++++++----- webcit/smtpqueue.c | 91 ++++++++++++++++++++++++++++++++++---------- webcit/webcit.c | 2 + webcit/webcit.h | 1 + 10 files changed, 170 insertions(+), 83 deletions(-) diff --git a/webcit/po/da.po b/webcit/po/da.po index c4aea02e7..d031be4ba 100644 --- a/webcit/po/da.po +++ b/webcit/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: WebCit 6.82\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-27 14:20-0400\n" +"POT-Creation-Date: 2006-10-28 00:14-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Flemming Veggerby \n" "Language-Team: Danish \n" @@ -1074,7 +1074,7 @@ msgstr "Domænenavne og Internet post konfiguration" msgid "Configure replication with other Citadel servers" msgstr "Konfigurér replikéring med andre Citadel servere" -#: ../mainmenu.c:229 ../smtpqueue.c:144 +#: ../mainmenu.c:229 ../smtpqueue.c:210 msgid "View the outbound SMTP queue" msgstr "" @@ -1258,7 +1258,7 @@ msgstr "Ingen gamle meddelelser." msgid "No messages here." msgstr "Ingen meddelelser her." -#: ../messages.c:2345 ../smtpqueue.c:173 +#: ../messages.c:2345 ../smtpqueue.c:166 msgid "Sender" msgstr "Afsender" @@ -2375,33 +2375,38 @@ msgstr "Samme politik som for offentlige rum" msgid "Your system configuration has been updated." msgstr "Din system konfiguration er blevet opdateret" -#: ../smtpqueue.c:167 +#: ../smtpqueue.c:160 #, fuzzy msgid "Message ID" msgstr "Meddelelser" -#: ../smtpqueue.c:169 +#: ../smtpqueue.c:162 #, fuzzy msgid "Date/time submitted" msgstr "Meddelelser sendt" -#: ../smtpqueue.c:171 +#: ../smtpqueue.c:164 msgid "Last attempt" msgstr "" -#: ../smtpqueue.c:175 +#: ../smtpqueue.c:168 msgid "Recipients" msgstr "" -#: ../smtpqueue.c:187 +#: ../smtpqueue.c:180 #, fuzzy msgid "The queue is empty." msgstr "Denne adressebog er tom." -#: ../smtpqueue.c:193 +#: ../smtpqueue.c:186 msgid "You do not have permission to view this resource." msgstr "" +#: ../smtpqueue.c:227 +#, fuzzy +msgid "Refresh this page" +msgstr "Editér denne side" + #: ../subst.c:216 msgid "ERROR: could not open template " msgstr "FEJL: kunne ikke Ã¥bne skabelon" diff --git a/webcit/po/de.po b/webcit/po/de.po index 6dc1bf914..b1e32f133 100644 --- a/webcit/po/de.po +++ b/webcit/po/de.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-27 14:20-0400\n" +"POT-Creation-Date: 2006-10-28 00:14-0400\n" "PO-Revision-Date: 2006-09-01 09:15+0200\n" "Last-Translator: Wilfried Goesgens \n" "Language-Team: \n" @@ -1076,7 +1076,7 @@ msgstr "Domänenname und Internetmail Konfiguration" msgid "Configure replication with other Citadel servers" msgstr "Die Replikation mit anderen Citadellen Konfigurieren" -#: ../mainmenu.c:229 ../smtpqueue.c:144 +#: ../mainmenu.c:229 ../smtpqueue.c:210 msgid "View the outbound SMTP queue" msgstr "" @@ -1260,7 +1260,7 @@ msgstr "Keine alte Nachricht" msgid "No messages here." msgstr "Keine Beiträge hier" -#: ../messages.c:2345 ../smtpqueue.c:173 +#: ../messages.c:2345 ../smtpqueue.c:166 msgid "Sender" msgstr "Absender" @@ -2377,33 +2377,38 @@ msgstr "Die selben Werte wie in öffentlichen Räumen" msgid "Your system configuration has been updated." msgstr "Ihre Systemkonfiguration wurde Übernommen" -#: ../smtpqueue.c:167 +#: ../smtpqueue.c:160 #, fuzzy msgid "Message ID" msgstr "Nachrichten" -#: ../smtpqueue.c:169 +#: ../smtpqueue.c:162 #, fuzzy msgid "Date/time submitted" msgstr "Nachricht abgeschickt" -#: ../smtpqueue.c:171 +#: ../smtpqueue.c:164 msgid "Last attempt" msgstr "" -#: ../smtpqueue.c:175 +#: ../smtpqueue.c:168 msgid "Recipients" msgstr "" -#: ../smtpqueue.c:187 +#: ../smtpqueue.c:180 #, fuzzy msgid "The queue is empty." msgstr "Dieses Adressbuch ist leer." -#: ../smtpqueue.c:193 +#: ../smtpqueue.c:186 msgid "You do not have permission to view this resource." msgstr "" +#: ../smtpqueue.c:227 +#, fuzzy +msgid "Refresh this page" +msgstr "Diese Seite bearbeiten" + #: ../subst.c:216 msgid "ERROR: could not open template " msgstr "FEHLER: konnte Template nicht öffnen" diff --git a/webcit/po/en_GB.po b/webcit/po/en_GB.po index 223d4de38..90c420f3c 100644 --- a/webcit/po/en_GB.po +++ b/webcit/po/en_GB.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: WebCit 6.71\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-27 14:20-0400\n" +"POT-Creation-Date: 2006-10-28 00:14-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: David Given \n" "Language-Team: LANGUAGE \n" @@ -1030,7 +1030,7 @@ msgstr "" msgid "Configure replication with other Citadel servers" msgstr "" -#: ../mainmenu.c:229 ../smtpqueue.c:144 +#: ../mainmenu.c:229 ../smtpqueue.c:210 msgid "View the outbound SMTP queue" msgstr "" @@ -1211,7 +1211,7 @@ msgstr "" msgid "No messages here." msgstr "" -#: ../messages.c:2345 ../smtpqueue.c:173 +#: ../messages.c:2345 ../smtpqueue.c:166 msgid "Sender" msgstr "" @@ -2293,30 +2293,34 @@ msgstr "" msgid "Your system configuration has been updated." msgstr "" -#: ../smtpqueue.c:167 +#: ../smtpqueue.c:160 msgid "Message ID" msgstr "" -#: ../smtpqueue.c:169 +#: ../smtpqueue.c:162 msgid "Date/time submitted" msgstr "" -#: ../smtpqueue.c:171 +#: ../smtpqueue.c:164 msgid "Last attempt" msgstr "" -#: ../smtpqueue.c:175 +#: ../smtpqueue.c:168 msgid "Recipients" msgstr "" -#: ../smtpqueue.c:187 +#: ../smtpqueue.c:180 msgid "The queue is empty." msgstr "" -#: ../smtpqueue.c:193 +#: ../smtpqueue.c:186 msgid "You do not have permission to view this resource." msgstr "" +#: ../smtpqueue.c:227 +msgid "Refresh this page" +msgstr "" + #: ../subst.c:216 msgid "ERROR: could not open template " msgstr "" diff --git a/webcit/po/es.po b/webcit/po/es.po index 575949e96..315cc6715 100644 --- a/webcit/po/es.po +++ b/webcit/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: WEBCIT 6.40\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-27 14:20-0400\n" +"POT-Creation-Date: 2006-10-28 00:14-0400\n" "PO-Revision-Date: 2006-04-13 16:23-0500\n" "Last-Translator: Gabriel C. Huertas \n" "Language-Team: Spanish \n" @@ -1079,7 +1079,7 @@ msgstr "Dominios y configuración de correo de internet" msgid "Configure replication with other Citadel servers" msgstr "Configurar replicación con otros servidores Citadel" -#: ../mainmenu.c:229 ../smtpqueue.c:144 +#: ../mainmenu.c:229 ../smtpqueue.c:210 msgid "View the outbound SMTP queue" msgstr "" @@ -1263,7 +1263,7 @@ msgstr "No hay mensajes antiguos" msgid "No messages here." msgstr "No hay mensajes aquí" -#: ../messages.c:2345 ../smtpqueue.c:173 +#: ../messages.c:2345 ../smtpqueue.c:166 msgid "Sender" msgstr "Remitente" @@ -2387,33 +2387,38 @@ msgstr "Misma política que para salas públicas" msgid "Your system configuration has been updated." msgstr "Su confiración de sistema ha sido actualizada" -#: ../smtpqueue.c:167 +#: ../smtpqueue.c:160 #, fuzzy msgid "Message ID" msgstr "Mensajes" -#: ../smtpqueue.c:169 +#: ../smtpqueue.c:162 #, fuzzy msgid "Date/time submitted" msgstr "Mensajes enviados" -#: ../smtpqueue.c:171 +#: ../smtpqueue.c:164 msgid "Last attempt" msgstr "" -#: ../smtpqueue.c:175 +#: ../smtpqueue.c:168 msgid "Recipients" msgstr "" -#: ../smtpqueue.c:187 +#: ../smtpqueue.c:180 #, fuzzy msgid "The queue is empty." msgstr "Esta libreta de direcciones está vacía." -#: ../smtpqueue.c:193 +#: ../smtpqueue.c:186 msgid "You do not have permission to view this resource." msgstr "" +#: ../smtpqueue.c:227 +#, fuzzy +msgid "Refresh this page" +msgstr "Editar esta página" + #: ../subst.c:216 msgid "ERROR: could not open template " msgstr "ERROR: no se pudo abrir la plantilla (template) " diff --git a/webcit/po/fr.po b/webcit/po/fr.po index 02ca9d36c..8d07c9c1f 100644 --- a/webcit/po/fr.po +++ b/webcit/po/fr.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: ~fr\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-27 14:20-0400\n" +"POT-Creation-Date: 2006-10-28 00:14-0400\n" "PO-Revision-Date: 2006-10-14 09:03+0200\n" "Last-Translator: Thierry Pasquier - Jacques Lavignotte \n" @@ -1079,7 +1079,7 @@ msgstr "Configuration des noms de domaine et du courrier électronique" msgid "Configure replication with other Citadel servers" msgstr "Configurer la réplication des autres serveurs Citadel" -#: ../mainmenu.c:229 ../smtpqueue.c:144 +#: ../mainmenu.c:229 ../smtpqueue.c:210 msgid "View the outbound SMTP queue" msgstr "" @@ -1263,7 +1263,7 @@ msgstr "Pas de messages anciens." msgid "No messages here." msgstr "Pas de messages ici." -#: ../messages.c:2345 ../smtpqueue.c:173 +#: ../messages.c:2345 ../smtpqueue.c:166 msgid "Sender" msgstr "Expéditeur" @@ -2385,33 +2385,38 @@ msgstr "Mêmes règles que dans les salons publics" msgid "Your system configuration has been updated." msgstr "La configuration de votre système a été mise à jour" -#: ../smtpqueue.c:167 +#: ../smtpqueue.c:160 #, fuzzy msgid "Message ID" msgstr "Messages" -#: ../smtpqueue.c:169 +#: ../smtpqueue.c:162 #, fuzzy msgid "Date/time submitted" msgstr "Messages soumis" -#: ../smtpqueue.c:171 +#: ../smtpqueue.c:164 msgid "Last attempt" msgstr "" -#: ../smtpqueue.c:175 +#: ../smtpqueue.c:168 msgid "Recipients" msgstr "" -#: ../smtpqueue.c:187 +#: ../smtpqueue.c:180 #, fuzzy msgid "The queue is empty." msgstr "Le carnet d'adresses est vide." -#: ../smtpqueue.c:193 +#: ../smtpqueue.c:186 msgid "You do not have permission to view this resource." msgstr "" +#: ../smtpqueue.c:227 +#, fuzzy +msgid "Refresh this page" +msgstr "Éditer cette page" + #: ../subst.c:216 msgid "ERROR: could not open template " msgstr "ERREUR : impossible d'ouvrir le modèle" diff --git a/webcit/po/it.po b/webcit/po/it.po index a52378639..db75a1223 100644 --- a/webcit/po/it.po +++ b/webcit/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: it\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-27 14:20-0400\n" +"POT-Creation-Date: 2006-10-28 00:14-0400\n" "PO-Revision-Date: 2006-02-27 10:07+0100\n" "Last-Translator: Gabriele Tassoni \n" "Language-Team: italian \n" @@ -1086,7 +1086,7 @@ msgstr "Configurazione dei nomi di dominio e della posta internet" msgid "Configure replication with other Citadel servers" msgstr "Configura la replicazione con altri server Citadel" -#: ../mainmenu.c:229 ../smtpqueue.c:144 +#: ../mainmenu.c:229 ../smtpqueue.c:210 msgid "View the outbound SMTP queue" msgstr "" @@ -1271,7 +1271,7 @@ msgstr "Nessun vecchio messaggio." msgid "No messages here." msgstr "Nessun messaggio." -#: ../messages.c:2345 ../smtpqueue.c:173 +#: ../messages.c:2345 ../smtpqueue.c:166 msgid "Sender" msgstr "Mittente" @@ -2398,33 +2398,38 @@ msgstr "Stessa politica delle stanze private" msgid "Your system configuration has been updated." msgstr "La configurazione del tuo sistema è stata aggiornata" -#: ../smtpqueue.c:167 +#: ../smtpqueue.c:160 #, fuzzy msgid "Message ID" msgstr "Messaggi" -#: ../smtpqueue.c:169 +#: ../smtpqueue.c:162 #, fuzzy msgid "Date/time submitted" msgstr "Numero di Messaggi" -#: ../smtpqueue.c:171 +#: ../smtpqueue.c:164 msgid "Last attempt" msgstr "" -#: ../smtpqueue.c:175 +#: ../smtpqueue.c:168 msgid "Recipients" msgstr "" -#: ../smtpqueue.c:187 +#: ../smtpqueue.c:180 #, fuzzy msgid "The queue is empty." msgstr "Questa lista contatti è vuota" -#: ../smtpqueue.c:193 +#: ../smtpqueue.c:186 msgid "You do not have permission to view this resource." msgstr "" +#: ../smtpqueue.c:227 +#, fuzzy +msgid "Refresh this page" +msgstr "Modifica questa pagina" + #: ../subst.c:216 msgid "ERROR: could not open template " msgstr "ERRORE non riesco ad aprire il template" diff --git a/webcit/po/webcit.pot b/webcit/po/webcit.pot index 401efb5dd..41df9bfe5 100644 --- a/webcit/po/webcit.pot +++ b/webcit/po/webcit.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-27 14:20-0400\n" +"POT-Creation-Date: 2006-10-28 00:14-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1031,7 +1031,7 @@ msgstr "" msgid "Configure replication with other Citadel servers" msgstr "" -#: ../mainmenu.c:229 ../smtpqueue.c:144 +#: ../mainmenu.c:229 ../smtpqueue.c:210 msgid "View the outbound SMTP queue" msgstr "" @@ -1212,7 +1212,7 @@ msgstr "" msgid "No messages here." msgstr "" -#: ../messages.c:2345 ../smtpqueue.c:173 +#: ../messages.c:2345 ../smtpqueue.c:166 msgid "Sender" msgstr "" @@ -2294,30 +2294,34 @@ msgstr "" msgid "Your system configuration has been updated." msgstr "" -#: ../smtpqueue.c:167 +#: ../smtpqueue.c:160 msgid "Message ID" msgstr "" -#: ../smtpqueue.c:169 +#: ../smtpqueue.c:162 msgid "Date/time submitted" msgstr "" -#: ../smtpqueue.c:171 +#: ../smtpqueue.c:164 msgid "Last attempt" msgstr "" -#: ../smtpqueue.c:175 +#: ../smtpqueue.c:168 msgid "Recipients" msgstr "" -#: ../smtpqueue.c:187 +#: ../smtpqueue.c:180 msgid "The queue is empty." msgstr "" -#: ../smtpqueue.c:193 +#: ../smtpqueue.c:186 msgid "You do not have permission to view this resource." msgstr "" +#: ../smtpqueue.c:227 +msgid "Refresh this page" +msgstr "" + #: ../subst.c:216 msgid "ERROR: could not open template " msgstr "" diff --git a/webcit/smtpqueue.c b/webcit/smtpqueue.c index f41e38fa8..f3ac4a35d 100644 --- a/webcit/smtpqueue.c +++ b/webcit/smtpqueue.c @@ -25,6 +25,7 @@ void display_queue_msg(long msgnum) char recipients[65536]; char thisrecp[256]; char thisdsn[256]; + long msgid = 0; strcpy(sender, ""); strcpy(recipients, ""); @@ -61,6 +62,10 @@ void display_queue_msg(long msgnum) if ( (in_body) && (is_delivery_list) ) { extract_token(keyword, buf, 0, '|', sizeof keyword); + if (!strcasecmp(keyword, "msgid")) { + msgid = extract_long(buf, 1); + } + if (!strcasecmp(keyword, "submitted")) { submitted = extract_long(buf, 1); } @@ -75,6 +80,17 @@ void display_queue_msg(long msgnum) if (!strcasecmp(keyword, "bounceto")) { extract_token(sender, buf, 1, '|', sizeof sender); + + /* Strip off local hostname if it's our own */ + char *atsign; + atsign = strchr(sender, '@'); + if (atsign != NULL) { + ++atsign; + if (!strcasecmp(atsign, serv_info.serv_nodename)) { + --atsign; + *atsign = 0; + } + } } if (!strcasecmp(keyword, "remote")) { @@ -100,6 +116,9 @@ void display_queue_msg(long msgnum) wprintf(""); wprintf("%ld", msgnum); + wprintf(" %s", + msgnum, msgid, _("(Delete)") + ); wprintf(""); if (submitted > 0) { @@ -129,28 +148,10 @@ void display_queue_msg(long msgnum) } -/** - * \brief display the outbound SMTP queue - */ -void display_smtpqueue(void) -{ +void display_smtpqueue_inner_div(void) { int i; int num_msgs; - output_headers(1, 1, 2, 0, 0, 0); - wprintf("
\n"); - wprintf("
"); - wprintf(""); - wprintf(_("View the outbound SMTP queue")); - wprintf("\n"); - wprintf("
\n"); - wprintf("
\n
\n"); - - wprintf("
" - "" - "
\n"); - - /* Check to see if we can go to the __CitadelSMTPspoolout__ room. * If not, we don't have access to the queue. */ @@ -194,7 +195,57 @@ void display_smtpqueue(void) wprintf("

"); } - wprintf("
\n"); +} + +/** + * \brief display the outbound SMTP queue + */ +void display_smtpqueue(void) +{ + output_headers(1, 1, 2, 0, 0, 0); + + wprintf(" \n" + ); + + wprintf("
\n"); + wprintf("
"); + wprintf(""); + wprintf(_("View the outbound SMTP queue")); + wprintf("\n"); + wprintf("
\n"); + wprintf("
\n
\n"); + + wprintf("
" + "" + "
\n"); + + wprintf("
"); + + display_smtpqueue_inner_div(); + + wprintf("
" + "
" + "%s" + "
" + "
\n", _("Refresh this page") + ); wDumpContent(1); } diff --git a/webcit/webcit.c b/webcit/webcit.c index b1201856e..2cdbbd8ae 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1622,6 +1622,8 @@ void session_loop(struct httprequest *req) save_inetconf(); } else if (!strcasecmp(action, "display_smtpqueue")) { display_smtpqueue(); + } else if (!strcasecmp(action, "display_smtpqueue_inner_div")) { + display_smtpqueue_inner_div(); } else if (!strcasecmp(action, "setup_wizard")) { do_setup_wizard(); } else if (!strcasecmp(action, "display_preferences")) { diff --git a/webcit/webcit.h b/webcit/webcit.h index f96213b52..72d3ac3b7 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -624,6 +624,7 @@ void set_room_policy(void); void display_inetconf(void); void save_inetconf(void); void display_smtpqueue(void); +void display_smtpqueue_inner_div(void); void generate_uuid(char *); void CtdlMakeTempFileName(char *, int); void display_preferences(void); -- 2.30.2