1. 06 Nov, 2011 1 commit
  2. 05 Nov, 2011 3 commits
    • * pop3d/pop3d.c (pop3d_mainloop): start in AUTHORIZATION if tls
      is established.
      Sergey Poznyakoff authored
    • * .gitmodules: Add imprimatur.
      * Makefile.am: Likewise.
      * configure.ac: Likewise.
      * doc/Makefile.am: Likewise.
      * bootstrap.conf: Comment out make in doc/texinfo
      * doc/texinfo/Makefile.am: Rewrite.
      * doc/texinfo/fdl.texi: Minor change.
      * doc/texinfo/getdate.texi: Minor change.
      * doc/texinfo/mailutils.texi: begin rewrite.
      * doc/texinfo/mu-mh.texi: Minor change.
      * doc/texinfo/programs.texi: begin rewrite.
      * doc/texinfo/sieve.texi: Minor change.
      * doc/texinfo/usage.texi: Minor change.
      
      * libmailutils/cfg/lexer.l: Allow for @ in unquoted strings
      * pop3d/bulletin.c: Relax safety checks for bulletin.db
      * pop3d/logindelay.c: Relax safety checks for stat.sb
      * pop3d/pop3d.h (DEFAULT_GROUP_DB_SAFETY): New define.
      Sergey Poznyakoff authored
  3. 04 Nov, 2011 4 commits
    • * libproto/pop/mbox.c (pop_scan): Make sure MU_EVT_MESSAGE_ADD is delivered
      when it is already possible to retrieve the message.
      * mail/mail.c (default_setup) <headline>: Use %L instead of %l.
      
      * mu/logger.c (logger_options)<priority>: Minor fix.
      Sergey Poznyakoff authored
    • * comsat/comsat.c (comsat_prefork,comsat_connection): Change signatures.
      * imap4d/imap4d.c: Implement imaps.
      * imap4d/imap4d.h (io_setio): Change signature.
      (tls_encryption_on): New proto.
      * imap4d/io.c (io_setio): Change signature.  Initialize TLS stream if
      requested.
      * imap4d/starttls.c (tls_encryption_on): New function.
      * include/mailutils/server.h (mu_srv_config): New struct.
      (mu_m_server_conn_fp, mu_m_server_prefork_fp): Remove typedefs.
      (mu_m_server_handler_fp): New typedef.
      (mu_m_server_set_conn): Change signature.
      (mu_m_server_set_prefork): Change signature.
      (mu_m_server_set_app_data_size)
      (mu_m_server_set_config_size): New prototype.
      (mu_m_server_cfg_init): Change signature.
      * include/mailutils/tls.h (mu_init_tls_libs): Change signature.
      * lib/tcpwrap.c: Include tcpwrap.h
      (mu_tcp_wrapper_daemon): Fix declaration.
      (mu_tcp_wrapper_prefork): Change signature.
      * lib/tcpwrap.h (mu_tcp_wrapper_prefork): Change signature
      * libmailutils/server/msrv.c (_mu_m_server) <conn,prefork>: Change
      data type.  All uses updated.
      <app_data_size>: New member.
      (m_srv_config): Remove struct.  Replaced with mu_srv_config from tls.h
      (mu_m_server_set_conn): Change signature.
      (mu_m_server_set_prefork): Change signature.
      (mu_m_server_set_app_data_size)
      (mu_m_server_set_config_size): New functions.
      (add_server): Allocate app_data_size additional bytes of data.
      (mu_m_server_cfg_init): Take one argument.
      * libmu_auth/tls.c (mu_tls_module_init): Update call to mu_init_tls_libs.
      Don't call mu_file_safety_check with NULL argument.
      (mu_init_tls_libs): Rewrite.  Prepare x509 here, instead of
      doing it each time a TLS stream is created.
      (mu_deinit_tls_libs): Free x509, if exists.
      (_tls_server_open): Update call to mu_init_tls_libs.
      Remove x509 initialization.
      * libmu_cfg/tls.c (cb2_safety_checks): Fix typos.
      * maidag/lmtp.c (lmtp_connection): Change signature.
      * maidag/maidag.c (main): Update call to mu_m_server_cfg_init.
      * maidag/maidag.h (lmtp_connection): Change signature.
      * pop3d/extra.c (pop3d_setio): Initialize TLS stream, if requested.
      * pop3d/pop3d.c: Implement pops.
      * pop3d/pop3d.h (pop3d_setio): Change prototype.
      Sergey Poznyakoff authored
    • * include/mailutils/sys/tls-stream.h (_mu_tls_stream_s): Remove.
      * libmailutils/diag/errors (MU_ERR_BAD_RESUMPTION): Remove. Use EAGAIN
      instead.
      (MU_ERR_DISABLED): New error code.
      * libmu_auth/tls.c (_tls_server_open): Return MU_ERR_DISABLED
      when needed.
      (_mu_tls_stream_create): Implement error_string method.
      * libproto/maildir/mbox.c (maildir_msg_init): Fix return value.
      Sergey Poznyakoff authored
    • Remove --tls option.  Make TLS stream open methods call mu_init_tls_libs.
      It is now not necessary to call this function explicitly, unless the
      application wishes to ensure TLS is initialized (e.g. pop3d or imap4d).
      
      * include/mailutils/libargp.h (mu_tls_cmdline): Remove.
      * libmu_argp/tls.c
      * libmu_argp/Makefile.am (libmu_argp_a_SOURCES): Remove tls.c
      * libmu_argp/cmdline.c (all_cmdline_capa): Remove tls.c
      * libmu_auth/tls.c [WITH_TLS] (mu_tls_module_config): Enable by default.
      (mu_check_tls_environment): Return 0 if TLS is disabled.
      (mu_init_tls_libs): Always call gnutls_global_init, otherwise any call
      to TLS library (especially, handshake) can produce a coredump.
      * libmu_cfg/tls.c: Fix description string for tls.enable.
      * mh/mh_init.c (mh_init): Remove call to mu_init_tls_libs, now unnecessary.
      * python/libmu_py/registrar.c: Likewise.
      * testsuite/smtpsend.c: Likewise.
      Sergey Poznyakoff authored
  4. 01 Nov, 2011 4 commits
  5. 31 Oct, 2011 2 commits
    • * include/mailutils/cctype.h (mu_isblank): Use mu_c_is_class.
      * libmailutils/string/muctype.c (mu_c_tab): Mark ' ' and '\t' as
      MU_CTYPE_BLANK.
      Sergey Poznyakoff authored
    • Fixes following bugs:
      
      1. In whitespace-must-follow mode a comment sequence immediately followed
      by a newline caused the next line to be treated as a comment.  Thus the
      following input:
      
      ;
      text
      
      produced empty output (see test icmt-dec-08).
      
      2. Line number information was not emitted before lines starting
      with a comment sequence substring, e.g.:
      
      ; comment
      ;valid line
      
      See test icmt-dec-09.
      
      * libmailutils/filter/inline-comment.c (ilcmt_state)
      Withdraw ilcmt_rollback_com state, use ilcmt_rollback instead.
      Withdraw ilcmt_newline_ac state, use ILCMT_EMIT_LINE_INFO flag instead.
      (ILCMT_EMIT_LINE_INFO): New flag.
      (ilcmt_data) <replay>: Remove.
      <rollback_buffer, rollback_size>
      <rollback_index>: New members.
      (init_rollback): New function.
      (_ilcmt_decoder): Use ilcmt_rollback state.
      <ilcmt_comment_ws>: Do not skip newline following the comment.  Emit
      line info before rolling back, if required.
      (_ilcmt_encoder): Use ilcmt_rollback state.
      * libmailutils/tests/inline-comment.at: Rename tests.
      Add tests for newline after a comment (icmt-dec-08) and
      line info with whitespace-follow mode (icmt-dec-09).
      Sergey Poznyakoff authored
  6. 29 Oct, 2011 2 commits
    • Sergey Poznyakoff authored
    • * libmailutils/diag/errors (MU_ERR_TCP_NO_HOST)
      (MU_ERR_TCP_NO_PORT): Change wording.
      (MU_ERR_UNSAFE_PERMS): Remove error code.
      (MU_ERR_NO_HANDLER): Remove. All uses replaced by ENOSYS.
      (MU_ERR_OUT_NULL): Remove. MU_ERR_OUT_PTR_NULL is used instead.
      (MU_ERR_MBX_NULL): Remove. Use EINVAL instead.
      (MU_ERR_BAD_822_FORMAT): Rename to MU_ERR_INVALID_EMAIL. Change wording.
      (MU_ERR_REPLY): Change wording.
      
      * libmailutils/url/create.c: Remove misguiding comments
      * libmailutils/url/set-service.c: Likewise.
      
      * libmailutils/mailbox/mailbox.c (mu_mailbox_open): Return EACCES
      if trying to update quick-access mailboxes.
      (mu_mailbox_get_stream): Mark for deletion.
      * libmailutils/stream/fltstream.c (filter_read)
      (filter_write_internal): Return MU_ERR_BUFSPACE if requested more
      space than available in I/O buffers.
      * libproto/mbox/mbox.c (mbox_expunge_unlocked): Send MU_EVT_MAILBOX_CORRUPT
      event if the mailbox shrunk.
      * libproto/mbox/mboxscan.c (mbox_scan_internal): Return MU_ERR_NOENT if
      unable to locate message in quick-access mode.
      Sergey Poznyakoff authored
  7. 28 Oct, 2011 2 commits
    • * include/mailutils/dbm.h (mu_dbm_init)
      (mu_dbm_get_hint): New prototypes.
      * include/mailutils/util.h (mu_stpcpy)
      (mu_file_safety_compose): New prototypes.
      * libmailutils/string/Makefile.am (libstring_la_SOURCES): Add stpcpy.c
      * libmailutils/string/stpcpy.c: New file.
      * libmu_cfg/tls.c (cb2_safety_checks): Use mu_file_safety_compose.
      * libmu_dbm/create.c (mu_dbm_create): Use mu_dbm_init.
      * libmu_dbm/dbm.c (_mu_dbm_init): Rename mu_dbm_init. All uses changed.
      Use URL composing interface to create hints.
      * maidag/maidag.c (mu_dbm_get_hint): New function.
      * pop3d/pop3d.c (cb2_forward_file_checks): Use mu_file_safety_compose.
      (apop_database_name, apop_database_safety)
      (apop_database_safety_set): New variables.
      (pop3d_cfg_param) <apop-database-file>
      <apop-database-safety>: New configuration statements.
      (main) [ENABLE_DBM]: Initialize dbm safety criteria.
      * pop3d/apop.c (pop3d_apopuser): Use configured database name and
      safety flags, if set.
      * pop3d/pop3d.h [ENABLE_DBM] (APOP_PASSFILE): Add ".db" suffix.
      (apop_database_name, apop_database_safety)
      (apop_database_safety_set): New variables.
      Sergey Poznyakoff authored
    • * include/mailutils/url.h (mu_url_sget_name)
      (mu_url_aget_name,mu_url_get_name)
      (mu_url_invalidate,mu_url_create_null)
      (mu_url_set_user,mu_url_set_path,mu_url_set_scheme)
      (mu_url_set_host,mu_url_set_port,mu_url_set_service)
      (mu_url_set_auth,mu_url_set_secret,mu_url_add_param)
      (mu_url_clear_param,mu_url_add_query,mu_url_clear_query): New
      prototypes.
      
      * libmailutils/tests/url-comp.at: New test case.
      * libmailutils/tests/url-comp.c: New test program.
      * libmailutils/tests/.gitignore: Update.
      * libmailutils/tests/Makefile.am: Add new files.
      * libmailutils/tests/testsuite.at: Add new tests.
      
      * libmailutils/url/Makefile.am: Add new files.
      * libmailutils/url/add-param.c: New file.
      * libmailutils/url/add-query.c: New file.
      * libmailutils/url/clr-param.c: New file.
      * libmailutils/url/clr-query.c: New file.
      * libmailutils/url/null.c: New file.
      * libmailutils/url/set-auth.c: New file.
      * libmailutils/url/set-host.c: New file.
      * libmailutils/url/set-path.c: New file.
      * libmailutils/url/set-port.c: New file.
      * libmailutils/url/set-scheme.c: New file.
      * libmailutils/url/set-secret.c: New file.
      * libmailutils/url/set-service.c: New file.
      * libmailutils/url/set-user.c: New file.
      * libmailutils/url/urlinv.c: New file.
      
      * libmailutils/url/create.c (mu_url_create_hint): Return EINVAL if
      purl is NULL.
      * libmailutils/url/scheme.c (mu_url_set_scheme): Remove. See set-scheme.c
      * libmailutils/url/urlstr.c (mu_url_sget_name)
      (mu_url_aget_name,mu_url_get_name): New functions.
      (mu_url_to_string): Rewrite using the above.
      
      * libmailutils/base/Makefile.am: Add fscompose.c
      * libmailutils/base/fscompose.c: New file.
      Sergey Poznyakoff authored
  8. 27 Oct, 2011 1 commit
  9. 25 Oct, 2011 2 commits
    • Sergey Poznyakoff authored
    • * lib/mu_dbm.c: Remove.
      * lib/mu_dbm.h: Remove.
      * lib/Makefile.am: Remove mu_dbm.[ch].
      * include/mailutils/sys/dbm.h: New file.
      * include/mailutils/sys/Makefile.am: Add dbm.h
      * include/mailutils/dbm.h: New file.
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Add dbm.h.
      * include/mailutils/types.hin (mu_dbm_file_t): New data type.
      
      * libmu_dbm/Makefile.am: New file.
      * libmu_dbm/berkeley.c: New file.
      * libmu_dbm/close.c: New file.
      * libmu_dbm/create.c: New file.
      * libmu_dbm/datumfree.c: New file.
      * libmu_dbm/dbm.c: New file.
      * libmu_dbm/delete.c: New file.
      * libmu_dbm/destroy.c: New file.
      * libmu_dbm/errstr.c: New file.
      * libmu_dbm/fetch.c: New file.
      * libmu_dbm/firstkey.c: New file.
      * libmu_dbm/gdbm.c: New file.
      * libmu_dbm/mudbm.h: New file.
      * libmu_dbm/ndbm.c: New file.
      * libmu_dbm/nextkey.c: New file.
      * libmu_dbm/open.c: New file.
      * libmu_dbm/safety.c: New file.
      * libmu_dbm/store.c: New file.
      
      * Makefile.am [MU_COND_DBM]: Define LIBMU_DBM_DIR
      (SUBDIRS): Add $(LIBMU_DBM_DIR)
      * configure.ac: Revamp DBM support: several database types can
      be specified at once.
      (AC_CONFIG_FILES): Build libmu_dbm/Makefile
      
      * libmu_sieve/extensions/vacation.c: Remove inclusion of mu_dbm.h.
      * maidag/Makefile.am (maidag_LDADD): Add DBM libraries.
      * maidag/maidag.c: ENABLE_DBM instead of USE_DBM
      * maidag/maidag.h: Include <mailutils/dbm.h> instead of mu_dbm.h.
      * maidag/mailquota.c (dbm_retrieve_quota): Rewrite using libmu_dbm
      library calls.
      * mu/Makefile.am [MU_COND_DBM]: Define DBM_C.
      (MODULES): Add $(DBM_C).
      (AM_CPPFLAGS): Define DBMLIBS.
      * mu/ldflags.c (NEEDAUTH): Change definition.
      (lib_descr) <weight>: New member. All uses changed.
      (add_entry): Null arguments ignored.
      (mutool_ldflags): Rewrite traversal of lib_descr.
      * mu/dbm.c: New file.
      
      * pop3d/Makefile.am (pop3d_LDADD, popauth_LDADD): Add DBM libraries.
      * pop3d/apop.c: Rewrite using libmu_dbm library calls.
      * pop3d/bulletin.c: Likewise.
      * pop3d/logindelay.c: Likewise.
      * pop3d/pop3d.c: Change USE_DBM to ENABLE_DBM.
      * pop3d/pop3d.h: Include mailutils/dbm.h instead of mu_dbm.h
      * pop3d/popauth.c: Rewrite using libmu_dbm library calls.
      
      * include/mailutils/cctype.h (MU_CTYPE_ENDLN): New character class.
      (mu_isendln): New macro.
      * libmailutils/string/muctype.c (mu_c_tab): Mark \r and \n as
      MU_CTYPE_ENDLN.
      Sergey Poznyakoff authored
  10. 24 Oct, 2011 2 commits
  11. 23 Oct, 2011 2 commits
  12. 22 Oct, 2011 2 commits
    • * comsat/comsat.c (main): Use real UID to determine user name. Don't
      rely on environment variables.
      * maidag/util.c (maidag_error): Re-initialize va_list before reusing it.
      * mh/ali.c (ali_print_name_list): Change printing loop to correctly
      handle empty lists.
      * mh/mh_whatnow.c (quit): Print newline before returning.
      
      * comsat/tests/testsuite.at: Skip tests if run as root.
      * maidag/tests/forward.at: Skip test if run as root.
      * mh/tests/ali.at: Ignore comment lines in /etc/passwd and /etc/group.
      Make sure awk is run with a valid stdin.  Some implementations
      (true awk, in particular) try to close stdin even if it is not used and
      bail out if unable to do so.
      * mh/tests/atlocal.in (mimeflt): Make sure awk is run with a valid
      stdin (see above).
      * mh/tests/anno.at: Always use semicolon before closing curly brace in
      sed expressions.
      * mh/tests/mark.at: Likewise.
      * mh/tests/pick.at: Likewise.
      * testsuite/testsuite.inc: Likewise.
      * mh/tests/comp.at: Reflect changes to mh_whatnow.c.
      * mh/tests/mhn.at: Don't rely on a particular tar output format.
      Sergey Poznyakoff authored
    • * include/mailutils/attribute.h (MU_STATUS_BUF_SIZE): Add more status letters.
      * libmailutils/mailbox/attribute.c (flagtrans): Keep the same ordering as
      in attribute.h.  Add missing attributes.
      
      * imap4d/select.c (imap4d_select_status): All flags are now permanent.
      * imap4d/testsuite/imap4d/IDEF0955.exp: Reflect changes in PERMANENTFLAGS.
      * imap4d/testsuite/imap4d/IDEF0956.exp: Likewise.
      * imap4d/testsuite/imap4d/append.exp: Likewise.
      * imap4d/testsuite/imap4d/create.exp: Likewise.
      * imap4d/testsuite/imap4d/examine.exp: Likewise.
      * imap4d/testsuite/imap4d/expunge.exp: Likewise.
      * imap4d/testsuite/imap4d/fetch.exp: Likewise.
      * imap4d/testsuite/imap4d/search.exp: Likewise.
      Sergey Poznyakoff authored
  13. 21 Oct, 2011 3 commits
  14. 20 Oct, 2011 2 commits
    • * include/mailutils/message.h (MU_MSG_ATTRIBUTE_MODIFIED)
      (MU_MSG_HEADER_MODIFIED,MU_MSG_BODY_MODIFIED): New flags.
      * libmailutils/mailbox/message.c (mu_message_is_modified): Return
      a bitmask from the above values.
      * libmailutils/property/create.c (mu_property_create_init): Return
      error code.
      
      * include/mailutils/sys/amd.h (_amd_data) <chattr_msg>
      <capabilities, prop>: New members.
      <uidvalidity>: Remove.
      * libmailutils/base/amd.c: Use MH-style proplist to keep
      the mailbox properties: uidvalidity, last uid and to
      cache its size.
      Store message attributes in the message header only if the
      mailbox implementation is unable to keep them elsewhere.
      Use chattr_msg method (if provided) to flush changes in
      message attributes.
      
      * libproto/maildir/folder.c (_maildir_list_p): Ignore .mh* and .mu* files.
      * libproto/mh/folder.c (_mh_list_p): Likewise.
      * libproto/maildir/mbox.c: Implement all Maildir flags (except P).
      Implement the chattr_msg method.
      * libproto/mh/mbox.c: Remove special handling for uidvalidity.
      * mh/tests/folder.at: Ignore .mu-prop in directory listings.
      Sergey Poznyakoff authored
    • * libmu_cfg/tls.c (cb2_safety_checks): Fix handling of "all" and "none".
      * maidag/maidag.c (cb2_forward_file_checks): Likewise.
      * maidag/forward.c (maidag_forward): Handle MU_ERR_EXISTS return properly.
      Sergey Poznyakoff authored
  15. 18 Oct, 2011 1 commit
  16. 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
  17. 16 Oct, 2011 2 commits
  18. 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
  19. 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
  20. 09 Sep, 2011 1 commit