1. 17 Oct, 2011 1 commit
    • Use it in maidag (.forward file safety) and in libmu_auth (TLS files).
      
      * include/mailutils/tls.h (mu_tls_module_config): New members
      for safety check flags.
      * include/mailutils/util.h (MU_FILE_SAFETY_NONE,MU_FILE_SAFETY_ALL)
      (MU_FILE_SAFETY_OWNER_MISMATCH)
      (MU_FILE_SAFETY_GROUP_WRITABLE,MU_FILE_SAFETY_WORLD_WRITABLE)
      (MU_FILE_SAFETY_GROUP_READABLE,MU_FILE_SAFETY_WORLD_READABLE)
      (MU_FILE_SAFETY_LINKED_WRDIR)
      (MU_FILE_SAFETY_DIR_IWGRP,MU_FILE_SAFETY_DIR_IWOTH): New constants.
      (mu_file_safety_check,mu_file_safety_name_to_code)
      (mu_file_safety_name_to_error): New protos.
      * libmailutils/base/checkperms.c: New file.
      * libmailutils/base/Makefile.am (libbase_la_SOURCES): Add checkperms.c.
      * libmailutils/diag/errors: Add new error codes.
      (MU_ERR_UNSAFE_PERMS): change description wording.
      * libmu_auth/tls.c (mu_check_tls_environment): Use mu_file_safety_check.
      * libmu_cfg/tls.c (tls_settings): Initialize.
      (mu_tls_param): New configuration file statements:
      key-file-safety-checks, cert-file-safety-checks, ca-file-safety-checks.
      * maidag/forward.c (maidag_forward): Use mu_file_safety_check.
      * maidag/maidag.c (cb2_forward_file_checks): Use
      mu_file_safety_name_to_code.
      Sergey Poznyakoff authored
  2. 16 Oct, 2011 2 commits
  3. 15 Oct, 2011 2 commits
    • Bugfixes. · 85032d0e
      * libmailutils/base/amd.c (amd_open): Return error if the mailbox
      cannot be opened for the required access permissions.
      (amd_message_stream_open): Fix condition for
      determining r/w access.
      * mh/mh_list.c (eval_extras): Break the loop if mu_header_aget_field_name
      fails.
      Sergey Poznyakoff authored
    • INTERNALDATE now includes a meaningful timezone information (it
      used to return +0000).
      
      Date searches disregard the time and timezone of the INTERNALDATE
      or Date: header, as mandated by RFC 3501.
      
      * libmailutils/base/date.c (mu_parse_ctime_date_time): In the absence
      of TZ in ctime strings, return local time zone.
      
      * imap4d/io.c (imap4d_tokbuf_getline): Kill trailing whitespace.
      
      * imap4d/util.c (adjust_tm): New function.
      (util_parse_internal_date)
      (util_parse_822_date)
      (util_parse_ctime_date): Take three arguments, the third one controlling
      what information to return. All uses updated.
      * imap4d/fetch.c (_frt_internaldate): Return meaningful timezone.
      If all else fails, use local TZ.
      * imap4d/imap4d.h (datetime_parse_mode): New enum.
      (util_parse_internal_date)
      (util_parse_822_date)
      (util_parse_ctime_date): Change signature.
      * imap4d/search.c (parse_simple_key)
      (_header_date,cond_before,cond_on,cond_since): Use datetime_date_only mode.
      
      * testsuite/spool/search.mbox: New file.
      * testsuite/spool/DISTFILES: Add search.mbox
      * imap4d/testsuite/lib/imap4d.exp (imap4d_start): New option -mbox.
      * imap4d/testsuite/imap4d/search.exp: Rewrite.
      
      * imap4d/testsuite/imap4d/create.exp: Account for TZ part in internaldate
      strings, which may vary.
      * imap4d/testsuite/imap4d/fetch.exp: Likewise.
      * imap4d/testsuite/imap4d/list.exp: List the new mailbox.
      Sergey Poznyakoff authored
  4. 22 Sep, 2011 1 commit
    • Bugfix · e759db27
      * libmailutils/filter/crlfflt.c (_crlf_encoder): Reset state to
      initial if any character other than \r and \n is read.
      Sergey Poznyakoff authored
  5. 09 Sep, 2011 3 commits
  6. 29 Aug, 2011 3 commits
  7. 28 Aug, 2011 1 commit
  8. 27 Aug, 2011 1 commit
  9. 26 Aug, 2011 1 commit
    • * include/mailutils/message.h (mu_message_ref): Change proto.
      (mu_message_unref): New proto (instead of macro).
      * include/mailutils/mime.h (mu_mime_ref)
      (mu_mime_unref, mu_mime_to_message): New protos.
      * include/mailutils/sys/message.h (MESSAGE_MODIFIED)
      (MESSAGE_INTERNAL_STREAM): New constants (from mime.c)
      (MESSAGE_MIME_OWNER): New constant.
      (_mu_message) <ref_count>: Rename from ref.
      * include/mailutils/sys/mime.h (MIME_SEEK_ACTIVE): New constant.
      (_mu_mime) <ref_count>: New member.
      * libmailutils/mailbox/message.c (MESSAGE_MODIFIED)
      (MESSAGE_INTERNAL_STREAM): Removed (see above).
      * libmailutils/mailer/mailer.c (mu_message_unref): New function.
      (mu_message_destroy): Rewrite.
      (mu_message_ref): Returns void.
      (mu_message_lines): Don't access header and body directly to
      give virtual functions a chance to initialize them.
      (mu_message_quick_lines): likewise.
      * libmailutils/mailer/mailer.c (send_fragments): Use mu_mime_to_message
      instead of mu_message_unref.
      * libmailutils/mime/mime.c (_mime_append_part): Set offset only if
      mime->stream is not null.
      (_mime_body_stream_seek): Implement (albeit inefficiently).
      (mu_mime_create): Set ref_count.
      (mu_mime_ref, mu_mime_unref): New functions.
      (mu_mime_destroy): Reimplement as a wrapper over _mu_mime_free.
      (mu_mime_get_message): Increase refcount of the message being returned.
      (mu_mime_to_message): New function.
      * libmailutils/stream/message_stream.c (_message_open): Handle arbitrary
      text as RFC822 without headers.
      
      * libmu_sieve/actions.c: Unref the message returned by mu_mime_get_message.
      * libmu_sieve/extensions/vacation.c: Likewise.
      * mh/mhn.c: Likewise.
      
      * libmailutils/stream/stream.c (mu_stream_seek) <MU_SEEK_CUR>: Bugfix.
      Sergey Poznyakoff authored
  10. 25 Aug, 2011 1 commit
  11. 04 Aug, 2011 1 commit
    • * libmailutils/base/assoc.c (first): Set index to max value
      if tab is NULL to indicate immediate end of iteration.
      * libmu_auth/sql.c (mu_auth_sql_by_name)
      (mu_auth_sql_by_uid): Check the return from mu_sql_num_tuples.
      (mu_sql_getpass): Check the number of returned tuples.
      Return failure if returned a NULL password.
      * libmu_scm/mu_message.c (string_sloppy_member): Remove.
      (mu-message-get-header-fields): Use scm_member instead of
      string_sloppy_member.
      * sql/postgres.c (chop): Handle NULL argument.
      Sergey Poznyakoff authored
  12. 27 Jul, 2011 1 commit
  13. 19 Jul, 2011 1 commit
  14. 17 Jul, 2011 1 commit
    • * libmailutils/base/rfc2047.c (mu_rfc2047_decode): Break if
      reading from the filter fails.
      * libmailutils/stream/fltstream.c (filter_read): Treat
      mu_filter_moreinput in the lastbuf state as error.
      Sergey Poznyakoff authored
  15. 14 Jul, 2011 2 commits
    • * NEWS: Update.
      * configure.ac: Update.
      * po/POTFILES.in: Update.
      Sergey Poznyakoff authored
    • * lib/manlock.c: New file.
      * lib/Makefile.am (libmuaux_a_SOURCES): Add manlock.c.
      * lib/muaux.h (manlock_mandatory_locking)
      (manlock_lock_dir): New externs.
      (manlock_open_mailbox, manlock_lock)
      (manlock_touchlock, manlock_unlock): New protos.
      
      * libmailutils/base/amd.c (amd_cleanup): Remove unbalanced
      call to mu_locker_unlock.
      * libmailutils/base/locker.c (mu_locker_create): Bugfixes.
      
      * imap4d/imap4d.c (imap4d_cfg_param): Add mandatory-locking
      construct.
      (main): Call manlock_cfg_init.
      * imap4d/select.c (imap4d_select0): Use mandatory locking if
      the mailbox is to be opened r/w.
      
      * imap4d/rename.c (imap4d_rename): Note FIXME!
      
      * imap4d/bye.c: Call manlock_unlock after closing the mailbox.
      * imap4d/close.c: Likewise.
      * imap4d/sync.c (imap4d_sync): Call manlock_touchlock.
      
      * pop3d/lock.c: Remove.
      * pop3d/Makefile.am (pop3d_SOURCES): Remove lock.c
      * pop3d/extra.c (pop3d_abquit): Unlock mailbox.
      * pop3d/pop3d.c (pop3d_cfg_param): Add mandatory-locking
      construct.
      (main): Call manlock_cfg_init.
      (pop3d_mainloop): Call manlock_touchlock.
      * pop3d/pop3d.h (pop3d_lock)
      (pop3d_touchlock, pop3d_unlock): Remove.
      * pop3d/quit.c (pop3d_quit): Unlock the mailbox.
      * pop3d/user.c (pop3d_begin_session): Use manlock_open_mailbox.
      Sergey Poznyakoff authored
  16. 07 Jul, 2011 1 commit
    • Bugfix. · a9667edc
      * libmailutils/string/vasnprintf.c (mu_vasnprintf): Operate on
      a fresh copy of va_alist in each new iteration.
      * libproto/imap/folder.c: Likewise.
      * libproto/nntp/nntp_sendline.c: Likewise.
      Sergey Poznyakoff authored
  17. 04 Jul, 2011 3 commits
    • * include/mailutils/stdstream.h (MU_STDSTREAM_RESET_STRIN)
      (MU_STDSTREAM_RESET_STROUT,MU_STDSTREAM_RESET_STRERR)
      (MU_STDSTREAM_RESET_NONE,MU_STDSTREAM_RESET_ALL): New flags.
      (mu_stdstream_setup): Change signature. All uses updated.
      * libmailutils/stdstream/basestr.c (mu_stdstream_setup):
      Use the flags argument to decide whether to close existing
      streams.
      Make sure stdstream_flushall enters the onexit queue only once.
      * libmu_argp/muinit.c (mu_app_init): Don't override variables
      that may be set by the caller (program_name, tag, streams).
      Sergey Poznyakoff authored
    • * libmailutils/diag/errors: Fix typo.
      * libproto/imap/connect.c: Add missing includes.
      * mh/tests/mhn.at: Add extra argument quoting.
      Sergey Poznyakoff authored
    • * libmailutils/diag/wd.c (mu_wd): Revamp the loop to ensure the proposed
      way of connecting with gdb works in case of a non-zero timeout.
      Sergey Poznyakoff authored
  18. 20 Jun, 2011 1 commit
    • * NEWS: Version 2.99.91
      * configure.ac: Likewise.
      * imap4d/imap4d.h (io_getline): Change return value
      * imap4d/io.c (io_getline): Abort if a read error occurs.
      Sergey Poznyakoff authored
  19. 08 Jun, 2011 1 commit
    • * include/mailutils/diag.h (mu_full_program_name): New extern.
      * libmailutils/diag/diag.c (mu_full_program_name): New global.
      (mu_set_program_name): Set mu_full_program_name.
      (mu_diag_at_locus): Fix format specifier.
      * libmailutils/diag/bt.c: Use mu_full_program_name instead of
      program_invocation_name.
      * libmailutils/diag/wd.c (mu_wd): Likewise.
      
      * comsat/comsat.c: Fix format specifiers.
      * lib/mailcap.c: Likewise.
      * libmu_sieve/util.c: Cast formatted arguments to match format specs.
      * mh/mh_getopt.c: Likewise.
      
      * libmailutils/cidr/fromstr.c: Add missing includes.
      * libproto/mailer/smtp.c: Likewise.
      * libproto/pop/mbox.c: Likewise.
      * testsuite/smtpsend.c: Likewise.
      * mu/getarg.c: Likewise.
      * mu/imap.c: Likewise.
      * mu/pop.c (com_connect): Protect TLS code with #ifdef.
      * mu/Makefile.am (EXTRA_DIST): Add mu-setup.awk.
      
      * mail/summary.c (mail_summary): Fix data types of the counters.
      Sergey Poznyakoff authored
  20. 16 May, 2011 1 commit
    • * libmailutils/cfg/parser.y (STRTONUM, STRxTONUM)
      (GETSNUM, GETUNUM): Remove unused arguments.
      * libmailutils/stream/tcp.c (mu_tcp_stream_create_from_sa): Take
      care not to destroy sockaddr arguments in case of failure.
      Sergey Poznyakoff authored
  21. 31 Mar, 2011 2 commits
    • Bugfixes · d1e06eeb
      * libmailutils/filter/base64.c (_base64_encoder): Fix for the case
      when cmd==mu_filter_lastbuf and isize==0.
      
      * libmailutils/stream/tcp.c (mu_tcp_stream_create_with_source_ip)
      (mu_tcp_stream_create_with_source_host): Don't treat EAGAIN and
      EINPROGRESS as errors.
      * libproto/mailer/smtp.c (smtp_open): Free sockaddr if
      mu_tcp_stream_create_from_sa failed.
      * libproto/pop/mbox.c (pop_open): Likewise.
      * mu/imap.c (com_connect): Likewise.
      * mu/pop.c (com_connect): Likewise.
      Sergey Poznyakoff authored
    • * include/mailutils/cidr.h (MU_CIDR_FMT_SIMPLIFY): New format flag.
      * libmailutils/cidr/tostr.c (format_ipv6_bytes): Take additional
      argument, indicating whether to simplify the output.
      (format_ipv6_bytes_normal)
      (format_ipv6_bytes_simplified): New static functions.
      (mu_cidr_to_string): Select appropriate ipv6 printer depending on
      the MU_CIDR_FMT_SIMPLIFY bit.
      * libmailutils/tests/cidr.c (main): New options -s and -S
      Sergey Poznyakoff authored
  22. 30 Mar, 2011 5 commits
    • Sergey Poznyakoff authored
    • * am/enable.m4 (MU_ENABLE_BUILD): Take optional 6th argument.  If
      given, append $1 to it.
      * configure.ac: New options: --enable-build-servers and
      --enable-build-clients.
      Print a list of selected utilities at the end of the run.
      * README: Document new options.
      Sergey Poznyakoff authored
    • Bugfix · fca5c9e3
      * libmailutils/sockaddr/fromnode.c [!MAILUTILS_IPV6] Handle
      AF_UNSPEC same way as AF_INET.
      Do not bail out if service is not given, assume port = 0 instead.
      * mailutils/base/version.c (mu_conf_option): Reflect IPv6 support.
      Sergey Poznyakoff authored
    • * am/ipv6.m4: New file.
      * examples/sa.c: New file.
      * include/mailutils/cidr.h: New file.
      * include/mailutils/sockaddr.h: New file.
      * libmailutils/cidr/Makefile.am: New file.
      * libmailutils/cidr/fromsa.c: New file.
      * libmailutils/cidr/fromstr.c: New file.
      * libmailutils/cidr/match.c: New file.
      * libmailutils/cidr/tosa.c: New file.
      * libmailutils/cidr/tostr.c: New file.
      * libmailutils/sockaddr/Makefile.am: New file.
      * libmailutils/sockaddr/copy.c: New file.
      * libmailutils/sockaddr/create.c: New file.
      * libmailutils/sockaddr/free.c: New file.
      * libmailutils/sockaddr/fromnode.c: New file.
      * libmailutils/sockaddr/insert.c: New file.
      * libmailutils/sockaddr/ipaddr.c: New file.
      * libmailutils/sockaddr/str.c: New file.
      * libmailutils/sockaddr/unlink.c: New file.
      * libmailutils/sockaddr/url.c: New file.
      * libmailutils/tests/cidr.c: New file.
      
      * configure.ac: Call MU_ENABLE_IPV6.
      Build libmailutils/sockaddr and libmailutils/cidr.
      * examples/.gitignore: Add mblconv and sa
      * examples/Makefile.am: (noinst_PROGRAMS): Add sa.
      * examples/aclck.c: Use new ACL API.
      * examples/echosrv.c: Use new mserv API.
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Add cidr.h
      and sockaddr.h
      
      * include/mailutils/acl.h (mu_acl_append, mu_acl_prepend)
      (mu_acl_insert): Change signatures.
      * include/mailutils/debug.h (mu_sockaddr_to_str): Remove proto.
      * include/mailutils/mailutils.h: Include cidr.h and sockaddr.h
      * include/mailutils/server.h (mu_ip_server_create): Change signature.
      (mu_ip_server_get_sockaddr): Likewise.
      (mu_m_server_set_default_address)
      (mu_m_server_get_default_address): Remove.
      * include/mailutils/stream.h (mu_tcp_stream_create_from_sa): New proto.
      * include/mailutils/types.hin (mu_cidr, mu_sockaddr): New structs.
      
      * include/mailutils/url.h (MU_URL_IPV6): New flag.
      (MU_URL_PARSE_DSLASH_OPTIONAL): New parse flag.
      
      * libmailutils/Makefile.am: Descend into cidr and sockaddr. Link in
      libcidr and libsockaddr.
      * libmailutils/diag/debug.c (mu_debug_log_begin): Flush mu_strerr.
      * libmailutils/diag/errors (MU_ERR_NONAME)
      (MU_ERR_BADFLAGS,MU_ERR_SOCKTYPE)
      (MU_ERR_FAMILY,MU_ERR_SERVICE): New errors.
      
      * libmailutils/server/acl.c: Rewrite API using mu_cidr.
      * libmailutils/server/ipsrv.c: Rewrite AI using mu_sockaddr.
      * libmailutils/server/msrv.c: Likewise.
      * libmailutils/stream/tcp.c: Likewise.
      
      * libmailutils/tests/.gitignore: Add cidr.
      * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add cidr.
      * libmailutils/tests/url-parse.c: Support command line options
      to tune the parsing.
      * libmailutils/tests/url.at: Pass options to url-parse.
      * libmailutils/url/create.c (getkn): Return meaningful error code.
      (_mu_url_ctx_parse_host): Accept IPv6 addresses. Set the MU_URL_IPV6
      flag if one is given.
      (_mu_url_ctx_parse): Unless MU_URL_PARSE_DSLASH_OPTIONAL flag is
      given, request :// after scheme part.
      (mu_url_create): Add MU_URL_PARSE_DSLASH_OPTIONAL flag.
      
      * libmu_cfg/acl.c: Use new ACL API.
      * mu/acl.c: Likewise.
      
      * libproto/mailer/smtp.c (smtp_open): Use mu_tcp_stream_create_from_sa
      * libproto/pop/mbox.c (pop_open): Likewise.
      * mu/imap.c (com_connect): Likewise.
      * mu/pop.c (com_connect): Likewise.
      * testsuite/smtpsend.c (main): Likewise.
      Sergey Poznyakoff authored
    • * mh/tests/comp.at: Remove trailing whitespace before comparisons
      Sergey Poznyakoff authored
  23. 23 Mar, 2011 1 commit
    • * libmailutils/filter/c-escape.c: New file.
      * include/mailutils/filter.h (mu_c_escape_filter): New extern.
      * libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add c-escape.c
      * libmailutils/filter/filter.c (mu_filter_get_list): Add
      mu_c_escape_filter to the list.
      Sergey Poznyakoff authored
  24. 17 Mar, 2011 1 commit
    • * examples/mblconv.c (main): Return 0.
      * examples/murun.c (main): Fix iteration body.
      * imap4d/append.c: Do not pass constructed string as format
      argument to io_completion_response, use %s instead.
      * imap4d/close.c: Likewise.
      * imap4d/create.c: Likewise.
      * imap4d/delete.c: Likewise.
      * imap4d/rename.c: Likewise.
      * imap4d/status.c: Likewise.
      * libmailutils/base/mutil.c (mutil_parse_field_map): Fix return
      code in case of wordsplit failure.
      * libmailutils/cfg/parser.y (GETSNUM): Initialize sign.
      * libmailutils/stream/streamref.c (_streamref_ctl)
      <MU_IOCTL_SEEK_LIMITS>: Initialize lim.
      * libmailutils/string/wordsplit.c: Typecast format width arguments
      to int.
      * libmu_sieve/extensions/vacation.c (check_db): Initialize days.
      Pass correct time value to test_and_update_prop.
      * libproto/pop/mbox.c (pop_create_pop3_message): Fix return code.
      * mail/mail.c (do_and_quit): Pass the command to util_do_command
      via the %s format.
      * mail/unset.c (mail_unset): Likewise.
      * mh/mh_fmtgram.y (function production): LIkewise for mu_error.
      * mu/logger.c (mutool_logger): Fix return code in case
      of mu_stdstream_strerr_create failure.
      Sergey Poznyakoff authored
  25. 16 Mar, 2011 1 commit
    • Bugfixes. · 02634d3b
      * comsat/action.c (action_echo): Set omit_newline.
      * libmailutils/mailbox/mbx_default.c: Return 0 on success.
      Fix memory overrun.
      
      * libproto/mailer/smtp.c (smtp_open): Protect tls-related
      code with #ifdef WITH_TLS.
      * libproto/pop/mbox.c (pop_open): Likewise.
      * mu/imap.c (com_connect): Likewise.
      
      * mh/mhn.c (split_args): Preserve quotes.
      (mhn_compose_command): Handle type arguments (%a escape).
      (mhn_show_command): Likewise.
      (store_handler): Fix call to mh_getyn.
      (edit_mime): Pass typeargs to mhn_compose_command.
      Fix test for missing filename.
      * mh/tests/ali.at (ali04): The test wrongly assumed that the
      `root' group has some members.
      * mh/tests/folder.at: Always sort the output from find.
      * mh/tests/rmf.at: Likewise.
      * mh/tests/mhn.at: Likewise.
      Filter out timestamps from the tar output produced by mhn.
      
      * tests/testsuite.at (MH_SETUP): Define moreproc.
      * mh/tests/mhparam.at: Account for changes in mh_profile
      Sergey Poznyakoff authored
  26. 10 Mar, 2011 1 commit