alias mail {
set %email.username <hidden>
set %email.password <hidden>
sockopen mail mail.mysticirc.co.uk 80
}
on *:sockopen:mail: {
sockwrite -n $sockname GET $+(/mail/login.html?username=,%email.username,&password=,%email.password) HTTP/1.1
sockwrite -n $sockname Host: $+(mail.mysticirc.co.uk,$crlf,$crlf)
}
alias email.authenticate {
sockopen email.authenticate mail.mysticirc.co.uk 80
}
on *:sockread:mail: {
if ($sockerr) {
halt
}
else {
var %location
sockread %location
if (Location: isin %location) {
set %email.return $gettok(%location,2,61)
email.authenticate
}
}
}
on *:sockopen:email.authenticate: {
sockwrite -n $sockname GET $+(/mail/writemail.html?id=,%email.return) HTTP/1.1
sockwrite -n $sockname Host: $+(mail.mysticirc.co.uk,$crlf,$crlf)
}
on *:sockread:email.authenticate: {
if ($sockerr) {
halt
}
else {
var %email
sockread %email
if (<title>CYBUTEK WebMail Service (*) - Write Message</title> iswm %email) {
echo -a sockwrite -n email.authenticate POST $+(/mail/writeaction.html?id=,%email.return,&,writeto=,%email.address,&writesubject=,%email.subject,&writebody=,%email.message)
}
}
}