示例#1
0
文件: init.go 项目: yanue/go-webmail
func Sensitive(c *imap.Client, action string) imap.LogMask {
	mask := c.SetLogMask(imap.LogConn)
	hide := imap.LogCmd | imap.LogRaw
	if mask&hide != 0 {
		c.Logln(imap.LogConn, "Raw logging disabled during", action)
	}
	c.SetLogMask(mask &^ hide)
	return mask
}
示例#2
0
文件: init.go 项目: yanue/go-webmail
func Login(c *imap.Client, user, pass string) (err error) {
	defer c.SetLogMask(Sensitive(c, "LOGIN"))
	cmd, err = c.Login(user, pass)
	return err
}