Перейти к содержимому


Фото
- - - - -

DrWeb Webmin модуль: Greasemonkey-скрипт для просмотра сообщений из карантина в штатном почтовом клиенте

Webmin Greasemonkey карантин Firefox

  • Please log in to reply
1 ответов в теме

#1 Роман Владимирович

Роман Владимирович

    Newbie

  • Posters
  • 29 Сообщений:

Отправлено 11 Январь 2012 - 10:34

При нажатии на кнопку 'ViewSource' браузер предложит скачать сообщение электронной почты.

1. Установить дополнение для Firefox Greasemonkey https://addons.mozilla.org/ru/firefox/addon/greasemonkey/

2. В теле скрипта строку 'webminserver.domain.tld' заменить на имя хоста вашего сервера.


// ==UserScript==
// @name		   DrWebQViewEMail
// @namespace	  DrWebQViewEMail
// @include		https://webminserver.domain.tld:10000/drweb-maild/modules/quarantine.cgi?a=get_email_source*
// ==/UserScript==
var searchString = 'Received: from';
var elements = document.getElementsByTagName('pre');
var EML='';
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf(searchString) !== -1) {
  EML=elements[i].innerHTML;
  break;
}
}
window.onload=function(){
try {
  var EMLEncoded = "data:message/rfc822," + encodeURIComponent(EML);
}
catch(err) {
  alert("Can't encode e-mail message by 'encodeURIComponent' function!");
  exit;
}
window.location=EMLEncoded;
window.close();
}


#2 Роман Владимирович

Роман Владимирович

    Newbie

  • Posters
  • 29 Сообщений:

Отправлено 11 Январь 2012 - 11:59

Версия 0.2 ;)

// ==UserScript==
// @name		   DrWebQViewEMail
// @namespace	  DrWebQViewEMail
// @include		https://fsnode3.buh.pes.spb.ru:10000/drweb-maild/modules/quarantine.cgi?a=get_email_source*
// Version 0.2
// ==/UserScript==
var searchString = 'Received: from';
var elements = document.getElementsByTagName('pre');
var EML='';
function substr_replace(src_string, find_substr, repl_substr) {
	return src_string.split(find_substr).join(repl_substr);
}
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf(searchString) !== -1) {
  EML=elements[i].innerHTML;
  EML=substr_replace(EML,'&lt;','<');
  EML=substr_replace(EML,'&gt;','>');
  EML=substr_replace(EML,'&amp;','&');
  EML=substr_replace(EML,'&quot;','"');
  EML=substr_replace(EML,'&apos;',"'");
  break;
}
}
window.onload=function(){
try {
  var EMLEncoded = "data:message/rfc822," + encodeURIComponent(EML);
}
catch(err) {
  alert("Can't encode e-mail message by 'encodeURIComponent' function!");
  exit;
}
window.location=EMLEncoded;
window.close();
}

Сообщение было изменено Роман Владимирович: 11 Январь 2012 - 12:03




Also tagged with one or more of these keywords: Webmin, Greasemonkey, карантин, Firefox

Читают тему: 1

0 пользователей, 1 гостей, 0 скрытых