Exemplo n.º 1
0
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
}
Exemplo n.º 2
0
func Login(c *imap.Client, user, pass string) (cmd *imap.Command, err error) {
	defer c.SetLogMask(Sensitive(c, "LOGIN"))
	return c.Login(user, pass)
}
Exemplo n.º 3
0
// login send LOGIN imap command
func login(client *imap.Client, user string, password string) (*imap.Command, error) {
	defer client.SetLogMask(sensitive(client, "LOGIN"))
	return client.Login(user, password)
}