IRCForumu.Net - Türkiye'nin IRC ve mIRC Kullanıcılarının Buluştuğu Forum

IRCForumu.Net - Türkiye'nin IRC ve mIRC Kullanıcılarının Buluştuğu Forum (https://www.ircforumu.net/)
-   TCL Scriptler (https://www.ircforumu.net/tcl-scriptler/)
-   -   Mail TCL (https://www.ircforumu.net/tcl-scriptler/2647-mail-tcl.html)

immortaL 29 Haziran 2016 18:26

Mail TCL
 
Kod:

set mail(trigger)  "!mail"
set mail(address)  "che@sohbettur.com"
set mail(subject)  "SohbetTur Grup Bilgilendirme"
set mail(signature) "© 2014 SohbetTur® Grup | https://www.ForumRuzgari.Com"
set mail(version)  "1.0.0.1"
set mail(author)    "Che"
set mail(author-i)  "SohbetTur Grup"
 
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"
}



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 16:55.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0
Copyright ©2005 - 2023 IRCForumu.Net - Tüm Hakları Saklıdır.