Publicada por gabrielvivian em 18/05/2007 - 11:16h:
* gabrielvivian usa Slackware

Estou unsando o squid com autenticacao d usuario no pop com o popauth.py ele ta pedindo o usurio e tudo certo, mas tenho q ficar digitando o e-mail completo XXX@XXXX.XXX.XXX teria como configurar para mim estar digitando apenas XXX sem o @XXXX.XXX.XXX abaixo estou mandando o script do popauth.py, abraco agradeco desde ja.
------------------------------------------------------------------------------------
#!/usr/bin/env python

from poplib import POP3
import sys


#POP server against which we authenticate
server="XXX.XX.XXX.XXX"
#Port number for POP server. Usually 110
port=110


#Below here you shouldn't need to edit anything

while 1:

#Read user and password from stdin, remove the newline, split at the space
#and assign to the user and password variables

line=sys.stdin.readline()[:-1]
[user,password]=line.split()

#Connect to the POP server

p=POP3(server,port)

#Try to authenticate. If it doesn't work, it throws an exception

try:
p.user(user)
p.pass_(password)
except:

#If it threw an exception, log in cache.log the ayth booboo
sys.stderr.write("ERR authenticating %sn"%user)
#Then deny access
sys.stdout.write("ERRn")
#IMPORTANT!!!!!!!!!!!! Flush stdout
sys.stdout.flush()
continue


#If it didn't throw exceptions, that means it authenticated

#Log success to cache.log
sys.stderr.write("OK authenticated %sn"%user)
#Then allow access
sys.stdout.write("OKn")
sys.stdout.flush()
------------------------------------------------------------------------------------


  
Nenhuma resposta encontrada.
  


ATENÇÃO: Antes de contribuir com uma resposta, leia o artigo Qualidade de respostas e certifique-se de que esteja realmente contribuindo com a comunidade. Muitas vezes o ímpeto de contribuir nos leva a atrapalhar ao invés de ajudar.

Contribuir com resposta



CAPTCHA
[ Recarregar imagem ]

Digite o código acima:

  
* Nota: só é possível enviar respostas usuário que possui conta e esteja logado com ela, caso contrário sua mensagem será perdida.