Quote:
Any ideas on why this keeps putting the same email in the window multiple times? I currently have one email on the server that I sent myself, and I put the %retr variable in to stop it from doing it multiple times, but it still repeats. I'm also getting an "aline invalid parameters" message repeatedly in the status window. Thanks.
Code:
on 1:sockread:mail:{
  window @mail
  if ($sockerr) {
    echo -a Error.
    halt
  }  
  else {
    var %temptext
    sockread %temptext
    [color:red]while (%auth != 1) {[/color]
      sockwrite -n $sockname user User
      sockwrite -n $sockname pass Password | set  [color:red]%auth 1[/color]
      sockwrite -n $sockname list
    }  
  }
  [color:red] unset %auth[/color]
  while (%retr != 1) {
    sockwrite -n $sockname retr 1 
[color:red]    set %retr 1
  }
  unset %retr[/color]
  aline @mail %temptext
}


you set then right away unset your %vars that are used to check whether or not the script should do that, so every time the sockread fires it logs in, unsets the var then retrieves then unsets that var. put the Unsets in a sockclose event to start with, see what you get then.

on *:sockclose:mail:{
unset %retr
unset %auth
}