ページが更新されたときにメールで通知している機能を愛用しているのですが、このときリモートホストのアドレスをみて、指定されたホストから更新された場合はメールを送信しない機能を追加してみました。
自分で管理しているサイトを自分で更新したときは、メールでの通知が不要な場合などは便利だと思います。
--- file.php~ 2003-12-20 10:36:06.000000000 +0900 +++ file.php 2003-12-27 12:20:58.728482785 +0900 @@ -94,7 +94,8 @@ { global $post,$update_exec; global $_msg_invalidiwn; - global $notify,$notify_diff_only,$notify_to,$notify_from,$notify_subject,$notify_header; + global $notify,$notify_diff_only,$notify_exclude; + global $notify_to,$notify_from,$notify_subject,$notify_header; global $smtp_server,$smtp_auth; if (!is_pagename($page)) @@ -148,6 +149,16 @@ system($update_exec.' > /dev/null &'); } + // notify_excludeにアドレスが一致する場合はメールを送信しない + foreach ($notify_exclude as $exclude) { + $exclude = preg_quote($exclude); + if (substr($exclude, -1) == ".") + $exclude = $exclude . "*"; + if (preg_match("/^" . $exclude . "/", $_SERVER["REMOTE_ADDR"])) + return; + } + + // メールの送信 if ($notify and $dir == DIFF_DIR) { if ($notify_diff_only)
--- pukiwiki.ini.php~ 2003-12-20 10:41:13.000000000 +0900 +++ pukiwiki.ini.php 2003-12-27 12:18:40.583775271 +0900 @@ -249,6 +249,10 @@ $pop_userid = ''; // POP パスワード $pop_passwd = ''; +// 以下で指定したリモートホストから更新された場合はメールを送信しない +$notify_exclude = array( +// '192.168.0.', +); ///////////////////////////////////////////////// // 一覧・更新一覧に含めないページ名(正規表現で)