|
|
@@ -67,6 +67,8 @@ func (a action) Capa(session *gopop.Session) ([]string, error) {
|
|
|
ret = append(ret, "STLS")
|
|
|
}
|
|
|
|
|
|
+ log.WithContext(session.Ctx).Debugf("CAPA \n %+v", ret)
|
|
|
+
|
|
|
return ret, nil
|
|
|
}
|
|
|
|
|
|
@@ -175,6 +177,7 @@ func (a action) Uidl(session *gopop.Session, msg string) ([]gopop.UidlItem, erro
|
|
|
|
|
|
reqId := cast.ToInt64(msg)
|
|
|
if reqId > 0 {
|
|
|
+ log.WithContext(session.Ctx).Debugf("Uidl \n %+v", reqId)
|
|
|
return []gopop.UidlItem{
|
|
|
{
|
|
|
Id: reqId,
|
|
|
@@ -199,6 +202,8 @@ func (a action) Uidl(session *gopop.Session, msg string) ([]gopop.UidlItem, erro
|
|
|
UnionId: cast.ToString(re.Id),
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ log.WithContext(session.Ctx).Debugf("Uidl \n %+v", ret)
|
|
|
return ret, nil
|
|
|
}
|
|
|
|
|
|
@@ -224,17 +229,25 @@ func (a action) List(session *gopop.Session, msg string) ([]gopop.MailInfo, erro
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
- res = append(res, listItem{
|
|
|
+ item := listItem{
|
|
|
Id: cast.ToInt64(info.Id),
|
|
|
Size: cast.ToInt64(info.Size),
|
|
|
- })
|
|
|
+ }
|
|
|
+ if item.Size == 0 {
|
|
|
+ item.Size = 9999
|
|
|
+ }
|
|
|
+ res = append(res, item)
|
|
|
} else {
|
|
|
emailList, _ := list.GetEmailList(session.Ctx.(*context.Context), dto.SearchTag{Type: consts.EmailTypeReceive, Status: -1, GroupId: -1}, "", true, 0, 99999)
|
|
|
for _, info := range emailList {
|
|
|
- res = append(res, listItem{
|
|
|
+ item := listItem{
|
|
|
Id: cast.ToInt64(info.Id),
|
|
|
Size: cast.ToInt64(info.Size),
|
|
|
- })
|
|
|
+ }
|
|
|
+ if item.Size == 0 {
|
|
|
+ item.Size = 9999
|
|
|
+ }
|
|
|
+ res = append(res, item)
|
|
|
}
|
|
|
}
|
|
|
ret := []gopop.MailInfo{}
|
|
|
@@ -244,6 +257,8 @@ func (a action) List(session *gopop.Session, msg string) ([]gopop.MailInfo, erro
|
|
|
Size: re.Size,
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ log.WithContext(session.Ctx).Debugf("List \n %+v", ret)
|
|
|
return ret, nil
|
|
|
}
|
|
|
|
|
|
@@ -257,6 +272,7 @@ func (a action) Retr(session *gopop.Session, id int64) (string, int64, error) {
|
|
|
}
|
|
|
|
|
|
ret := email.ToTransObj().BuildBytes(session.Ctx.(*context.Context), false)
|
|
|
+ log.WithContext(session.Ctx).Debugf("Retr \n %+v", string(ret))
|
|
|
return string(ret), cast.ToInt64(len(ret)), nil
|
|
|
|
|
|
}
|
|
|
@@ -297,7 +313,9 @@ func (a action) Top(session *gopop.Session, id int64, n int) (string, error) {
|
|
|
return string(ret), nil
|
|
|
}
|
|
|
|
|
|
- return array.Join(res[0:headerEndLine+n+1], "\n"), nil
|
|
|
+ lines := array.Join(res[0:headerEndLine+n+1], "\n")
|
|
|
+ log.WithContext(session.Ctx).Debugf("Top \n %+v", lines)
|
|
|
+ return lines, nil
|
|
|
|
|
|
}
|
|
|
|