AgeCommit message (Collapse)AuthorFiles
5 daysVersion 3.13.91HEADmasterSergey Poznyakoff2
5 daysBugfixesSergey Poznyakoff2
* imap4d/idle.c (imap4d_idle): Catch eof * libmu_auth/tlsfdstr.c: Add missing include.
11 daysFix typosSergey Poznyakoff66
11 daysFix a corner case in mu_make_file_name_sufSergey Poznyakoff1
If dir is '/' (optionally followed by another '/'), copy it verbatim. * libmailutils/string/mkfilename.c (mu_make_file_name_suf):
11 daysForgotten to add with 22ceaddfb8Sergey Poznyakoff1
12 daysFix memory and fd leak in maildir and amdSergey Poznyakoff2
* libmailutils/base/amd.c (amd_expunge): Close and destroy the associated message stream. * libproto/maildir/maildir.c (maildir_close): Fix erroneously reverted condition.
2021-11-13mail: implement the unread commandSergey Poznyakoff6
* mail/unread.c: New file. * mail/ Add unread.c * mail/mail.h (mail_unread): New proto. * mail/table.c: New command "unread" ("U"). * doc/texinfo/programs/mail.texi: Document the unread command. * NEWS: Likewise.
2021-11-03Free allocated memory on exit.Sergey Poznyakoff4
See also 91d35ab2ee. * include/mailutils/cfg.h (mu_cfg_section): New members: ident_storage and label_storage. * libmailutils/cfg/driver.c (mu_config_destroy_container): Free the storage allocated for ident and label. Do this onlyw if the decreased refcount hits zero. (mu_config_container_register_section): Assign allocated strings to ident_storage and label_storage. (mu_config_root_register_section): Register an onexit routine for freeing the allocated memory. * libmailutils/cli/capa.c (capa_free): Register an onexit routine for freeing the allocated memory. * libmailutils/opt/progname.c (mu_set_program_name): Likewise.
2021-11-03Minor changeSergey Poznyakoff1
* libmailutils/stdstream/basestr.c (std_log_bootstrap): Mark stream as open.
2021-11-03Free some allocated memory on exit.Sergey Poznyakoff4
This eliminates certain "memory leaks", that have little (if any) practical importance, bu make leak detection tools overly vociferous. * libmailutils/base/monitor.c (static_monitor_dealloc): New function. (mu_monitor_rdlock, mu_monitor_wrlock): Install static_monitor_dealloc as onexit handler. * libmailutils/filter/filter.c (filter_dealloc): New function: deallocate filter_list. (mu_filter_get_list): Install filter_dealloc as onexit handler. * libmailutils/locus/ident.c (nametab_dealloc): New function. (mu_ident_ref): Install nametab_dealloc as onexit handler. * libmailutils/stdstream/basestr.c (std_log_bootstrap): Unref transport after setting it up to log stream. (stdstream_flushall): Call mu_stream_destroy instead of mu_stream_flush.
2021-11-03Move mimetypes support into the librarySergey Poznyakoff20
* Build libmailutils/mimetypes/Makefile * include/mailutils/ New header mimetypes.h * mimeview/mimeview.h: moved from include/mailutils/mimetypes.h * include/mailutils/sys/ Add mimetypes.h * include/mailutils/sys/mimetypes.h: New file. * include/mailutils.h: Include mailutils/mimetypes.h * libmailutils/ Build mimetypes. * libmailutils/mimetypes/.gitignore: New file. * libmailutils/mimetypes/eval.c: New file. * libmailutils/mimetypes/grammar.y: Moved from mimeview/grammar.y * libmailutils/mimetypes/lexer.l: Moved from mimeview/lexer.l. * libmailutils/diag/debcat: Add mimetypes. * mimeview/ Update. * mimeview/tests/ Change debug level. * include/mailutils/stream.h (mu_fd_stream_create): filename is const. * libmailutils/stream/file_stream.c: Likewise.
2021-11-02Mimeview: redo the API; rewrite as reentrant scanner/parserSergey Poznyakoff6
* include/mailutils/yyloc.h: Formatting change. * mimeview/grammar.y: Rewrite as a reentrant parser. * mimeview/lexer.l: Rewrite as a reentrant scanner. Use flex interface to bison. * mimeview/mimeview.c: Use new API. * mimeview/mimeview.h: Remove most prototypes. (mimetypes_open, mu_mimetypes_close) (mu_mimetypes_stream_type, mu_mimetypes_file_type) (mu_mimetypes_fd_type): New API. * mimeview/tests/ (multiple error recovery): Fix expected location of error recovery.
2021-11-01Minor fix in mimeview/grammar.ySergey Poznyakoff1
2021-11-01Require GNU bison and flexSergey Poznyakoff31
* am/bison.m4: Use AC_PATH_PROG. * am/flex.m4: Likewise. * Remove MU_YLWRAP. * include/mailutils/yyloc.h (YYLTYPE): Remove. This needs be defined in each grammar source individually. * mu-aux/ Remove gylwrap. * mu-aux/gylwrap: Remove. * libmailutils/cfg/ Rewrite rules for building grammars and lexers. * libmailutils/datetime/ Likewise. * libmu_sieve/ Likewise. * mail/ Likewise. * mh/ Likewise. * mimeview/ Likewise. * libmailutils/cfg/gylwrap.conf: Remove. * libmailutils/datetime/gylwrap.conf: Remove. * libmu_sieve/gylwrap.conf: Remove. * mh/gylwrap.conf: Remove. * mimeview/gylwrap.conf: Remove. * libmailutils/cfg/lexer.l: Use %option prefix * libmu_sieve/sieve-lex.l: Likewise. * mh/mh_alias_lex.l: Likewise. * mimeview/lexer.l: Likewise. * libmailutils/cfg/parser.y: Use api.prefix and %code requires. * libmailutils/datetime/parsedate.y: Likewise. * mh/mh_alias_gram.y: Likewise. * mh/mh_fmtgram.y: Likewise. * mh/pick-gram.y: Likewise. * libmu_sieve/sieve-gram.y: Likewise. * mimeview/grammar.y: Likewise. * testsuite/lib/mailutils.exp (mu_create_config): Fix source location.
2021-09-30Fix timezone calculation (see Poznyakoff1
* libmailutils/datetime/utcoff.c (mu_utc_offset): Fix the timezone correction.
2021-08-27BugfixSergey Poznyakoff1
* libmailutils/stream/stream.c (mu_stream_timed_getdelim): If buffer points to NULL, assume size = 0.
2021-08-27BugfixSergey Poznyakoff2
* imap4d/io.c (imap4d_init_tls_server): Fix inverted condition. * pop3d/extra.c (pop3d_init_tls_server): Likewise.
2021-08-26Test TLS streamsSergey Poznyakoff11
* Configure test directory in libmu_auth * libmu_auth/ Likewise. * libmu_auth/tests/.gitignore: New file. * libmu_auth/tests/ New file. * libmu_auth/tests/ New file. * libmu_auth/tests/genfile.c: New file. * libmu_auth/tests/ New file. * libmu_auth/tests/ New file. * libmu_auth/tests/tlscpy.c: New file. * pop3d/cmd.c: Fix typo.
2021-08-25Version 3.13.90Sergey Poznyakoff2
2021-08-25New function: mu_starttlsSergey Poznyakoff19
* libmu_auth/tlsfdstr.c (mu_tlsfd_stream_create): Accept conf==NULL. (mu_starttls): New function. * include/mailutils/tls.h (mu_starttls): New proto. * include/mailutils/imapio.h (mu_imapio_get_transport) (mu_imapio_set_transport): New functions. * libmailutils/imapio/transport.c (mu_imapio_get_transport) (mu_imapio_set_transport): New functions. * libmailutils/stream/iostream.c (mu_iostream_create): Accept NULL out stream. * libmailutils/stream/tcp.c: Support MU_IOCTL_FD (_tcp_instance): New member fd_borrowed. (_tcp_close): Don't close fd if fd_borrowed is set. (_tcp_ioctl): Handle MU_IOCTL_FD. * libmailutils/stream/xscript-stream.c (_xscript_ctl): Accept pstr[1] == NULL. * libmu_auth/notls.c (mu_tlsfd_stream_create) (mu_tlsfd_stream2_convert) (mu_starttls): New placeholders. * libproto/imap/folder.c (_mu_imap_folder_open): Use mu_tlsfd_stream_convert. Fix stream leak. * libproto/imap/starttls.c (mu_imap_starttls): Use mu_starttls. * libproto/mailer/smtp.c (smtp_open): Use mu_tlsfd_stream_convert. * libproto/mailer/smtp_starttls.c (mu_smtp_starttls): Use mu_starttls. * libproto/pop/pop3_stls.c (mu_pop3_stls): Likewise. * libproto/pop/mailbox.c (pop_open): Use mu_tlsfd_stream_convert. Fix stream leak. * mu/libexec/imap.c (com_connect): Use mu_tlsfd_stream_convert. Fix stream leak. * mu/libexec/pop.c: Likewise. * mu/libexec/smtp.c: Likewise. * imap4d/io.c (imap4d_init_tls_server): Use mu_starttls. * pop3d/extra.c: Likewise.
2021-08-25New function mu_tlsfd_stream2_convertSergey Poznyakoff5
* libmu_auth/tlsfdstr.c (mu_tlsfd_stream_create): Remove last argument. All uses changed. (mu_tlsfd_stream2_convert): New function. * include/mailutils/tls.h (mu_tlsfd_stream_create): Change signature (flags removed). (mu_tlsfd_stream2_convert): New proto. (mu_tlsfd_stream_convert): New inline function. * libmailutils/diag/errors (MU_ERR_TRANSPORT_GET) (MU_ERR_TRANSPORT_SET): New error codes. * imap4d/io.c (imap4d_init_tls_server): Use mu_tlsfd_stream2_convert. * pop3d/extra.c (pop3d_init_tls_server): Use mu_tlsfd_stream2_convert.
2021-08-25Use timed I/O and fd-based TLS for pop3dSergey Poznyakoff2
2021-08-24Intermediate streams: propagate _MU_STR_EVENT_CLRFLAG to the underlying ↵Sergey Poznyakoff6
transport * libmailutils/stream/fltstream.c: Propagate mu_stream_clearerr to the transport stream. * libmailutils/stream/iostream.c: Likewise. * libmu_auth/tls.c: Likewise. * libmu_auth/tlsiostr.c: Likewise. * libmu_auth/tlsfdstr.c (_tlsfd_read, _tlsfd_write): Translate GNUTLS_E_TIMEDOUT to MU_ERR_TIMEOUT. * imap4d/bye.c (imap4d_bye_command): Clear stream error on ERR_TIMEOUT. ---
2021-08-24Attempt to simplify TLS streams.Sergey Poznyakoff7
* libmu_auth/tlsfdstr.c: New TLS stream implementation. * include/mailutils/tls.h (mu_tls_config): New field: handshake_timeout. (mu_tlsfd_stream_create): New proto. * libmu_auth/ Compile tlsfdstr.c * libmu_auth/tlsconf.c (tls_canned_param): New configuration statement: tls.handshake_timeout * doc/texinfo/programs.texi: Document the tls.handshake-timeout statement. * imap4d/io.c (io_setio, imap4d_init_tls_server): Use mu_tlsfd_stream_create. * imap4d/starttls.c (global_tls_conf): Initialize handshake_timeout.
2021-08-23Fix handling of MU_IOCTL_SUBSTREAM in iostreamSergey Poznyakoff3
* libmailutils/stream/iostream.c (_iostream_ctl): Fix handling of MU_IOCTL_SUBSTREAM (get/set) requests. * imap4d/io.c (io_setio): Unreference the source stream. (imap4d_init_tls_server): Fix reference decrement for tlsstream. * pop3d/extra.c (pop3d_setio): Unreference the source stream. (pop3d_init_tls_server): Fix reference decrement for tlsstream.
2021-08-21imap4d: Set timeouts for I/O operations during handshakeSergey Poznyakoff3
* imap4d/io.c (io_setio): Set I/O timeout for pull functions during the handshake. * libmu_auth/tls.c: Fix debugging output. * libmu_auth/tlsiostr.c (_tls_io_read): Improve error diagnostics.
2021-08-21imap4d: switch to timed stream I/OSergey Poznyakoff4
* imap4d/idle.c (imap4d_idle): Use mu_stream_timed_getline. * imap4d/imap4d.c (imap4d_mainloop): Remove use of io_wait_input. * imap4d/imap4d.h (io_wait_input): Remove. * imap4d/io.c (io_wait_input): Remove. (io_getline): Rewrite using mu_stream_timed_getline. (imap4d_tokbuf_getline): Likewise. (check_input_err): Handle MU_ERR_TIMEOUT.
2021-08-21Implement "timed" versions of the stream read-up-to-delimiter operationsSergey Poznyakoff8
* include/mailutils/stream.h (MU_IOCTL_TIMEOUT): New ioctl code. (mu_stream_timed_readdelim,mu_stream_timed_readline): New protos. (mu_stream_readdelim,mu_stream_readline,mu_stream_getdelim) (mu_stream_getline): Rewrite as inline functions. * include/mailutils/datetime.h (mu_timeval_cmp, mu_timeval_add) (mu_timeval_sub): New inline functions for operations over struct timeval. * include/mailutils/sys/file_stream.h (_mu_file_stream): New member: io_timeout. * libmailutils/diag/errors (MU_ERR_TIMEOUT, MU_ERR_SET_TIMEOUT) (MU_ERR_WRITE, MU_ERR_TLS): New error codes. * libmailutils/stream/file_stream.c (fd_read,fd_write): Take into account I/O timeout. (fd_ioctl): Handle MU_IOCTL_TIMEOUT. * libmailutils/stream/stream.c (mu_stream_timed_readdelim) (mu_stream_timed_readline): New functions. * libmu_auth/tls.c (_tls_open): Special handling for time-out errors. * libmailutils/stream/iostream.c (_iostream_ctl): Pass MU_IOCTL_TIMEOUT to the transport stream.
2021-08-19Provide program name for mu shell utilitiesSergey Poznyakoff3
* mu/libexec/imap.c (main): Set program name. * mu/libexec/pop.c: Likewise. * mu/libexec/smtp.c: Likewise.
2021-08-05Version 3.13release-3.13Sergey Poznyakoff2
2021-07-27Prefer User-Agent header over X-MailerSergey Poznyakoff22
* NEWS: Update. * doc/texinfo/programs/mail.texi: Update. * include/mailutils/header.h (MU_HEADER_USER_AGENT): New define. * mail/mail.c (default_setup): Set useragent * mail/mail.h (mailvar_name_useragent): New define. * mail/mailline.c (header_generator): Add MU_HEADER_USER_AGENT. * mail/mailvar.c: Mew variable: "useragent". Retain "xmailer" as an alias. * mail/send.c (mail_compose_send): Add the User-Agent header if the "useragent" variable is set. * libmailutils/tests/ Use User-Agent instead of X-Mailer. * mail/tests/ Likewise. * mail/tests/ Likewise. * mail/tests/ Likewise. * mail/testsuite/mail/Followup.exp: Likewise. * mail/testsuite/mail/Reply.exp: Likewise. * mail/testsuite/mail/reply.exp: Likewise. * mail/testsuite/mail/send.exp: Likewise. * mh/repl.c: Likewise. * mh/send.c: New .mtstailor vareiable "user-agent".
2021-07-27Rewrite tests for interactive mail features in expectSergey Poznyakoff14
After 4befcfd015 interpolation escapes can't be tested using autotest. Move them to DejaGNU testsuite. * mail/tests/ Remove. * mail/tests/ Remove. * mail/tests/ Remove. * mail/tests/ Remove. * mail/tests/ Remove these tests. * mail/tests/ Likewise. * mail/.gitignore: Fix the entry for mail. * mail/testsuite/mail/Followup.exp: New test. * mail/testsuite/mail/Reply.exp: New test. * mail/testsuite/mail/followup.exp: New test. * mail/testsuite/mail/reply.exp: New test. * mail/testsuite/mail/DISTFILES: Add these files. * mail/testsuite/lib/mail.exp (mail_version): Don't print the version number. * mail/testsuite/mail/write.exp: Preserve current working directory.
2021-07-19Fix in quoted-printable decoderSergey Poznyakoff1
* libmailutils/filter/qpflt.c (_qp_decoder): Accept soft line breaks (RFC 2045, 6.7, page 19)
2021-07-19mail: disable compose escapes in non-interctive mode.Sergey Poznyakoff3
* NEWS: Document changes. * doc/texinfo/programs/mail.texi: Document changes. * mail/send.c (mail_compose_send): Recognize escapes only in interactive mode.
2021-07-16Rename the FROMRB filter to FROMRDSergey Poznyakoff9
Old name is retained as an alias.
2021-07-15Fix stream reference bug in mu_filter_stream_createSergey Poznyakoff2
If the mu_filter_xcode_t function failed in mu_filter_init request, mu_filter_stream_create would leave the transport reference counter incremented by one. * libmailutils/stream/fltstream.c (mu_filter_stream_create): On failure, decrement reference counter of transport stream. * libmailutils/tests/fltcnt.c: Test for the above bug as well.
2021-07-15Fix stream reference bug in mu_filter_chain_create family functions.Sergey Poznyakoff6
This change affects the following two functions: mu_filter_chain_create, mu_filter_chain_create_pred. In previous versions, if these functions failed to create the requested filter chain, they decremented reference counter of their transport (input stream) argument. This change restores the proper behavior: - On success, reference counter is incremented by 1. - On error, reference counter doesn't change. * libmailutils/filter/fltchain.c (_add_next_link): Make sure the transport reference counter does not change. * libmailutils/tests/ Add new auxiliary program and test case. * libmailutils/tests/ New file. * libmailutils/tests/fltcnt.c: New file. * libmailutils/tests/ Include new test.
2021-07-14Minor changeSergey Poznyakoff1
* libmailutils/stream/streamref.c (mu_streamref_create_abridged):Don't reposition the underlying stream to beginning.
2021-07-13BugfixesSergey Poznyakoff3
* libproto/imap/fetch.c (_fill_response): Tolerate NIL date field. * libproto/imap/mailbox.c (__imap_msg_get_stream): Seek to the end, instead of computing stream size. * libproto/mbox/mboxrd.c (mailbox_append_message): If all methods of determining envelope size fail, assume epoch instead of bailing out.
2021-06-11mail: fix descriptions of command arguments in help outputSergey Poznyakoff1
2021-06-11fix mail '| cat >/tmp/save'Sergey Poznyakoff1
* mail/send.c (msg_to_pipe): Run command via shell.
2021-06-11Fix handling of MIME messages that have only one part.Sergey Poznyakoff3
* libmailutils/mime/mime.c (_mime_part_size): Fix handling of one part MIME messages. Don't touch psize memory in case of error. (_mime_body_stream_read): Fix handling of one part MIME messages. Previous implementation used to add an extra newline at the end. * mh/tests/ Reflect the above changes. * sieve/tests/ Reflect the above changes.
2021-06-11Fix typoSergey Poznyakoff1
* mail/util.c (util_outfilename): Remove extra closing parenthesis.
2021-06-10Update docs; improve mailx compatibility modeSergey Poznyakoff5
* doc/texinfo/programs/mail.texi (Saving and Recording): New section. * mail/mailvar.c: Make sure escape is a single character. * mail/util.c (util_outfilename): In mailx compatibility mode, assume outfilename_local.
2021-06-10Fix memory leaks (mboxrd and mail)Sergey Poznyakoff5
* libproto/mbox/mboxrd.c (mboxrd_rescan_unlocked): Free buf. (mboxrd_detect): Destroy str when no longer needed. * mail/copy.c (mail_copy0): Free allocated memory. Create file in cwd if util_outfolder_name return NULL. * mail/exit.c (mail_exit): Destroy mbox. * mail/util.c (util_range_msg): Use msgset_free instead of plain free.
2021-06-10Provide several ways of creating the outgoing file name.Sergey Poznyakoff7
Several mail commands store message in a file named by its recipient (or sender) in the "folder" directory (these commands are: Copy, Save, Mail, followup, Followup). As per POSIX, the local part of the email address serves as the file name. There may be cases, however, when using the entire email would be preferable. This commit introduces new mail variable "outfilename" that controls how the file name is generated. Its default value is "local", which means use the email local part. Other possible values are: "email", to save messages in a file named by entire email, and "domain", to save them in a file named by domain part of the email. * NEWS: Document changes. * doc/texinfo/programs/mail.texi: Document changes. * mail/mail.c (default_setup): Set outfilename=local. * mail/mail.h (mailvar_name_outfilename): New define. (outfilename_mode): New extern. (util_outfilename): New proto. * mail/mailvar.c: New variable: "outfilename". * mail/send.c (mail_compose_send): Use util_outfilename to form outgoing file name. * mail/util.c (outfilename_mode): New global. (util_outfilename): New function. (util_message_sender): Use util_outfilename.
2021-06-09mail: implement the fullnames variableSergey Poznyakoff6
* NEWS: Document changes. * doc/texinfo/programs/mail.texi: Likewise. * mail/mail.c (default_setup): Set fullnames. * mail/mail.h (mailvar_name_fullnames): New define. * mail/mailvar.c (fullnames): New variable. * mail/reply.c (compose_remove_personal): New function. (respond_msg,respond_all): Call compose_remove_personal if fullnames is not set.
2021-06-09Add tests for mail send/reply/followup commandsSergey Poznyakoff11
* mail/mail.c (main): Fix exit status in send mode. * mail/tests/ Add new tests. * mail/tests/ Likewise. * mail/tests/ (MAILER): New variable. * mail/tests/ New file. * mail/tests/ New file. * mail/tests/ New file. * mail/tests/ New file. * mail/tests/ New file. * mail/tests/ New file. * mail/tests/ New file.
2021-06-09mail: fix semantics of mail sending and saving commandsSergey Poznyakoff17
* NEWS: Document changes. * doc/texinfo/programs/mail.texi: Document changes. * mail/ (mail_SOURCES): Remove followup.c * mail/followup.c: Remove. * mail/mail.c: Fix the -F option. Rewrite send mode by calling mail_send directly. * mail/mail.h (mailvar_name_byname): Remove. (mail_send0): Rename to mail_compose_send. All uses changed. (util_message_sender): New function. * mail/mailvar.c (mailvar_tab): Remove the "byname" variable. "outfolder": Accept string and boolean values. (print_descr): Handle hard newlines. (mailvar_get): Use mailvar_type_whatever to test whether a variable is set, regardless of its type. * mail/reply.c: Rewrite to match POSIX standard. This affects the following commands: "reply", "Reply", "followup", "Followup". * mail/send.c (compose_header_set): Use util_merge_addresses when operating on address headers. (send_message): In mailx compatibility mode, assume the sendmail:// scheme. (mail_send0): Rename to mail_compose_send. Add Date header before saving the message, to make sure mu_mailbox_append_message won't bail out. * mail/table.c: New command: "Mail". * mail/testsuite/mail/send.exp: Fix expected output. * mail/testsuite/mail/write.exp: Likewise. * mail/util.c (util_message_sender): New function. (util_get_sender): Rewrite using util_message_sender. (util_outfolder_name,util_save_outgoing): Rewrite from scratch, Ensure mailx compatibility, * mail/write.c (mail_write): Don't use outfolder. * testsuite/mockmail.c: Support -i and -v options. * testsuite/ Unset MAIL_DUMP when testing.
2021-06-08BugfixSergey Poznyakoff1
* libproto/mbox/mboxrd.c (mailbox_append_message): Don't overwrite the error code.

Return to:

Send suggestions and report system problems to the System administrator.