From: garvinhicking Date: Thu, 28 Jul 2005 14:51:57 +0000 (+0000) Subject: New config option "blogMail" that specifies the used From: address. X-Git-Tag: 0.8.3~19 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=703250c534d3378a5c4183e6a42d4c9148133e65;p=s9y.git New config option "blogMail" that specifies the used From: address. Used because MTAs may often reject mailadresse if the original mail address from commenting users was used. --- diff --git a/docs/NEWS b/docs/NEWS index 94919fa..3af3f52 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -16,7 +16,12 @@ Version 0.8.3 () * Make categories sidebar plugin show categories' description, not the name on mouse over (garvinhicking) - + + * Added new config option "blogMail" that specifies the blog's used + From: E-Mail address. If not given, falls back to not specifying + From: field and using mailserver default ("wwwrun", "nobody", ...) + (garvinhicking) + * Fix possible exploit that sends comments to the blog owner and others with arbitrary mailheaders and a link to invalid entries. Thanks to Sebastian Raible! (garvinhicking) diff --git a/include/functions.inc.php b/include/functions.inc.php index 73f2df6..c4d532e 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -160,11 +160,11 @@ function serendipity_sendMail($to, $subject, $message, $fromMail, $headers = NUL trigger_error(__FUNCTION__ . ': $headers must be either an array or null', E_USER_ERROR); } - if ( is_null($fromName) ) { + if ( is_null($fromName) || empty($fromName)) { $fromName = $serendipity['blogTitle']; } - if ( is_null($fromMail) ) { + if ( is_null($fromMail) || empty($fromMail)) { $fromMail = $to; } @@ -190,7 +190,10 @@ function serendipity_sendMail($to, $subject, $message, $fromMail, $headers = NUL /* Always add these headers */ - $headers[] = 'From: "'. $fromName .'" <'. $fromMail .'>'; + if (!empty($serendipity['blogMail'])) { + $headers[] = 'From: "'. $fromName .'" <'. $serendipity['blogMail'] .'>'; + } + $headers[] = 'Reply-To: "'. $fromName .'" <'. $fromMail .'>'; $headers[] = 'X-Mailer: Serendipity/'. $serendipity['version']; $headers[] = 'X-Engine: PHP/'. phpversion(); $headers[] = 'Message-ID: <'. md5(microtime() . uniqid(time())) .'@'. $_SERVER['HTTP_HOST'] .'>'; diff --git a/include/tpl/config_local.inc.php b/include/tpl/config_local.inc.php index 2e90fa6..429dbd6 100644 --- a/include/tpl/config_local.inc.php +++ b/include/tpl/config_local.inc.php @@ -171,6 +171,12 @@ 'userlevel' => USERLEVEL_CHIEF, 'flags' => array('simpleInstall')), + array('var' => 'blogMail', + 'title' => INSTALL_BLOG_EMAIL, + 'description' => INSTALL_BLOG_EMAIL_DESC, + 'type' => 'string', + 'default' => ''), + array('var' => 'lang', 'title' => INSTALL_LANG, 'description' => INSTALL_LANG_DESC, diff --git a/lang/serendipity_lang_bg.inc.php b/lang/serendipity_lang_bg.inc.php index 81d6f9e..e3a91da 100644 --- a/lang/serendipity_lang_bg.inc.php +++ b/lang/serendipity_lang_bg.inc.php @@ -651,3 +651,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_cn.inc.php b/lang/serendipity_lang_cn.inc.php index 1c53d56..0886c63 100644 --- a/lang/serendipity_lang_cn.inc.php +++ b/lang/serendipity_lang_cn.inc.php @@ -665,3 +665,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_cs.inc.php b/lang/serendipity_lang_cs.inc.php index d515e85..d70aeeb 100644 --- a/lang/serendipity_lang_cs.inc.php +++ b/lang/serendipity_lang_cs.inc.php @@ -667,3 +667,5 @@ @define('FETCH_METHOD_HOTLINK', 'Odkaz na server'); @define('DELETE_HOTLINK_FILE', 'Vymazán odkazovaný soubor %s'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_cz.inc.php b/lang/serendipity_lang_cz.inc.php index 3cfdfe6..05b7027 100644 --- a/lang/serendipity_lang_cz.inc.php +++ b/lang/serendipity_lang_cz.inc.php @@ -667,3 +667,5 @@ @define('FETCH_METHOD_HOTLINK', 'Odkaz na server'); @define('DELETE_HOTLINK_FILE', 'Vymazán odkazovaný soubor %s'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_da.inc.php b/lang/serendipity_lang_da.inc.php index f661328..ff256e9 100644 --- a/lang/serendipity_lang_da.inc.php +++ b/lang/serendipity_lang_da.inc.php @@ -666,3 +666,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink til server'); @define('DELETE_HOTLINK_FILE', 'Slet den hotlinked fil ved navn %s'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Vis E-Mail adresser?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_de.inc.php b/lang/serendipity_lang_de.inc.php index 40fd494..416c1d0 100644 --- a/lang/serendipity_lang_de.inc.php +++ b/lang/serendipity_lang_de.inc.php @@ -665,3 +665,5 @@ @define('FETCH_METHOD_HOTLINK', 'Nur zum Quellserver linken'); @define('DELETE_HOTLINK_FILE', 'Link zu Datei namens %s löschen?'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'E-Mail Adressen einbinden?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_en.inc.php b/lang/serendipity_lang_en.inc.php index e31c1d0..4225dfb 100644 --- a/lang/serendipity_lang_en.inc.php +++ b/lang/serendipity_lang_en.inc.php @@ -664,3 +664,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_es.inc.php b/lang/serendipity_lang_es.inc.php index a8cf920..628ea8a 100644 --- a/lang/serendipity_lang_es.inc.php +++ b/lang/serendipity_lang_es.inc.php @@ -669,3 +669,5 @@ @define('FETCH_METHOD_HOTLINK', 'Enlazar externamente al servidor'); @define('DELETE_HOTLINK_FILE', 'Borrado el recurso enlazado externamente con el nombre %s'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_fa.inc.php b/lang/serendipity_lang_fa.inc.php index 12d2db9..0c08ba2 100644 --- a/lang/serendipity_lang_fa.inc.php +++ b/lang/serendipity_lang_fa.inc.php @@ -666,3 +666,5 @@ @define('FETCH_METHOD_HOTLINK', 'لینک دادن به سرور'); @define('DELETE_HOTLINK_FILE', 'لینک فایل %s حذف شد'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'آیا آدرس ایمیل ها دیده شود؟'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_fi.inc.php b/lang/serendipity_lang_fi.inc.php index c168ff4..3c90761 100644 --- a/lang/serendipity_lang_fi.inc.php +++ b/lang/serendipity_lang_fi.inc.php @@ -664,3 +664,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_fr.inc.php b/lang/serendipity_lang_fr.inc.php index 8161e4c..29b6b75 100644 --- a/lang/serendipity_lang_fr.inc.php +++ b/lang/serendipity_lang_fr.inc.php @@ -672,3 +672,5 @@ @define('FETCH_METHOD_HOTLINK', 'Lien vers le serveur'); @define('DELETE_HOTLINK_FILE', 'Supression du fichier lié nommé %s'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Montrer l\'adresse E-Mail?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_is.inc.php b/lang/serendipity_lang_is.inc.php index 96f6397..c67ed14 100644 --- a/lang/serendipity_lang_is.inc.php +++ b/lang/serendipity_lang_is.inc.php @@ -664,3 +664,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlinka á þjón'); @define('DELETE_HOTLINK_FILE', 'Eyddi hotlinkaðri skrá, nefnd %s'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Sýna netföng?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_it.inc.php b/lang/serendipity_lang_it.inc.php index f91f2f7..9b506b8 100644 --- a/lang/serendipity_lang_it.inc.php +++ b/lang/serendipity_lang_it.inc.php @@ -666,3 +666,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_ja.inc.php b/lang/serendipity_lang_ja.inc.php index 99e841d..a0ddf27 100644 --- a/lang/serendipity_lang_ja.inc.php +++ b/lang/serendipity_lang_ja.inc.php @@ -666,3 +666,5 @@ Serendipity のアップグレードステージを無視しました。正し @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', '電子メールアドレスを表示しますか?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_ko.inc.php b/lang/serendipity_lang_ko.inc.php index d7f9e2a..0c815ef 100644 --- a/lang/serendipity_lang_ko.inc.php +++ b/lang/serendipity_lang_ko.inc.php @@ -668,3 +668,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_nl.inc.php b/lang/serendipity_lang_nl.inc.php index cd76b80..0ade876 100644 --- a/lang/serendipity_lang_nl.inc.php +++ b/lang/serendipity_lang_nl.inc.php @@ -668,3 +668,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_no.inc.php b/lang/serendipity_lang_no.inc.php index c543365..51651ac 100644 --- a/lang/serendipity_lang_no.inc.php +++ b/lang/serendipity_lang_no.inc.php @@ -667,3 +667,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_pt.inc.php b/lang/serendipity_lang_pt.inc.php index 46a6479..ee2667f 100644 --- a/lang/serendipity_lang_pt.inc.php +++ b/lang/serendipity_lang_pt.inc.php @@ -667,3 +667,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_ro.inc.php b/lang/serendipity_lang_ro.inc.php index f8ad4b4..e64d9c5 100644 --- a/lang/serendipity_lang_ro.inc.php +++ b/lang/serendipity_lang_ro.inc.php @@ -665,3 +665,5 @@ @define('DELETE_HOTLINK_FILE', 'Am şters fişierul legat direct cu numele %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Arată adresele de email?'); @define('IMAGE_MORE_INPUT', 'Add more images'); // Translate +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_ru.inc.php b/lang/serendipity_lang_ru.inc.php index cd188ba..65d1b74 100644 --- a/lang/serendipity_lang_ru.inc.php +++ b/lang/serendipity_lang_ru.inc.php @@ -667,3 +667,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_tn.inc.php b/lang/serendipity_lang_tn.inc.php index 57ba8ad..c87ca46 100644 --- a/lang/serendipity_lang_tn.inc.php +++ b/lang/serendipity_lang_tn.inc.php @@ -665,3 +665,5 @@ @define('FETCH_METHOD_HOTLINK', '盜連到主機'); @define('DELETE_HOTLINK_FILE', '刪除盜連的檔案 %s'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', '顯示電子郵件嗎?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_tw.inc.php b/lang/serendipity_lang_tw.inc.php index d3bc6cd..5262df4 100644 --- a/lang/serendipity_lang_tw.inc.php +++ b/lang/serendipity_lang_tw.inc.php @@ -665,3 +665,5 @@ @define('FETCH_METHOD_HOTLINK', 'µs³s¨ì¥D¾÷'); @define('DELETE_HOTLINK_FILE', '§R°£µs³sªºÀÉ®× %s'); @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Åã¥Ü¹q¤l¶l¥ó¶Ü?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.'); diff --git a/lang/serendipity_lang_zh.inc.php b/lang/serendipity_lang_zh.inc.php index 14bd584..07da4a6 100644 --- a/lang/serendipity_lang_zh.inc.php +++ b/lang/serendipity_lang_zh.inc.php @@ -665,3 +665,5 @@ @define('FETCH_METHOD_HOTLINK', 'Hotlink to server'); // Translate @define('DELETE_HOTLINK_FILE', 'Deleted the hotlinked file entitled %s'); // Translate @define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Show E-Mail addresses?'); +@define('INSTALL_BLOG_EMAIL', 'Blog\'s E-Mail address'); +@define('INSTALL_BLOG_EMAIL_DESC', 'This configures the E-Mail address that is used as the "From"-Part of outgoing mails. Be sure to set this to an address that is recognized by the mailserver used on your host - many mailservers reject messages that have unknown From-addresses.');