mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2006
Posts: 1
D
Mostly harmless
OP Offline
Mostly harmless
D
Joined: Apr 2006
Posts: 1
Is there a script out there would post convert an email into an IRC post in a chatroom? The scenario would look like this:

Someone emails to a designated email address.
The email is then posted into a designated chatroom.

Is there such a script or plugin?

Joined: Oct 2005
Posts: 126
Vogon poet
Offline
Vogon poet
Joined: Oct 2005
Posts: 126
No, i don't think there is. I think it's possible with using sockets, anyway, anyhow... But it doesn't exist.
-
I think it's possible to create, but wont be that easy.

Last edited by PhyxiuS; 06/04/06 10:07 AM.

If you mess with the best, u will die like the rest !
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Try this code:
Code:
alias popallow return [color:red]nickname1,nickname2,nickname3[/color]
alias popchan return [color:red]#mychan[/color]
;
;
on *:TEXT:!getmail:$($popchan):{
  if (!$istok($popallow,$nick,44)) return
  getmail [color:red]pop.mail.server.com 110 username password[/color]
}
on *:TEXT:!chkmail:$($popchan):{
  if (!$istok($popallow,$nick,44)) return
  chkmail [color:red]pop.mail.server.com 110 username password[/color]
}
alias popecho echo $1-
alias getmail {
  ;--------
  set %chkADDR $1
  set %chkPORT $2
  set %chkUSER $3
  set %chkPASS $4
  ;--------

  set %getmail.write 0
  set %getmail.state 1
  if ($sock(getmail)) sockclose getmail
  sockopen getmail %chkADDR %chkPORT
  .timer 1 5 sockclose getmail
}

on *:SOCKREAD:getmail:{
  var %s
  sockread %s
  tokenize 32 %s
  ;  popecho -st > $1-

  if (-ERR isin $1) {
    popecho 4 -st ERROR: $1-
    popecho 4 -st %getmail.state QUIT
    sockwrite -n $sockname QUIT
    ; set %getmail.state -1
  }
  elseif (%getmail.state < 0) {
    popecho 4 -st %getmail.state Done
    sockclose $sockname
  }
  elseif ((OK isin $1) && (!%getmail.write)) {
    if (%getmail.state == 1) {
      popecho 3 -st USER
      sockwrite -n $sockname USER %chkUSER
      inc %getmail.state
    }
    elseif (%getmail.state == 2) {
      popecho 3 -st PASS
      sockwrite -n $sockname PASS %chkPASS
      inc %getmail.state
    }
    elseif (%getmail.state == 3) {
      popecho 3 -st STAT
      sockwrite -n $sockname STAT
      inc %getmail.state
    }
    elseif (%getmail.state == 4) {
      popecho 12 -st $2 $iif($2 == 1,message,messages)
      if ($2 > 0) {
        set %getmail.count 1
        set %getmail.state 5
        set %getmail.num $2
        .remove mailget.tmp
        popecho 3 -a RETR %getmail.count
        sockwrite -n $sockname RETR %getmail.count
      }
      else {
        popecho 3 -st QUIT
        if ($me ison $popchan) msg $popchan GetMail: 0 messages
        sockwrite -n $sockname QUIT
        set %getmail.state 99
      }
    }
    elseif (%getmail.state == 5) {
      popecho 7 -st Receiving %getmail.count
      set %getmail.write 1
    }
    elseif (%getmail.state == 6) {
      if (%getmail.dele < %getmail.num) {
        inc %getmail.dele
        popecho 3 -st DELE %getmail.dele
        sockwrite -n $sockname DELE %getmail.dele
      }
      else {
        popecho 3 -st QUIT
        sockwrite -n $sockname QUIT
        set %getmail.state 99
      }
    }
    elseif (%getmail.state == 99) {
      popecho 3 -st DONE
      sockclose $sockname
      unset %getmail.*
    }
  }
  elseif (%getmail.state == 5) {
    if ($1- == .) {
      var %getmail.ticks = $ticks
      .rename mailget.tmp $+(%getmail.ticks,.txt)
      popecho 7 -st Received %getmail.count
      popecho 7 -st Saved as $+(%getmail.ticks,.txt)
      if ($me ison $popchan) play $+(%getmail.ticks,.txt) 500
      set %getmail.write 0
      if (%getmail.count < %getmail.num) {
        inc %getmail.count
        popecho 3 -st RETR %getmail.count
        sockwrite -n $sockname RETR %getmail.count
      }
      else {
        set %getmail.dele 1
        popecho 3 -st DELE 1
        sockwrite -n $sockname DELE 1
        set %getmail.state 6
      }
    }
    else {
      write mailget.tmp $iif($1,$1-,$crlf)
    }
  }
}
on *:PLAYEND:{
  popecho 6 -st Finished playing file $filename to $popchan
  .remove $filename
}
alias chkmail {
  ;----------
  set %chkmail.ADDR $1
  set %chkmail.PORT $2
  set %chkmail.USER $3
  set %chkmail.PASS $4
  ;----------
  set %chkmail.state 1
  if ($sock(checkmail)) sockclose checkmail
  sockopen checkmail %chkmail.ADDR %chkmail.PORT
}

on *:SOCKREAD:checkmail:{
  var %s
  sockread %s
  tokenize 32 %s
  ; popecho -s > $1-

  if (OK isin $1) {
    if (%chkmail.state == 1) {
      popecho 3 -st USER
      sockwrite -n $sockname USER %chkmail.USER
    }
    elseif (%chkmail.state == 2) {
      popecho 3 -st PASS
      sockwrite -n $sockname PASS %chkmail.PASS
    }
    elseif (%chkmail.state == 3) {
      popecho 3 -st STAT
      sockwrite -n $sockname STAT
    }
    elseif (%chkmail.state == 4) {
      ;;; Number of messages is stored in $2 at this point only
      popecho 12 -st $2 $iif($2 == 1,message,messages)
      if ($me ison $popchan) msg $popchan ChkMail: $2 $iif($2 == 1,message,messages)
      popecho 3 -st QUIT
      sockwrite -n $sockname QUIT
    }
    elseif (%chkmail.state == 5) {
      popecho 3 -st DONE
      sockclose $sockname
      unset %chkmail.*
    }
    elseif (%chkmail.state < 1) {
      popecho 4 -st DONE
      sockclose $sockname
      unset %chkmail.*
    }
    else {
      popecho 4 -st Incompatible response at state %chkmail.state
      popecho 4 -st Error: $1-
      sockwrite -n $sockname QUIT
      set %chkmail.state -1
    }

    inc %chkmail.state
  }
  else {
    popecho 4 -st Unknown response at state %chkmail.state
    popecho 4 -st Error: $1-
    sockwrite -n $sockname QUIT
    set %chkmail.state -1
  }
}


Set up the portions in red. Join the correct channel, and have someone type !chkmail or !getmail

-genius_at_work


Link Copied to Clipboard