dongshi9526 2014-12-09 15:01
浏览 39
已采纳

在imap中输入行太长错误

I'm downloading emails by go-imap. And today I received this error:

 imap: line too long ("* SEARCH 45081 45082 45083 45084 45085 45086 45087 45088 45089 45090 45091 45092 45093 45094 45095 45096 45097 45098 45099 45100 45101 45102 45103 45104 45105 45106 45107 45108 45109 45110 45111 45112 45113 45114 45115 45116 45117 45118 45119 45120 45121 45122 45123 45124 45125 45126 45127 45128 45129 45130 45131 45132 45133 45134 45135 45136 45137 45138 45139 45140 45141 45142 45143 45144 45145 45146 45147 45148 45149 45150 45151 45152 45153 45154 45155 45156 45157 45158 45159 45160 45161 45162 45163 45164 45165 45166 45167 45168 45169 45170 45171 45172 45173 45174 45175 45176 45177 45178 45179 45180 45181 45182 45183 45184 45185 45186 45187 45188 45189 45190 45191 45192 45193 45194 45195 45196 45197 45198 45199 45200 45201 45202 45203 45204 45205 45206 45207 45208 45209 45210 45211 45212 45213 45214 45215 45216 45217 45218 45219 45220 45221 45222 45223 45224 45225 45226 45227 45228 45229 45230 45231 45232 45233 45234 45235 45236 45237 45238 45239 45240 45241 45242 45243 45244 45245 45246 45247 45248 45249 4"...)

near:

cmd = ReportOK(c.UIDSearch("1:* UNSEEN"))

and next error (after the above):

runtime error: index out of range

near:

set, _ := imap.NewSeqSet("")
set.AddNum(cmd.Data[0].SearchResults()...)

All my code after authentication and before parsing messages is heer:

if c.Caps["QUOTA"] {
   ReportOK(c.GetQuotaRoot("INBOX"))
}

cmd = ReportOK(c.List("", ""))

c.Select("INBOX", false)

cmd = ReportOK(c.UIDSearch("1:* UNSEEN"))

set, _ := imap.NewSeqSet("")
set.AddNum(cmd.Data[0].SearchResults()...)

cmd, _ = c.UIDFetch(set, "RFC822", "RFC822.HEADER", "UID")

Can anyone help? I will be grateful.

  • 写回答

1条回答 默认 最新

  • dongxin8709 2014-12-09 15:07
    关注

    You seem to be surpassing the buffer size here, here is a note from the package's docs :

    var BufferSize = 65536

    BufferSize sets the size of the send and receive buffers (in bytes). This is also the length limit of physical lines. In practice, the client should restrict line length to approximately 1000 bytes, as described in RFC 2683.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助