305
296
if(!mailConnect(host, a->inport, a->inssl))
306
297
showErrorAbort();
307
if(!serverGetLine(a->inssl))
308
299
showErrorAbort();
309
300
if(memcmp(serverLine, "+OK ", 4))
310
301
i_printfExit(MSG_BadPopIntro, serverLine);
311
302
sprintf(serverLine, "user %s%s", login, eol);
312
serverPutGet(serverLine, a->inssl);
303
mailPutGetError(serverLine);
313
304
if(pass) { /* I think this is always required */
314
305
sprintf(serverLine, "pass %s%s", pass, eol);
315
serverPutGet(serverLine, a->inssl);
306
mailPutGetError(serverLine);
317
308
if(memcmp(serverLine, "+OK", 3))
318
309
i_printfExit(MSG_PopNotComplete, serverLine);
320
311
/* How many mail messages? */
321
serverPutGet("stat\r\n", a->inssl);
312
mailPutGetError("stat\r\n");
322
313
if(memcmp(serverLine, "+OK ", 4))
323
314
i_printfExit(MSG_NoStatusMailBox, serverLine);
324
315
nmsgs = atoi(serverLine + 4);
326
317
i_puts(MSG_NoMail);
327
serverClose(a->inssl);
371
362
cxSwitch(1, false);
372
363
/* Now grab the entire message */
373
364
sprintf(serverLine, "retr %d%s", m, eol);
374
if(!serverPutLine(serverLine, a->inssl))
365
if(!mailPutLine(serverLine, false))
375
366
showErrorAbort();
421
/* get rid of the dos returns */
412
/* get rid of the dos returns, and dot strip */
422
413
for(j = k = 0; j < exact_l; ++j) {
414
if(!j && exact[j] == '.')
416
if(j && exact[j] == '.' && exact[j - 1] == '\n')
423
418
if(exact[j] == '\r' && j < exact_l - 1 && exact[j + 1] == '\n')
425
420
exact[k++] = exact[j];
468
463
} else if(!nattach && /* drop empty mail message */
470
(lastMailInfo->subject != 0) -
471
(lastMailInfo->from != 0) -
472
(lastMailInfo->reply != 0) <= 1) {
465
(strlen(lastMailInfo->subject) != 0) -
466
(strlen(lastMailInfo->from) != 0) -
467
(strlen(lastMailInfo->reply) != 0) <= 1) {
474
469
i_puts(MSG_Empty);
628
623
* So if you didn't mean to delete, type x to exit abruptly,
629
624
* then fetch your mail again. */
630
625
sprintf(serverLine, "dele %d%s", m, eol);
631
if(!serverPutLine(serverLine, a->inssl))
626
if(!mailPutLine(serverLine, false))
632
627
showErrorAbort();
633
if(!serverGetLine(a->inssl))
634
629
i_printfExit(MSG_MailTimeOver);
635
630
if(memcmp(serverLine, "+OK", 3))
636
631
i_printfExit(MSG_UnableDelMail, serverLine);
1889
1889
/* delete the lines we don't need */
1890
for(j = 6; j >= 1; --j) {
1891
if(!strchr("wfta", linetype[j]))
1891
for(--j; j >= 1; --j) {
1892
if(strchr("srv", linetype[j]))
1894
1895
strcpy(linetype + j, linetype + j + 1);
1897
1898
/* move reply to 1, if it isn't already there */
1898
if(linetype[1] != 'r') {
1899
repln = strchr(linetype, 'r') - linetype;
1900
subln = strchr(linetype, 's') - linetype;
1899
1902
char *map = cw->map;
1900
1903
char swap[LNWIDTH];
1901
1904
char *q1 = map + LNWIDTH;
1902
char *q2 = map + LNWIDTH * 2;
1905
char *q2 = map + LNWIDTH * repln;
1906
memcpy(swap, q1, LNWIDTH);
1907
memcpy(q1, q2, LNWIDTH);
1908
memcpy(q2, swap, LNWIDTH);
1914
j = strlen(linetype) - 1;
1916
char *map = cw->map;
1918
char *q1 = map + LNWIDTH * j;
1919
char *q2 = map + LNWIDTH * subln;
1903
1920
memcpy(swap, q1, LNWIDTH);
1904
1921
memcpy(q1, q2, LNWIDTH);
1905
1922
memcpy(q2, swap, LNWIDTH);
1945
1962
if(t[1] == '>') {
1946
1963
i_puts(MSG_ReNoID);
1948
stringAndString(&out, &j, "references: <");
1965
stringAndString(&out, &j, "References: <");
1949
1966
if(*s != '>') {
1950
1967
stringAndBytes(&out, &j, s, t - s);
1951
1968
stringAndString(&out, &j, "> <");