SysOp IRC Services — File Browser

SysOpIRCServicesv0.1 / SysOpIRCServicesv0.1 / system / mail.mrc

mail.mrc — 7.81 KB — Download this file

; Copying or editing of any of the scripts included in this module is strictly prohibited, you may distribute the package
; in its entireity un edited in any form. Support can only be given to those who do not edit these files please do not ask
; if you plan to edit them yourself. Credits and links back to us must remain in the script we do not advertise using your
; network unless the .VERSION command is triggered. You must also agree when connecting the service to any IRC net
; that you have the correct permission to connect the service, you MUST NOT connect the service to Digi-Net and you
; connect the service at your own risk. For support see http://www.digi-net.org

on *:SOCKCLOSE:sendmail:{
  if ($var(sendmailc*,0) > 0) { unset %sendmail* } 
}
alias send_mail {
  writeini -n mail.ini sendmail address $readnick($1,email)
  writeini -n mail.ini sendmail nick $1
  writeini -n mail.ini sendmail type $2
  sockopen sendmail $netconf(system,smtp) 25
  set %sendmailc 1
}
alias send_newmail {
  writeini -n mail.ini sendmail address $readnick($1,newemail)
  writeini -n mail.ini sendmail nick $1
  writeini -n mail.ini sendmail type $2
  sockopen sendnewmail $netconf(system,smtp) 25
  set %sendmailc 1
}
on *:SOCKREAD:sendmail:{
  sockread %sendmail
  tokenize 32 %sendmail
  echo - $1-
  if ($1 == 551) {  unset %sendmail* | sockclose sendmail }
  elseif ($1 == 501) { unset %sendmail* | sockclose sendmail }
  elseif (($1 == 220) && (%sendmailc == 1)) { report Mail Socket Open (Sending $readini(mail.ini,sendmail,type) message to $readini(mail.ini,sendmail,address) $+ ) | sockwrite -n sendmail HELO dsendmail | inc %sendmailc }
  elseif (($1 == 250) && (%sendmailc == 2)) { sockwrite -n sendmail MAIL FROM: < $+ $netconf(emails,services) $+ > | inc %sendmailc }
  elseif (($1 == 250) && (%sendmailc == 3)) { sockwrite -n sendmail RCPT TO: < $+ $readini(mail.ini,sendmail,address) $+ > | inc %sendmailc }
  elseif (($1 == 250) && (%sendmailc == 4)) { sockwrite -n sendmail DATA | inc %sendmailc }
  elseif (($1 == 250) && (%sendmailc == 5)) { sockwrite -n sendmail QUIT }
  elseif ($1 == 354) {
    if ($readini(mail.ini,sendmail,type) == newuser) {
      sockwrite -n sendmail From: "SysOp Services" < $+ $netconf(emails,services) $+ >
      sockwrite -n sendmail To: $readini(mail.ini,sendmail,address)
      sockwrite -n sendmail Subject: SysOp Services Nickname Registration
      sockwrite -n sendmail Date: $asctime
      sockwrite -n sendmail
      sockwrite -n sendmail Congratulations, You have successfully registered to SysOP
      sockwrite -n sendmail Services with the following information:
      sockwrite -n sendmail 
      sockwrite -n sendmail Nickname: $readini(mail.ini,sendmail,nick)
      sockwrite -n sendmail Pass: $decode($readnick($readini(mail.ini,sendmail,nick),password),m)
      sockwrite -n sendmail E-Mail: $readnick($readini(mail.ini,sendmail,nick),email))
      sockwrite -n sendmail Host: $readnick($readini(mail.ini,sendmail,nick),lasthost))
      sockwrite -n sendmail 
      sockwrite -n sendmail 
      sockwrite -n sendmail To activate this account and make full use of its features
      sockwrite -n sendmail please type /msg $netconf(system,nickname) TAC $readnick($readini(mail.ini,sendmail,nick),tac))
      sockwrite -n sendmail 
      sockwrite -n sendmail If you have any questions on SysOp Services please
      sockwrite -n sendmail see a helper in $netconf(system,helpchan)
      sockwrite -n sendmail 
      sockwrite -n sendmail If you have recieved this email in error, please disregard it
      sockwrite -n sendmail 
      sockwrite -n sendmail Thank you for using SysOp Services
      sockwrite -n sendmail .
    }
    if ($readini(mail.ini,sendmail,type) == forgotpass) {
      sockwrite -n sendmail From: "SysOp Services" < $+ $netconf(emails,services) $+ >
      sockwrite -n sendmail To: $readini(mail.ini,sendmail,address)
      sockwrite -n sendmail Subject: SysOp Password Request
      sockwrite -n sendmail Date: $asctime
      sockwrite -n sendmail
      sockwrite -n sendmail Your Password was requested on IRC
      sockwrite -n sendmail IDENTIFY with the following information:
      sockwrite -n sendmail 
      sockwrite -n sendmail Nickname: $readini(mail.ini,sendmail,nick)
      sockwrite -n sendmail Pass: $decode($readnick($readini(mail.ini,sendmail,nick),password),m)
      sockwrite -n sendmail E-Mail: $readnick($readini(mail.ini,sendmail,nick),email))
      sockwrite -n sendmail Host: $readnick($readini(mail.ini,sendmail,nick),lasthost))
      sockwrite -n sendmail 
      sockwrite -n sendmail 
      sockwrite -n sendmail To login to your account >
      sockwrite -n sendmail please type /msg $netconf(system,nickname) IDENTIFY $decode($readnick($readini(mail.ini,sendmail,nick),password),m)
      sockwrite -n sendmail 
      sockwrite -n sendmail If you have any questions on SysOp Services please
      sockwrite -n sendmail see a helper in $netconf(system,helpchan)
      sockwrite -n sendmail 
      sockwrite -n sendmail If you have recieved this email in error, please disregard it
      sockwrite -n sendmail 
      sockwrite -n sendmail Thank you for using SysOp Services
      sockwrite -n sendmail .
    }

  }
  elseif ($1 == 221) { report Mail Socket Closed |  unset %sendmail* }
}
on *:SOCKREAD:sendnewmail:{
  sockread %sendmail
  tokenize 32 %sendmail
  echo - $1-
  if ($1 == 551) {  unset %sendmail* | sockclose sendnewmail }
  elseif ($1 == 501) { unset %sendmail* | sockclose sendnewmail }
  elseif (($1 == 220) && (%sendmailc == 1)) { report Mail Socket Open (Sending $readini(mail.ini,sendmail,type) message to $readini(mail.ini,sendmail,address) $+ ) | sockwrite -n sendnewmail HELO dsendmail | inc %sendmailc }
  elseif (($1 == 250) && (%sendmailc == 2)) { sockwrite -n sendnewmail MAIL FROM: < $+ $netconf(emails,services) $+ > | inc %sendmailc }
  elseif (($1 == 250) && (%sendmailc == 3)) { sockwrite -n sendnewmail RCPT TO: < $+ $readini(mail.ini,sendmail,address) $+ > | inc %sendmailc }
  elseif (($1 == 250) && (%sendmailc == 4)) { sockwrite -n sendnewmail DATA | inc %sendmailc }
  elseif (($1 == 250) && (%sendmailc == 5)) { sockwrite -n sendnewmail QUIT }
  elseif ($1 == 354) {
    if ($readini(mail.ini,sendmail,type) == newemail) {
      sockwrite -n sendnewmail From: "SysOp Services" < $+ $netconf(emails,services) $+ >
      sockwrite -n sendnewmail To: $readini(mail.ini,sendmail,address)
      sockwrite -n sendnewmail Subject: SysOp Services Edit Email Verification
      sockwrite -n sendnewmail Date: $asctime
      sockwrite -n sendnewmail
      sockwrite -n sendnewmail Almost Done, To change your email address please login to IRC and IDENTIFY
      sockwrite -n sendnewmail Take Note of the following information:
      sockwrite -n sendnewmail 
      sockwrite -n sendnewmail Nickname: $readini(mail.ini,sendmail,nick)
      sockwrite -n sendnewmail NEW E-Mail: $readnick($readini(mail.ini,sendmail,nick),newemail))
      sockwrite -n sendnewmail Host: $readnick($readini(mail.ini,sendmail,nick),lasthost))
      sockwrite -n sendnewmail 
      sockwrite -n sendnewmail 
      sockwrite -n sendnewmail To activate this new email >
      sockwrite -n sendnewmail please type /msg $netconf(system,nickname) EDITEMAIL <password> VERIFY $readnick($readini(mail.ini,sendmail,nick),tac))
      sockwrite -n sendnewmail 
      sockwrite -n sendnewmail If you have any questions on SysOP Services please
      sockwrite -n sendnewmail see a helper in $netconf(system,helpchan)
      sockwrite -n sendnewmail 
      sockwrite -n sendnewmail If you have recieved this email in error, please disregard it
      sockwrite -n sendnewmail 
      sockwrite -n sendnewmail Thank you for using SysOp Services
      sockwrite -n sendnewmail .
    }
  }
  elseif ($1 == 221) { report Mail Socket Closed |  unset %sendmail* }
}