Reimplement POP3 I/O over the DOT and CRLFDOT filters.
As a side note, previous versions of pop3d did not do byte-stuffing when sending RETR output. This commit fixes it. * include/mailutils/filter.h (mu_dot_filter): New filter. * mailbox/dot.c: New file. * mailbox/Makefile.am (libmailutils_la_SOURCES): Add dot.c * mailbox/crlfdot.c (_crlfdot_encoder): Bugfix. Do not dereference iobuf until we know it is not NULL. * mailbox/filter.c (mu_filter_get_list): Register mu_dot_filter. * mailbox/fltstream.c (filter_wr_close, filter_rd_close): New close methods, depending on the filter stream mode. (mu_filter_stream_create): Set filter_rd_close for MU_STREAM_READ and filter_wr_close for MU_STREAM_WRITE streams. * mailbox/stream.c (mu_stream_readdelim): Update stream offset when using stream->readdelim. * pop3d/pop3d.h (pop3d_send_payload): New proto. * pop3d/retr.c (pop3d_send_payload): Change function to be optionally used in pop3d_top. Use DOT filter on output. * pop3d/top.c (pop3d_top): Rewrite using pop3d_send_payload. * libproto/pop/pop3_retr.c (mu_pop3_retr): Default return code is EINPROGRESS. * libproto/pop/pop3_stream.c: Remove the filter stuff. Use CRLFDOT instead. * mailbox/amd.c (amd_body_stream_readdelim): Bugfix. Increase offset by nread bytes.
Showing
13 changed files
with
342 additions
and
198 deletions
mailbox/dot.c
0 → 100644
-
Please register or sign in to post a comment