- 11 Sep, 2010 1 commit
-
-
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.
Sergey Poznyakoff authored
-
- 09 Sep, 2010 1 commit
-
-
New ioctls MU_IOCTL_GET_TRANSPORT_BUFFER and MU_IOCTL_SET_TRANSPORT_BUFFER return and modify bufferization mode in the lowest level transport stream. Both server and client programs use this to switch to full buffering before sending large amounts of data. This has a particular impact on the output speed and CPU usage when TLS is in use. * include/mailutils/stream.h (MU_IOCTL_GET_TRANSPORT_BUFFER) (MU_IOCTL_SET_TRANSPORT_BUFFER): New ioctls. (MU_TRANSPORT_INPUT, MU_TRANSPORT_OUTPUT): New constants. (MU_TRANSPORT_VALID_TYPE): New macro. (mu_buffer_query): New struct. (mu_stream_get_buffer): New proto. * libmu_auth/tls.c (_tls_io_ioctl): Return ENOSYS if op is not supported. (_tls_ioctl): Support MU_IOCTL_[GS]ET_TRANSPORT_BUFFER. * mailbox/file_stream.c (fd_ioctl): Support MU_IOCTL_[GS]ET_TRANSPORT_BUFFER. Return ENOSYS if op is not supported. * mailbox/filter_iconv.c (_icvt_ioctl): Likewise. * mailbox/iostream.c (_iostream_ctl): Likewise. * mailbox/mapfile_stream.c (_mapfile_ioctl): Likewise. * mailbox/memory_stream.c (_memory_ioctl): Likewise. * mailbox/rdcache_stream.c (rdcache_ioctl): Likewise. * mailbox/xscript-stream.c (_xscript_ctl): Likewise. * mailbox/prog_stream.c (_prog_ioctl): Return ENOSYS if op is not supported. * mailbox/tcp.c (_tcp_ioctl): Likewise. * mailbox/stream.c (mu_stream_default_buffer_size): New global. (mu_stream_seek): Do not call seek method if the requested offset is the same as the current one. (mu_stream_set_buffer): Size==0 means use the default value. (mu_stream_get_buffer): New function. (mu_stream_truncate): Flush the buffer before truncating. * mailbox/mime.c (mime_reset_state): New function. (_mime_body_stream_seek): Rewrite using mime_reset_state. (_mime_body_stream_ioctl): Return ENOSYS if op is not supported. (create_mime_body_stream): Reset mime state (_mime_body_stream_seek may not be called due to the optimization in mu_stream_seek. * mailbox/header.c (header_parse): Exit correctly if the buffer is not terminated with a \n. * libproto/mbox/mbox.c (mbox_open): Enforce full buffering on the mailbox stream. * libproto/pop/mbox.c (pop_header_fill): Minor fix. * libproto/pop/pop3_stream.c (_POP3F_DONE) (_POP3F_CHBUF): New constants. (mu_pop3_stream)<done>: Remove. Replaced with flags. <oldbuf>: New member. (_pop3_event_cb): If _POP3F_CHBUF flag is set, restore the initial buffering mode on the transport stream. (mu_pop3_filter_create): Save away current buffering mode and enforce full buffering while transferring bulk data. * mail/from.c (hdr_from): Check return value from mu_message_get_header. * mail/mail.c (main): Allow for MAILRC having empty value. Always close the mailbox before exiting. * pop3d/pop3d.c (pop3d_cfg_param): New statement output-buffer-size. * pop3d/pop3d.h (pop3d_output_bufsize): New global. * pop3d/retr.c (pop3d_send_payload): New function. (pop3d_retr): Rewrite using pop3d_send_payload. Save away current buffering mode and enforce full buffering while transferring bulk data. * pop3d/top.c (pop3d_top_: Likewise.
Sergey Poznyakoff authored
-
- 08 Sep, 2010 9 commits
-
-
-
* include/mailutils/stream.h (MU_IOCTL_LEVEL): New ioctl op. (XSCRIPT_NORMAL, XSCRIPT_SECURE, XSCRIPT_PAYLOAD): New constants. * include/mailutils/sys/xscript-stream.h (_mu_xscript_stream) <level>: New member. * mailbox/xscript-stream.c (TRANS_DISABLED): New flag. (print_transcript): Amount of output varies depending on the current output level. For secure data, try to recognize passwords and to replace them with *** on output. (_xscript_ctl): Support MU_IOCTL_LEVEL. * pop3d/extra.c (set_xscript_level): New function. * pop3d/pop3d.h (set_xscript_level): New proto. * pop3d/retr.c (pop3d_retr): Set XSCRIPT_PAYLOAD level before sending actual data and reset it to XSCRIPT_NORMAL afterwards. * pop3d/top.c (pop3d_top): Likewise. * pop3d/user.c: Set XSCRIPT_SECURE level while expecting the PASS command. * imap4d/fetch.c (imap4d_fetch): Run imap4d_fetch0 in XSCRIPT_PAYLOAD level. * imap4d/uid.c (imap4d_uid): Likewise. * imap4d/imap4d.c (imap4d_mainloop): Unless started in preauth mode, select XSCRIPT_SECURE mode until authentication has been passed. * imap4d/imap4d.h (set_xscript_level): New proto. * imap4d/io.c (io_format_completion_response): Switch to XSCRIPT_NORMAL level when changing to the authenticated state. (imap4d_readline): Read literals in XSCRIPT_PAYLOAD level. * imap4d/util.c (set_xscript_level): New function. * include/mailutils/pop3.h (mu_pop3_trace_mask): New prototype. (MU_POP3_XSCRIPT_MASK): New macro. (_mu_pop3_xscript_level): New proto. * libproto/pop/pop3_pass.c (mu_pop3_pass): Set XSCRIPT_SECURE while sending the password. * libproto/pop/pop3_retr.c (mu_pop3_retr): Set XSCRIPT_PAYLOAD before going to MU_POP3_RETR_RX state. * libproto/pop/pop3_stream.c (_pop3_event_cb): Set XSCRIPT_NORMAL. * libproto/pop/pop3_top.c (mu_pop3_top): Set XSCRIPT_PAYLOAD before going to MU_POP3_TOP_RX state. * libproto/pop/pop3_trace.c (mu_pop3_trace_mask) (_mu_pop3_xscript_level): New functions. * libproto/pop/mbox.c (pop_open): Set trace masks depending on the trace6 and trace7 debug levels. * examples/pop3client.c (com_verbose): Allow to mask/unmask transcript levels.
Sergey Poznyakoff authored -
* mailbox/msgscan.c: New file. * mailbox/Makefile.am (libmailutils_la_SOURCES): Add it. * include/mailutils/body.h (mu_body_set_get_stream): New prototype. * include/mailutils/message.h (MU_SCAN_SEEK, MU_SCAN_SIZE): New defines. (mu_message_scan): New structure. (mu_stream_scan_message): New prototype. (mu_message_set_get_stream): New prototype. * include/mailutils/stream.h (mu_stream_copy): Change signature: takes 4 arguments now. * include/mailutils/sys/body.h (_mu_body) <_get_stream>: New method. * include/mailutils/sys/message.h (_mu_message) <_get_stream>: New method. * mailbox/body.c (_body_get_stream): Call _get_stream, if provided. * mailbox/message.c (_message_get_stream): Call _get_stream, if provided. * mailbox/stream.c (_stream_flush_buffer): Avoid infinite recursion: call stream->seek directly. * mailbox/streamcpy.c (mu_stream_copy): Return the number of bytes actually copied in the fourth argument. All uses updated. * mailbox/streamref.c (streamref_return): Do not propagate internal flags. (_streamref_readdelim): Ensure there is enough buffer space for the mu_stream_readdelim call. * libproto/pop/mbox.c: Finish client implementation. * mail/print.c (mail_print_msg): Close pager before returning on error.
Sergey Poznyakoff authored -
* include/mailutils/stream.h (MU_STREAM_RDTHRU) (MU_STREAM_WRTHRU,MU_IOCTL_SET_TRANSPORT): New flags. (mu_xscript_stream_create, mu_iostream_create) (mu_dbgstream_create): New prototypes. * include/mailutils/sys/dbgstream.h: New header. * include/mailutils/sys/iostream.h: New header. * include/mailutils/sys/xscript-stream.h: New header. * include/mailutils/sys/Makefile.am (sysinclude_HEADERS): Add dbgstream.h, iostream.h and xscript-stream.h * mailbox/dbgstream.c: New file. * mailbox/iostream.c: New file. * mailbox/xscript-stream.c: New file. * mailbox/Makefile.am (libmailutils_la_SOURCES): Add dbgstream.c, iostream.c and xscript-stream.c * mailbox/filter_iconv.c (_icvt_ioctl): Simplify the declaration of ptrans. * mailbox/mapfile_stream.c (_mapfile_ioctl): Likewise. * mailbox/memory_stream.c (_memory_ioctl): Likewise. * mailbox/prog_stream.c (_prog_ioctl): Likewise. * mailbox/tcp.c (_tcp_ioctl): Likewise. * mailbox/fltstream.c (filter_ctl): Likewise. (filter_read_through, filter_write_through): New methods. (mu_filter_stream_create): Allow for use of MU_STREAM_RDTHRU and MU_STREAM_WRTHRU to create two-way filters (writing triggers filtering while reading is transparent or vice versa). * pop3d/extra.c (istream, ostream): Remove globals. (iostream): New variable. (real_istream, real_ostream): New variables. (pop3d_setio): Set transcript stream on top of the I/O one, if required. (pop3d_init_tls_server): Rewrite. Revert the meaning of the return code to match the usual convention (0 - success). (transcript): Removed. (pop3d_outf): Remove calls to transcript. * pop3d/pop3d.h (istream, ostream): Remove externs. (iostream): New extern. * pop3d/retr.c: Use iostream, instear of ostream. * pop3d/top.c: Likewise. * pop3d/stls.c: Update the call to pop3d_init_tls_server. * mailbox/stream_vprintf.c (mu_stream_vprintf): Fix return value to match the usual convention.
Sergey Poznyakoff authored -
* mailbox/amd.c (amd_body_stream_readdelim): Fix the logic. * mailbox/message.c (_message_stream_seek): Fix seeks in backward direction. * pop3d/top.c: Fix output of the body.
Sergey Poznyakoff authored -
* pop3d/pop3d.h: Include filter.h. (istream, ostream): New externs. * pop3d/extra.c (pop3d_setio): Set a crlf filter on the output stream. This allows to forget about \r in the rest of the code. * pop3d/retr.c (pop3d_retr): Use mu_stream_copy instead of copying streams manually. * pop3d/top.c (pop3d_top): Rewrite using streamrefs and mu_stream_copy. * all sources: Use \n instead of \r\n in output strings.
Sergey Poznyakoff authored -
* include/mailutils/message.h (mu_message_set_stream): Mark as deprecated. * pop3d/retr.c (pop3d_retr): Rewind the stream obtained from mu_message_get_stream. * pop3d/top.c (pop3d_top): Rewind the streams obtained from mu_body_get_stream and mu_header_get_stream.
Sergey Poznyakoff authored -
* comsat/action.c * imap4d/fetch.c * imap4d/search.c * mh/burst.c * mh/comp.c * mh/forw.c * mh/mh_ctx.c * mh/mh_format.c * mh/mh_list.c * mh/mhn.c * mh/pick.y * pop3d/retr.c * pop3d/top.c * readmsg/msglist.c * readmsg/readmsg.c
Sergey Poznyakoff authored -
Does not compile yet. New files: * mailbox/streamref.c * include/mailutils/sys/streamref.h * include/mailutils/sys/file_stream.h * include/mailutils/sys/header_stream.h * include/mailutils/sys/mapfile_stream.h * include/mailutils/sys/memory_stream.h * include/mailutils/sys/message_stream.h * include/mailutils/sys/prog_stream.h * include/mailutils/sys/socket_stream.h * include/mailutils/sys/stdio_stream.h * include/mailutils/sys/stream.h * include/mailutils/sys/streamtrans.h * mailbox/prog_stream.c * mailbox/stdio_stream.c * mailbox/stream_printf.c * mailbox/stream_vprintf.c * mailbox/temp_file_stream.c * mailbox/streamcpy.c * mailbox/binflt.c * mailbox/crlfflt.c * mailbox/fltstream.c * mailbox/qpflt.c * mailbox/linelenflt.c Removed files: * mailbox/filter_rfc822.c * mailbox/filter_trans.c Moved files (with edits): * libproto/include/filter0.h -> include/mailutils/sys/filter.h * libproto/include/header0.h -> include/mailutils/sys/header.h * libproto/include/message0.h -> include/mailutils/sys/message.h * libproto/include/mime0.h -> include/mailutils/sys/mime.h Modified files: * comsat/action.c * config/mailutils-config.c * examples/base64.c * examples/cpp/msg-send.cc * examples/header.c * examples/http.c * examples/iconv.c * examples/mimetest.c * examples/msg-send.c * examples/mta.c * examples/murun.c * examples/nntpclient.c * examples/pop3client.c * imap4d/append.c * imap4d/auth_gsasl.c * imap4d/fetch.c * imap4d/preauth.c * imap4d/search.c * imap4d/util.c * include/mailutils/body.h * include/mailutils/folder.h * include/mailutils/header.h * include/mailutils/mailbox.h * include/mailutils/mailer.h * include/mailutils/mailutils.h * include/mailutils/message.h * include/mailutils/stream.h * include/mailutils/sys/Makefile.am * include/mailutils/sys/filter.h * include/mailutils/sys/header.h * include/mailutils/sys/message.h * include/mailutils/sys/mime.h * include/mailutils/sys/nntp.h * include/mailutils/sys/pop3.h * include/mailutils/sys/stream.h * include/mailutils/types.hin * lib/mailcap.c * lib/mu_dbm.h * libmu_argp/muinit.c * libmu_auth/ldap.c * libmu_auth/tls.c * libmu_scm/Makefile.am * libmu_scm/mu_body.c * libmu_scm/mu_message.c * libmu_scm/mu_port.c * libmu_sieve/actions.c * libmu_sieve/extensions/pipe.c * libmu_sieve/extensions/spamd.c * libmu_sieve/extensions/vacation.c * libproto/mailer/smtp.c * libproto/mbox/mboxscan.c * libproto/mbox/mbox.c * libproto/mbox/mbox0.h * libproto/nntp/nntp_article.c * libproto/nntp/nntp_carrier.c * libproto/nntp/nntp_destroy.c * libproto/nntp/nntp_ihave.c * libproto/nntp/nntp_post.c * libproto/nntp/nntp_readline.c * libproto/nntp/nntp_sendline.c * libproto/pop/pop3_carrier.c * libproto/pop/pop3_destroy.c * libproto/pop/pop3_readline.c * libproto/pop/pop3_sendline.c * libproto/pop/pop3_stat.c * maidag/mailtmp.c * mail/decode.c * mail/escape.c * mail/msgset.y * mail/pipe.c * mail/print.c * mail/send.c * mail/top.c * mail/util.c * mail/write.c * mailbox/Makefile.am * mailbox/amd.c * mailbox/attachment.c * mailbox/body.c * mailbox/cfg_driver.c * mailbox/cfg_format.c * mailbox/debug.c * mailbox/file_stream.c * mailbox/folder.c * mailbox/hdritr.c * mailbox/header.c * mailbox/mailbox.c * mailbox/mailcap.c * mailbox/mailer.c * mailbox/mapfile_stream.c * mailbox/memory_stream.c * mailbox/message.c * mailbox/message_stream.c * mailbox/mime.c * mailbox/mimehdr.c * mailbox/mutil.c * mailbox/prog_stream.c * mailbox/progmailer.c * mailbox/rfc2047.c * mailbox/socket_stream.c * mailbox/stream.c * mailbox/stream_vprintf.c * mailbox/tcp.c * mailbox/vartab.c * mailbox/wicket.c * mh/burst.c * mh/comp.c * mh/compcommon.c * mh/forw.c * mh/mh_ctx.c * mh/mh_format.c * mh/mh_init.c * mh/mh_list.c * mh/mh_whatnow.c * mh/mhl.c * mh/mhn.c * mh/pick.y * mh/repl.c * mimeview/mimeview.c * mu-aux/generr.awk * pop3d/extra.c * pop3d/pop3d.h * pop3d/retr.c * pop3d/top.c * readmsg/msglist.c * readmsg/readmsg.c * sieve/sieve.c
Sergey Poznyakoff authored
-
- 05 Jan, 2010 1 commit
- 11 Aug, 2009 1 commit
-
-
* pop3d/pop3d.h: Remove unused includes. (ABORT): New state. (pop3d_command_handler_t, struct pop3d_command): New types. (pop3d_find_command): New function. (pop3d_stat,pop3d_top,pop3d_uidl,pop3d_user,pop3d_apop) (pop3d_auth,pop3d_capa,pop3d_dele,pop3d_list,pop3d_noop) (pop3d_quit,pop3d_retr,pop3d_rset): Remove const from the arguments. Functions are free to modify it. (pop3d_parse_command): New function. * pop3d/cmd.c: New file. * pop3d/Makefile.am: Link in cmd.o * pop3d/apop.c: Use pop3d_parse_command to parse commands * pop3d/auth.c: Likewise. * pop3d/extra.c (pop3d_args, pop3d_cmd): Remove. (pop3d_parse_command): New function. (pop3d_abquit): use pop3d_error_string to convert error numbers to messages. * pop3d/pop3d.c (cb_bulletin_db): Protect by #ifdef USE_DBM (pop3d_mainloop): Change loop condition. Use pop3d_parse_command to parse commands, pop3d_find_command to lookup handlers in the command table and pop3d_error_string to convert error numbers to messages. (main): Call enable_stls if necessary. * pop3d/capa.c, pop3d/dele.c, pop3d/list.c, pop3d/noop.c, pop3d/quit.c, pop3d/retr.c, pop3d/rset.c, pop3d/stat.c, pop3d/stls.c, pop3d/top.c, pop3d/uidl.c, pop3d/user.c: Remove const qualifier from the command handler argument.
Sergey Poznyakoff authored
-
- 04 Aug, 2008 1 commit
-
-
* pop3d/retr.c (pop3d_retr): Use constant-size buffer. This avoids running out of memory on messages that do not contain trailing newline. * pop3d/top.c (pop3d_top): Likewise.
Sergey Poznyakoff authored
-
- 27 Jun, 2007 1 commit
-
-
- 25 Feb, 2007 1 commit
-
-
- 27 Aug, 2005 1 commit
-
-
- 26 Aug, 2005 1 commit
-
-
- 17 May, 2005 1 commit
-
-
- 10 Oct, 2003 1 commit
-
-
- 09 Oct, 2003 1 commit
- 09 Feb, 2003 1 commit
-
-
- 29 Dec, 2002 1 commit
- 26 Jul, 2002 1 commit
-
-
- 24 Apr, 2001 1 commit
-
-
- 10 Apr, 2001 1 commit
- 29 Jan, 2001 1 commit
-
-
and update Copyrigth. * pop3d/pop3d.c : Remove mbox_record register, only need path_record. * pop3d/retr.c : When retrieve a message should be mark as read. since we do not strip out the header "Status:". * pop3d/top.c : Adjust stream_readline().
Alain Magloire authored
-
- 20 Jan, 2001 1 commit
-
-
pop: RETR and TOP if buffer is not a full line i.e terminated by a '\n' realloc the buffer and try again. pop: STAT remove excess comment. pop: user use the /dev/null scheme if mailbox does not exist. mailbox: buglet if the mailbox format we were reading less then expected.
Alain Magloire authored
-
- 11 Jan, 2001 1 commit
- 06 Sep, 2000 1 commit
-
-
pop server base on the new API, but .. needs more testing. The new mailbox is not tested/mature enough for wide deployment. message_get_uidl: checks for X-UIDL to be compatible with qpopper and fall back to Message-ID, we need some sort of checksum or modify the header like the qpopper.
Alain Magloire authored
-
- 03 Sep, 2000 1 commit
-
-
- 02 Sep, 2000 1 commit
- 23 Sep, 1999 1 commit
- 16 Sep, 1999 1 commit
-
-