1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
# comment_mail_qmail.rb $Revision: 1.7 $
#
# qmailȤäƥĥåߤΤ餻
# ư롣
#
# Options:
# ̤Ǥ(ĥåߥϥץ饰):
# @options['comment_mail.enable']
# 뤫ɤꤹ롣true()false(ʤ)
# ̵false
# @options['comment_mail.header']
# Subject˻Ȥʸʬʤ褦˻ꤹ롣
# ºݤSubjectϡֻʸ:-1פΤ褦ˡդȥֹ椬
# դʸˡ%³ѻä硢
# եեޥåȻʤĤޤաפʬ
# ưŪղäʤʤ(ֹղä)
# ̵ˤ϶ʸ
# @options['comment_mail.receivers']
# 륢ɥ쥹ʸޤǶڤäʣǤ롣
# ̵ˤɮԤΥɥ쥹ˤʤ롣
#
# tdiary.confǤΤǤ:
# @options['comment_mail.qmail']
# qmail_injectޥɤΥѥꤹ롣
# ̵ˤϡ'/var/qmail/bin/qmail-inject'ס
#
# Copyright (c) 2003 TADA Tadashi <sho@spc.gr.jp>
# You can distribute this file under the GPL.
#
def comment_mail( text, to )
begin
qmail = @conf['comment_mail.qmail'] || '/var/qmail/bin/qmail-inject'
open( "|#{qmail} -f #{@conf.author_mail.untaint} #{to.join(' ')}", 'w' ) do |o|
o.write( text )
end
rescue
$stderr.puts $!
end
end
add_update_proc do
comment_mail_send if @mode =~ /^(comment|trackbackreceive)$/
end
add_conf_proc( 'comment_mail', comment_mail_conf_label ) do
comment_mail_basic_setting
comment_mail_basic_html
end
|