Giriş

Orijinalini görmek için tıklayınız : Sunucudaki Kayıtlı Nicklere Mail Gönderme TCL


No_FeaR
24 Eylül 2015, 00:35
• Kullanım:

• Tek bir adrese mail göndermek için: !mail send mail@adres.com mesaj
• Sunucudaki kayıtlı nicklerin hepsine mail göndermek için: !mail herkes mesajınız.

bind pub - "$mail(trigger)" email

proc email { nickname hostname handle channel arguments } {
global mail admin_chan
if {($channel != $admin_chan)} { return }
if {[string equal -nocase "" $arguments]} {
putquick "privmsg $channel :Lütfen: $mail(trigger) \037help\037 yazınız."
} elseif {[string equal -nocase "help" $arguments]} {
putquick "privmsg $channel :\037Kullanım\037\002:\002"
putquick "privmsg $channel :\002Tek bir adrese mail göndermek için:\002"
putquick "privmsg $channel :$mail(trigger) \037send\037 \037mail@adres.com\037 \037mesaj\037"
putquick "privmsg $channel :\002Sunucudaki kayıtlı nicklerin hepsine mail göndermek için:\002"
putquick "privmsg $channel :$mail(trigger) \037herkes\037 \037mesajınız\037"
} elseif {[string equal -nocase "herkes" [lindex $arguments 0]]} {
if {[string match -nocase "" [lindex [split $arguments] 2]]} {
putquick "privmsg $channel :\037\0034Hata\003\037\002:\002 Yanlış Kullanım.."
putquick "privmsg $channel :\037Kullanım\037\002:\002"
putquick "privmsg $channel :\002Sunucudaki kayıtlı nicklerin hepsine mail göndermek için:\002"
putquick "privmsg $channel :$mail(trigger) \037herkes\037 \037mesajınız\037"
return
}
deneyelim $nickname $hostname $handle $channel $arguments
return
} elseif {[string match -nocase "send*" $arguments]} {
if {[string match -nocase "" [lindex [split $arguments] 2]]} {
putquick "privmsg $channel :\037\0034Hata\003\037\002:\002 Yanlış Kullanım.."
putquick "privmsg $channel :\037Kullanım\037\002:\002"
putquick "privmsg $channel :\002Tek bir adrese mail göndermek için:\002"
putquick "privmsg $channel :$mail(trigger) \037send\037 \037mail@adres.com\037 \037mesaj\037"
} elseif {![string match -nocase "*@*" [lindex [split $arguments] 1]]} {
putquick "privmsg $channel :\037\0034Hata\003\037\002:\002 Yanlış Kullanım."
putquick "privmsg $channel :\037Kullanım:\037\002:\002"
putquick "privmsg $channel :$mail(trigger) \037send\037 \037mail@adres.com\037 \037mesaj\037"
} else {
set email [open "| /usr/sbin/sendmail -f $mail(address) -t" "w"];
puts $email "To: [lindex [split $arguments] 1]";
puts $email "Subject: $mail(subject)";
puts $email "From: $mail(address)";
puts $email "[join [lrange [split $arguments] 2 end]]";
puts $email "";
puts $email "----------";
puts $email "";
puts $email "$mail(signature)";
close $email;
putquick "privmsg $channel :Emailiniz \037[lindex [split $arguments] 1]\037 adresine başarıyla gönderilmiştir."
putquick "privmsg $channel :\037Mesajınız\037\002:\002 [join [lrange [split $arguments] 2 end]]"
}
} else {
putquick "privmsg $channel :\037Kullanım\037\002:\002"
putquick "privmsg $channel :\002Tek bir adrese mail göndermek için:\002"
putquick "privmsg $channel :$mail(trigger) \037send\037 \037mail@adres.com\037 \037mesaj\037"
putquick "privmsg $channel :\002Sunucudaki kayıtlı nicklerin hepsine mail göndermek için:\002"
putquick "privmsg $channel :$mail(trigger) \037herkes\037 \037mesajınız\037"
}
}

proc hava:temiz {html} {
regsub -all {\n} $html {} html
regsub -all {\t} $html {} html
regsub -all { } $html {} html
regsub -all {\u015E} $html {Ş} html
regsub -all {\u015F} $html {ş} html
regsub -all {\u011F} $html {ğ} html
regsub -all {\u011E} $html {Ğ} html
regsub -all {\u0131} $html {ı} html
regsub -all {\u0130} $html {İ} html
regsub -all {Ç} $html {C} html
return $html
}

proc deneyelim {nick uhost hand chan arg} {
global mail
set konu [join [lrange [split $arg] 1 end]]
set x [open /home/ircblan/ircservices/lib/nick.db r]
set y [read $x]
hava:temiz $y
regsub -all {@} $y {etisareti} y
regsub -all {\.} $y {nononokta} y
regsub -all {\-} $y {tiretire} y
regsub -all {_} $y {yerdentire} y
regsub -all {[^A-Z,^a-z,^0-9]} $y { } y
regsub -all {\\001} $y {} y
regsub -all {etisareti} $y {@} y
regsub -all {nononokta} $y {\.} y
regsub -all {tiretire} $y {-} y
regsub -all {yerdentire} $y {_} y
putquick "privmsg #Opers :\002SUNUCUDAKİ KAYITLI NİCKLERE MAİLİNİZ GÖNDERİLİYOR..."
set count 0
foreach m $y {
if {[regexp -- {[0-9a-z_\.-]+@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+[a-z]{2,3}} $m]} {
if {[llength [split [lindex [split $m @] 1] .]] < 4} {
set email [open "| /usr/sbin/sendmail -f $mail(address) -t" "w"];
puts $email "To: $m";
puts $email "Subject: $mail(subject)";
puts $email "From: $mail(address)";
puts $email "$konu";
puts $email "";
puts $email "----------";
puts $email "";
puts $email "$mail(signature)";
close $email;
incr count
}
}

}
putquick "privmsg $chan :Emailiniz toplam \002$count\002 Tane Adrese Başarıyla Gönderilmiştir."
putquick "privmsg $chan :\037Mesajınız\037\002:\002 $konu"
}

Alıntıdır...