$value ) if( $value['eid'] == $eid ) return $value; return null; } function RecommendedEntry_updateIndexFile( $eid_updated, $eid, $direction ) { $filename = '/var/www/VirtualDomain/kenji00.com/blog/recommend_data'; is_dir( $filename ) || mkdir( $filename ); $filename .= '/'. substr( $eid_updated, -1 ); is_dir( $filename ) || mkdir( $filename ); $filename .= sprintf( '/%d.txt', $eid_updated); file_exists( $filename ) || touch( $filename ); $fp = @fopen( $filename, 'r+' ); if( $fp ) { if( flock( $fp, LOCK_EX | LOCK_NB )) { $ret = ''; $not_found = 1; while( !feof( $fp ) && ( $buf = fgets( $fp ))) { list( $_eid, $_n0, $_n1 ) = split( "[\t\r\n]", $buf ); if( $eid == $_eid ) { $not_found = 0; $direction ? $_n1++ : $_n0++; } $ret .= sprintf( "%d\t%d\t%d\n", $_eid, $_n0, $_n1 ); } if( $not_found ) $ret .= sprintf( "%d\t%d\t%d\n", $eid, 1 - $direction, $direction); rewind( $fp ); fwrite( $fp, $ret, strlen( $ret )); } fclose( $fp ); } } function RecommendedEntry_incoming() { $eid_prev = $_COOKIE['mtrcmnd_eid']; if( isset( $eid_prev )) { if( $eid_prev != 96 && RecommendedEntry_getEntryData( $eid_prev )) { RecommendedEntry_updateIndexFile( 96, $eid_prev, 0 /*incoming_from*/ ); RecommendedEntry_updateIndexFile( $eid_prev, 96, 1 /*outgoing_to*/ ); } } else { RecommendedEntry_updateIndexFile( 96, 96, 0 /*incoming_from*/ ); } } RecommendedEntry_incoming(); function RecommendedEntry_outgoing() { setcookie( 'mtrcmnd_eid', 96, time() + 2592000, '/' ); } RecommendedEntry_outgoing(); function RecommendedEntry_initialize( $mode = 0 ) { global $RecommendedEntry_table; $RecommendedEntry_table = array(); $filename = '/var/www/VirtualDomain/kenji00.com/blog/recommend_data/'. substr( '96', -1 ). '/96.txt'; $fp = @fopen( $filename, 'r' ); if( $fp ) { if( flock( $fp, LOCK_SH | LOCK_NB )) { while( !feof( $fp ) && ( $buf = fgets( $fp ))) { list( $_eid, $_n0, $_n1 ) = split( "[\t\r\n]", $buf ); if( 96 == $_eid ) continue; else if( $mode == 1 ) $RecommendedEntry_table{$_eid} = $_n0; else if( $mode == 2 ) $RecommendedEntry_table{$_eid} = $_n1; else $RecommendedEntry_table{$_eid} = $_n0 + $_n1; } arsort( $RecommendedEntry_table, SORT_NUMERIC ); } fclose( $fp ); } } function RecommendedEntry_GetEntry( $_index ) { global $RecommendedEntry_table; foreach( $RecommendedEntry_table as $eid => $count ) { if( --$_index ) continue; $entry = RecommendedEntry_getEntryData( $eid ); if( $entry ) $entry['count'] = $count; return $entry; } } ?> メモ:オープンリレーのテスト - 寝不足にて候(仮)
Jul
04
2007

メモ:オープンリレーのテスト

http://www.abuse.net/relay.html
単なるメモです。ハイ。

# 本当は、こういうのはdel.icio.usすればよいのでしょうが、出来れば手元で管理したい方なのです。
# Bookmarkみたいなローカル保存だと出先で使えず。かといって、ソレだけのためにpliggみたいなSBS構築するのも大仰ですし、なんか、こじんまりとしたヤツで良いツールないですかねぇ。

ホスト名指定とかで、下記のようなチェックが出来ます。
っつーか、コレなら自前で作れそうだな。

Mail relay testing

Connecting to blog.kenji00.com for anonymous test ...
<<< 220 www.kenji00.com ESMTP Sendmail 8.12.11.20060308/8.12.11; Wed, 4 Jul 2007 18:53:54 +0900
>>> HELO www.abuse.net
<<< 250 www.kenji00.com Hello www.abuse.net [208.31.42.77], pleased to meet you


Relay test 1
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test 2
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 553 5.5.4 ... Domain name required for sender address spamtest

Relay test 3
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:<>
<<< 250 2.1.0 <>... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test 4
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test 5
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test 6
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test 7
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test 8
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:<"securitytest@abuse.net">
<<< 550 5.7.1 <"securitytest@abuse.net">... Relaying denied

Relay test 9
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:<"securitytest%abuse.net">
<<< 550 5.7.1 <"securitytest%abuse.net">... Relaying denied

Relay test 10
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 553 5.1.3 ... Invalid route address

Relay test 11
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:<"securitytest@abuse.net"@kenji00.com>
<<< 550 5.7.1 <"securitytest@abuse.net"@kenji00.com>... Relaying denied

Relay test 12
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 553 5.1.3 ... Invalid route address

Relay test 13
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:<@kenji00.com:securitytest@abuse.net>
<<< 550 5.7.1 <@kenji00.com:securitytest@abuse.net>... Relaying denied

Relay test 14
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:<@[202.45.167.206]:securitytest@abuse.net>
<<< 550 5.7.1 <@[202.45.167.206]:securitytest@abuse.net>... Relaying denied

Relay test 15
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test 16
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test 17
>>> RSET
<<< 250 2.0.0 Reset state
>>> MAIL FROM:
<<< 250 2.1.0 ... Sender ok
>>> RCPT TO:
<<< 550 5.7.1 ... Relaying denied

Relay test result
All tests performed, no relays accepted.

このエントリを読んだ人はこんなんも読んでいます

トラックバック(0)

トラックバックURL: http://blog.kenji00.com/MT/mt-tb.cgi/95

コメントする

過去のエントリ(一覧)

Powered by Movable Type 4.261
Creative Commons License
このブログはクリエイティブ・コモンズでライセンスされています。