update disclaim
This commit is contained in:
parent
9eb1eca8d1
commit
66f299aca1
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Kaz addon (see https://git.kaz.bzh/KAZ/depollueur for information)
|
* Kaz addon (see https://git.kaz.bzh/KAZ/depollueur for information)
|
||||||
* foward dowload to NextCloud API
|
* foward download to NextCloud API
|
||||||
|
|
||||||
c.php => config
|
c.php => config
|
||||||
c.php?s="sender"&t="token"
|
c.php?s="sender"&t="token"
|
||||||
|
@ -62,7 +62,7 @@ const string Attachment::HTML ("html");
|
|||||||
const string Attachment::RELATED ("related");
|
const string Attachment::RELATED ("related");
|
||||||
const string Attachment::SIGNED ("signed");
|
const string Attachment::SIGNED ("signed");
|
||||||
const string Attachment::ALTERNATIVE ("alternative");
|
const string Attachment::ALTERNATIVE ("alternative");
|
||||||
const string Attachment::KAZ_ATTACH_NAME ("vos-pieces-jointes-kaz-ici.htm");
|
const string Attachment::KAZ_ATTACH_NAME ("vos-pieces-jointes-kaz-ici.html");
|
||||||
const string Attachment::MULTIPART ("multipart/");
|
const string Attachment::MULTIPART ("multipart/");
|
||||||
|
|
||||||
const regex Attachment::nameCharsetRegEx ( ".*name\\*=\\s*([; \t]*)");
|
const regex Attachment::nameCharsetRegEx ( ".*name\\*=\\s*([; \t]*)");
|
||||||
|
@ -66,15 +66,23 @@ static const regex archiveURLRegex (".*(([&?]g=)|([&?]l=/)).*");
|
|||||||
static const string KAZ_PLAIN_HR ("______________________________________________________________________________");
|
static const string KAZ_PLAIN_HR ("______________________________________________________________________________");
|
||||||
static const string KAZ_PLAIN_START ("~~ PJ-KAZ !"); // don't end whith space
|
static const string KAZ_PLAIN_START ("~~ PJ-KAZ !"); // don't end whith space
|
||||||
static const string KAZ_PLAIN_STOP (KAZ_PLAIN_START+" ~~");
|
static const string KAZ_PLAIN_STOP (KAZ_PLAIN_START+" ~~");
|
||||||
static const string KAZ_PLAIN_DONT_TOUCH ("(conservez cette partie intacte dans votre réponse si vous voulez transmettre les documents précédents (version "+LAST_VERSION_NUM+"))");
|
static const string KAZ_PLAIN_DONT_TOUCH ("(conservez cette partie si vous souhaitez transmettre les documents précédents (version "+LAST_VERSION_NUM+"))");
|
||||||
static const string KAZ_PLAIN_WARNING ("Attention : Kaz a dépollué ce message. Les pièces jointes ont été retirées et placées dans un dépôt provisoire. "
|
static const string KAZ_PLAIN_WARNING ("Attention : si vous souhaitez récupérer des informations de votre correspondant envoyées en pièces-jointes, lisez attentivement ce qui suit.\n\n"
|
||||||
"Elles seront automatiquement supprimées dans 1 mois. "
|
|
||||||
"Si elles sont importantes et que vous souhaitez les conserver, vous devez utiliser les liens ci-dessous. "
|
"Pour des questions de sobriété numérique, les pièces-jointes ont été supprimées de ce courriel et remplacées par des liens de téléchargement.\n"
|
||||||
"Pour mieux comprendre la politique de nos services visitez kaz.bzh");
|
"Ne cherchez pas à utiliser la fonction enregistrement des pièces-jointes de votre logiciel. Le trombone qui apparaît n’est là que pour vous signaler des liens à télécharger.\n"
|
||||||
static const string KAZ_PLAIN_DOWLOAD_ONE ("Vos pièces jointes sont à télécharger individuellement ici :");
|
"Il y a 3 sortes de liens :\n"
|
||||||
static const string KAZ_PLAIN_DOWLOAD_OTHER ("(Contenu dans des messages précédents)");
|
" * un ensemble de liens de téléchargement individuel\n"
|
||||||
static const string KAZ_PLAIN_DOWLOAD_ALL ("Vous pouvez télécharger l'ensemble dans une archive là :");
|
" * un lien de téléchargement récapitulatif permettant d’accéder à l’ensemble précédent dans une archive\n"
|
||||||
static const string KAZ_PLAIN_DOWLOAD_CLOUD ("Expérimental : vous pouvez classer les pièces jointes dans votre cloud là :");
|
" * une fonctionnalité proposée au kaznautes sous la forme d’un lien permettant de ranger les pièces jointes dans un bureau virtuel (nextcloud)\n\n"
|
||||||
|
"En « dépolluant » ce message, Kaz a retiré et placé les pièces jointes d’origine dans un dépôt provisoire.\n"
|
||||||
|
"Si elles sont importantes et que vous souhaitez les conserver, vous devez utiliser les liens en bas de ce courriel.\n"
|
||||||
|
"Elles seront automatiquement supprimées dans 1 mois.\n\n"
|
||||||
|
"Pour mieux comprendre la politique de nos services visitez https://wiki.kaz.bzh/le_gros_de_kaz");
|
||||||
|
static const string KAZ_PLAIN_DOWNLOAD_ONE ("Vos pièces jointes sont à télécharger individuellement ici :");
|
||||||
|
static const string KAZ_PLAIN_DOWNLOAD_OTHER ("(Contenu dans des messages précédents)");
|
||||||
|
static const string KAZ_PLAIN_DOWNLOAD_ALL ("Vous pouvez télécharger l'ensemble dans une archive là :");
|
||||||
|
static const string KAZ_PLAIN_DOWNLOAD_CLOUD ("Pour les kaznautes, vous pouvez classer les pièces jointes dans votre cloud en suivant ce lien :");
|
||||||
|
|
||||||
static const string HEAD ("<head>");
|
static const string HEAD ("<head>");
|
||||||
static const string HEAD_END ("</head>");
|
static const string HEAD_END ("</head>");
|
||||||
@ -95,11 +103,24 @@ static const string KAZ_HTML_TAG ("<!--KAZ"); // don't end whith space
|
|||||||
static const string KAZ_HTML_START (KAZ_HTML_TAG+" START-->");
|
static const string KAZ_HTML_START (KAZ_HTML_TAG+" START-->");
|
||||||
static const string KAZ_HTML_STOP (KAZ_HTML_TAG+" STOP-->");
|
static const string KAZ_HTML_STOP (KAZ_HTML_TAG+" STOP-->");
|
||||||
// Textes précédents encodés en SGML
|
// Textes précédents encodés en SGML
|
||||||
|
static const string KAZ_HTML_NOT_SAVE ("<p><b>Ceci n'est pas une pièce-jointe, mais la liste des liens pour les télécharger.</b></p>");
|
||||||
static const string KAZ_HTML_DONT_TOUCH ("(conservez cette partie intacte dans votre réponse si vous voulez transmettre les documents précédents (version "+LAST_VERSION_NUM+"))");
|
static const string KAZ_HTML_DONT_TOUCH ("(conservez cette partie intacte dans votre réponse si vous voulez transmettre les documents précédents (version "+LAST_VERSION_NUM+"))");
|
||||||
static const string KAZ_HTML_DOWLOAD_ONE ("Vos pièces jointes sont à télécharger individuellement ici :");
|
static const string KAZ_HTML_WARNING ("<div class=\"nb\"><p>Attention : si vous souhaitez récupérer des informations de votre correspondant envoyées en pièces-jointes, lisez attentivement ce qui suit.</p>"
|
||||||
static const string KAZ_HTML_DOWLOAD_OTHER ("(Contenu dans des messages précédents)");
|
|
||||||
static const string KAZ_HTML_DOWLOAD_ALL ("Vous pouvez télécharger l'ensemble dans une archive là :");
|
"<p>Pour des questions de sobriété numérique, les pièces-jointes ont été supprimées de ce courriel et remplacées par des liens de téléchargement.</br>"
|
||||||
static const string KAZ_HTML_DOWLOAD_CLOUD ("Expérimental : vous pouvez classer les pièces jointes dans votre cloud là :");
|
"Ne cherchez pas à utiliser la fonction enregistrement des pièces-jointes de votre logiciel. Le trombone qui apparaît n’est là que pour vous signaler des liens à télécharger.</br>"
|
||||||
|
"Il y a 3 sortes de liens :<ul>"
|
||||||
|
"<li>un ensemble de liens de téléchargement individuel</li>"
|
||||||
|
"<li>un lien de téléchargement récapitulatif permettant d’accéder à l’ensemble précédent dans une archive</li>"
|
||||||
|
"<li>une fonctionnalité proposée au kaznautes sous la forme d’un lien permettant de ranger les pièces jointes dans un bureau virtuel (nextcloud)</li></ul>"
|
||||||
|
"En « dépolluant » ce message, Kaz a retiré et placé les pièces jointes d’origine dans un dépôt provisoire.</br>"
|
||||||
|
"Si elles sont importantes et que vous souhaitez les conserver, vous devez utiliser les liens en bas de ce courriel.</br>"
|
||||||
|
"Elles seront automatiquement supprimées dans 1 mois.</p>"
|
||||||
|
"<p>Pour mieux comprendre la politique de nos services visitez https://wiki.kaz.bzh/le_gros_de_kaz</p></div>");
|
||||||
|
static const string KAZ_HTML_DOWNLOAD_ONE ("Vos pièces jointes sont à télécharger individuellement ici :");
|
||||||
|
static const string KAZ_HTML_DOWNLOAD_OTHER ("(Contenu dans des messages précédents)");
|
||||||
|
static const string KAZ_HTML_DOWNLOAD_ALL ("Vous pouvez télécharger l'ensemble dans une archive là :");
|
||||||
|
static const string KAZ_HTML_DOWNLOAD_CLOUD ("Expérimental : vous pouvez classer les pièces jointes dans votre cloud là :");
|
||||||
static const string KAZ_HTML_ARCHIVE ("archive");
|
static const string KAZ_HTML_ARCHIVE ("archive");
|
||||||
static const string KAZ_HTML_CLOUD ("cloud");
|
static const string KAZ_HTML_CLOUD ("cloud");
|
||||||
|
|
||||||
@ -116,20 +137,20 @@ Attachment::stringsToUpdate ({KAZ_PLAIN_START, "\""+CID});
|
|||||||
|
|
||||||
// ================================================================================
|
// ================================================================================
|
||||||
const string MainAttachment::templatePlainAddLink (" * "+TMPL_FILENAME+" < "+TMPL_DOWNLOAD+" >\n");
|
const string MainAttachment::templatePlainAddLink (" * "+TMPL_FILENAME+" < "+TMPL_DOWNLOAD+" >\n");
|
||||||
const string MainAttachment::templatePlainAllLink ("\n * "+KAZ_PLAIN_DOWLOAD_ALL+" < "+TMPL_DOWNLOAD+" >\n");
|
const string MainAttachment::templatePlainAllLink ("\n * "+KAZ_PLAIN_DOWNLOAD_ALL+" < "+TMPL_DOWNLOAD+" >\n");
|
||||||
const string MainAttachment::templatePlainCloudLink ("\n * "+KAZ_PLAIN_DOWLOAD_CLOUD+" < "+TMPL_DOWNLOAD+" >\n");
|
const string MainAttachment::templatePlainCloudLink ("\n * "+KAZ_PLAIN_DOWNLOAD_CLOUD+" < "+TMPL_DOWNLOAD+" >\n");
|
||||||
const string MainAttachment::templatePlainFooter ("\n\n"+KAZ_WEB_SITE+"\n\n"+KAZ_PLAIN_WARNING+"\n"+KAZ_PLAIN_HR+"\n"+KAZ_PLAIN_STOP+"\n\n");
|
const string MainAttachment::templatePlainFooter ("\n\n"+KAZ_PLAIN_WARNING+"\n"+KAZ_PLAIN_HR+"\n"+KAZ_PLAIN_STOP+"\n\n");
|
||||||
|
|
||||||
const string MainAttachment::templateHtmlHeader (KAZ_HTML_START+"<p style=\"clear: left; padding: 1pc 0 0 0; font-size:10px; color:#969696;\">"+KAZ_PLAIN_START+"</p><hr>\n"
|
const string MainAttachment::templateHtmlHeader (KAZ_HTML_START+"<p style=\"clear: left; padding: 1pc 0 0 0; font-size:10px; color:#969696;\">"+KAZ_PLAIN_START+"</p><hr>\n"
|
||||||
"<div class=\"kaz\">"
|
"<div class=\"kaz2\">"
|
||||||
"<p style=\"font-size:10px; color:#969696;\">"+KAZ_HTML_DONT_TOUCH+"</p>\n"
|
"<p style=\"font-size:10px; color:#969696;\">"+KAZ_HTML_DONT_TOUCH+"</p>\n"
|
||||||
"<p>"+KAZ_HTML_DOWLOAD_ONE+"<ul>\n");
|
"<p>"+KAZ_HTML_DOWNLOAD_ONE+"<ul>\n");
|
||||||
const string MainAttachment::templateHtmlAddLink (LI_ONE+"<a "+HREF_ONE+TMPL_DOWNLOAD+"\">"+TMPL_FILENAME+"</a>"+LI_END+"\n");
|
const string MainAttachment::templateHtmlAddLink (LI_ONE+"<a "+HREF_ONE+TMPL_DOWNLOAD+"\">"+TMPL_FILENAME+"</a>"+LI_END+"\n");
|
||||||
const string MainAttachment::templateHtmlOtherLink ("</ul>"+KAZ_HTML_DOWLOAD_OTHER+"<ul>\n");
|
const string MainAttachment::templateHtmlOtherLink ("</ul>"+KAZ_HTML_DOWNLOAD_OTHER+"<ul>\n");
|
||||||
const string MainAttachment::templateHtmlAllLink ("</ul><ul>"+LI_ALL+KAZ_HTML_DOWLOAD_ALL+" <a href=\""+TMPL_DOWNLOAD+"\">"+KAZ_HTML_ARCHIVE+"</a>"+LI_END+"\n");
|
const string MainAttachment::templateHtmlAllLink ("</ul><ul>"+LI_ALL+KAZ_HTML_DOWNLOAD_ALL+" <a href=\""+TMPL_DOWNLOAD+"\">"+KAZ_HTML_ARCHIVE+"</a>"+LI_END+"\n");
|
||||||
const string MainAttachment::templateHtmlCloudLink ("</ul><ul>"+LI_ALL+KAZ_HTML_DOWLOAD_CLOUD+" <a href=\""+TMPL_DOWNLOAD+"\">"+KAZ_HTML_CLOUD+"</a>"+LI_END+"\n");
|
const string MainAttachment::templateHtmlCloudLink ("</ul><ul>"+LI_ALL+KAZ_HTML_DOWNLOAD_CLOUD+" <a href=\""+TMPL_DOWNLOAD+"\">"+KAZ_HTML_CLOUD+"</a>"+LI_END+"\n");
|
||||||
const string MainAttachment::templateHtmlFooter ("</ul></p>\n"
|
const string MainAttachment::templateHtmlFooter ("</ul></p>\n"
|
||||||
"<p class=\"msg\"><a class=\"kaz\" href=\""+KAZ_WEB_SITE+"\"> "+KAZ_WEB_SITE+" </a></p></div>\n"
|
"<p class=\"msg\"><a class=\"kaz2\" href=\""+KAZ_WEB_SITE+"\"> "+KAZ_WEB_SITE+" </a></p></div>\n"
|
||||||
"<hr><p style=\"font-size:10px; color:#969696;\">"+KAZ_PLAIN_STOP+"</p>"+KAZ_HTML_STOP+"\n\n");
|
"<hr><p style=\"font-size:10px; color:#969696;\">"+KAZ_PLAIN_STOP+"</p>"+KAZ_HTML_STOP+"\n\n");
|
||||||
|
|
||||||
const regex MainAttachment::whiteSpaceRegEx ("\\s+");
|
const regex MainAttachment::whiteSpaceRegEx ("\\s+");
|
||||||
@ -307,10 +328,10 @@ MainAttachment::getDisclaim (string &plain, string &html) const {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
plain = "\n"+KAZ_PLAIN_START+"\n\n"+KAZ_PLAIN_HR+"\n"+KAZ_PLAIN_DONT_TOUCH+"\n\n"+KAZ_PLAIN_DOWLOAD_ONE+"\n"+plainNewLinks;
|
plain = "\n"+KAZ_PLAIN_START+"\n\n"+KAZ_PLAIN_HR+"\n"+KAZ_PLAIN_DONT_TOUCH+"\n\n"+KAZ_PLAIN_DOWNLOAD_ONE+"\n"+plainNewLinks;
|
||||||
html = templateHtmlHeader+htmlNewLinks;
|
html = templateHtmlHeader+htmlNewLinks;
|
||||||
if (previousLinks.size ()) {
|
if (previousLinks.size ()) {
|
||||||
plain += "\n"+KAZ_PLAIN_DOWLOAD_OTHER+"\n"+plainOldLinks;
|
plain += "\n"+KAZ_PLAIN_DOWNLOAD_OTHER+"\n"+plainOldLinks;
|
||||||
html += templateHtmlOtherLink+htmlOldLinks;
|
html += templateHtmlOtherLink+htmlOldLinks;
|
||||||
}
|
}
|
||||||
if (linkCount > 1 && archiveDownloadURL.length ()) {
|
if (linkCount > 1 && archiveDownloadURL.length ()) {
|
||||||
@ -860,7 +881,7 @@ MainAttachment::substitute (ifstream &mbox, ofstream &outbox, const SizeArg &min
|
|||||||
LOG ("remove tag: " << endTag << " content: " << content);
|
LOG ("remove tag: " << endTag << " content: " << content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
content += htmlDisclaim+BODY_END+HTML_END;
|
content += htmlDisclaim+KAZ_HTML_WARNING+BODY_END+HTML_END;
|
||||||
LOG ("content: " << content);
|
LOG ("content: " << content);
|
||||||
}
|
}
|
||||||
if (isPlain)
|
if (isPlain)
|
||||||
@ -889,7 +910,7 @@ MainAttachment::substitute (ifstream &mbox, ofstream &outbox, const SizeArg &min
|
|||||||
outbox << boundary.substr (0, boundaryMiddleSize) << endl
|
outbox << boundary.substr (0, boundaryMiddleSize) << endl
|
||||||
<< KAZ_ATTACHMENT_TEXT_HTML << endl;
|
<< KAZ_ATTACHMENT_TEXT_HTML << endl;
|
||||||
cerr << "eMailShrinker: force attachment" << endl;
|
cerr << "eMailShrinker: force attachment" << endl;
|
||||||
string content (KAZ_HTML_CONTENT+htmlDisclaim+BODY_END+HTML_END);
|
string content (KAZ_HTML_CONTENT+KAZ_HTML_NOT_SAVE+htmlDisclaim+KAZ_HTML_WARNING+BODY_END+HTML_END);
|
||||||
base64Encode (content);
|
base64Encode (content);
|
||||||
|
|
||||||
outbox << content << endl;
|
outbox << content << endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user