1. 15 Jan, 2011 2 commits
    • * libmailutils/mime/attachment.c (_attachment_setup): Remove improper
      initialization of msg.
      (mu_message_encapsulate): Initialize info->msg.
      Sergey Poznyakoff authored
    • Previously implemented way of signal handling was unsafe because of
      the use of unsafe functions in signal handlers. It also allowed for
      recursive invocations of MU calls not supposed to handle recursion
      (such as mu_mailbox_expunge, for example). This changeset fixes it.
      
      * imap4d/imap4d.c (imap4d_child_signal_setup): Change signal set.
      (imap4d_mainloop): Set a jump point for signal handling.
      Restore default handling for SIGILL, SIGBUS, SIGFPE, SIGSEGV, SIGSTOP.
      (master_jmp): New variable.
      (imap4d_master_signal): New function.
      (main): Redo signal handling.
      * imap4d/imap4d.h (child_jmp): New extern.
      (imap4d_enter_critical,imap4d_leave_critical): New protos.
      * imap4d/signal.c (imap4d_master_signal): Move to imap4d.c
      (imap4d_enter_critical,imap4d_leave_critical): New functions.
      (imap4d_child_signal): Rewrite.
      
      * imap4d/append.c: Protect critical sections.
      * imap4d/bye.c: Likewise.
      * imap4d/close.c: Likewise.
      * imap4d/copy.c: Likewise.
      * imap4d/delete.c: Likewise.
      * imap4d/expunge.c: Likewise.
      * imap4d/rename.c: Likewise.
      * imap4d/select.c: Likewise.
      * imap4d/status.c: Likewise.
      
      * scheme/Makefile.am (sievemod_DATA): Add guimb.scmi.
      Sergey Poznyakoff authored
  2. 14 Jan, 2011 1 commit
  3. 09 Jan, 2011 1 commit
  4. 07 Jan, 2011 2 commits
    • * libmu_scm/mu_body.c (mu-body?): New function.
      * libmu_scm/mu_mailbox.c (mu-mailbox?): New function.
      * libmu_scm/mu_message.c (mu-message?): New function.
      * libmu_scm/mu_mime.c (mu-mime?): New function.
      * scheme/guimb.scmi (guimb-process-mailbox): guimb-message returns
      a message to be appended to the output mailbox.
      Sergey Poznyakoff authored
    • * libmu_scm/mailutils.scm.in: Move to libmu_scm/mailutils/mailutils.scm.in.
      Use the MAILUTILS_SCM_LIBRARY_ROOT environment variable to load
      libraries from the specified location (to be used in tests).
      
      * libmu_scm/mailutils/.gitignore: New file.
      * libmu_scm/mailutils/Makefile.am: New file.
      * libmu_scm/Makefile.am (SUBDIRS): Add mailutils
      (mailutils.scm): Remove goal and associated variables.
      
      * scheme/guimb.scmi: New file. Reincarnation of guimb.
      * scheme/Makefile.am: Build guimb from guimb.scmi.
      * scheme/sieve2scm.scmi (sieve-version): Use mu-package
      and mu-version global variables.
      
      * configure.ac (AC_CONFIG_FILES): Add libmu_scm/mailutils/Makefile.
      Sergey Poznyakoff authored
  5. 06 Jan, 2011 1 commit
  6. 02 Jan, 2011 1 commit
  7. 31 Dec, 2010 3 commits
    • Remove guimb. · 79d50145
      It was inoperational since 2009-03-27 and nobody complained, so it seems
      to not be reclaimed at all. FWIW, it will be easy to recreate it entirely
      in Scheme, should the need be.
      
      * guimb/.gitignore: Remove.
      * guimb/Makefile.am: Remove.
      * guimb/collect.c: Remove.
      * guimb/guimb.h: Remove.
      * guimb/main.c: Remove.
      * guimb/util.c: Remove.
      
      * Makefile.am (GUIMB_DIR): Remove.
      [MU_COND_LIBMU_SCM] (SCHEME_DIR): New variable.
      (SUBDIRS): Add SCHEME_DIR instead of GUIMB_DIR.
      * configure.ac (MU_GUILE_SIEVE_MOD_DATA): Remove substitution.
      (AC_CONFIG_FILES): Remove guimb and guimb/scm, add scheme
      
      * guimb/scm/.gitignore: move to scheme/.gitignore
      * guimb/scm/Makefile.am: move to scheme/Makefile.am
      * guimb/scm/README: move to scheme/README
      * guimb/scm/mimeheader.scm: move to scheme/mimeheader.scm
      * guimb/scm/numaddr.scm: move to scheme/numaddr.scm
      * guimb/scm/redirect.scm: move to scheme/redirect.scm
      * guimb/scm/reject.scm: move to scheme/reject.scm
      * guimb/scm/sieve-core.scm: move to scheme/sieve-core.scm
      * guimb/scm/sieve.scm.in: move to scheme/sieve2scm.scmi
      * guimb/scm/vacation.scm: move to scheme/vacation.scm
      Sergey Poznyakoff authored
    • * imap4d/sync.c (notify): Do not emit FETCH replies for recent
      messages.
      Sergey Poznyakoff authored
    • * imap4d/imap4d.c (idle_timeout): Initialize to the default value.
      (Needed for inetd mode)
      * imap4d/sync.c: Revamp table handling.
      Sergey Poznyakoff authored
  8. 30 Dec, 2010 1 commit
    • * include/mailutils/message.h (mu_message_quick_lines): New proto.
      (mu_message_set_lines): Change signature of the 2nd argument.
      * include/mailutils/sys/message.h (_mu_message) <lines>: Change
      signature.
      * libmailutils/diag/errors (MU_ERR_INFO_UNAVAILABLE): New error code.
      * libmailutils/mailbox/message.c (mu_message_set_lines): Change
      signature of the 2nd argument.
      (mu_message_lines): Update call to the _lines method.
      (mu_message_quick_lines): New function.
      * libproto/pop/mbox.c (_POP3_MSG_LINES): New flag.
      (_pop3_message)<message_lines>: New member.
      (pop_create_pop3_message): New function.
      (pop_scan): Use LIST to obtain scan listing.
      (pop_message_lines): New function.
      (pop_create_message): Set _lines method.
      (pop_get_message): Use pop_create_pop3_message.
      
      * mail/from.c (hdr_quick_lines): New function.
      (compile_headline): New escape %L
      
      * pop3d/capa.c (pop3d_capa): Show XLINES capability if
      configured.
      * pop3d/list.c (pop3d_list): Optionally output the number of
      lines in the message.
      * pop3d/pop3d.c (pop3d_xlines): New global.
      (pop3d_cfg_param): New statement "scan-lines".
      * pop3d/pop3d.h (pop3d_xlines): New extern.
      Sergey Poznyakoff authored
  9. 29 Dec, 2010 2 commits
  10. 28 Dec, 2010 5 commits
    • * libmailutils/url/create.c (_mu_url_create_internal): Fix
      parsing of the '|' shortcuts.
      * libmailutils/tests/url.at: Fix '|' test. Add 'prog://' test.
      
      * movemail/movemail.c (set_program_id): Call mu_stdstream_strerr_setup
      to flush changes.
      * frm/common.c: Minor changes
      Sergey Poznyakoff authored
    • * frm/common.c (select_message, msg_index): Remove; use action data instead.
      (action): Use action data to get the selection function and message index.
      (frm_scan): Pass these data in action closure.
      Sergey Poznyakoff authored
    • * imap4d/imap4d.h (util_format_attribute_flags): New prototype.
      * imap4d/sync.c: Rewrite using flag table to keep attribute flags,
      mu_mailbox_translate to convert uids to message numbers and
      MU_EVT_MAILBOX_MESSAGE_EXPUNGE event to report expunged messages.
      * imap4d/util.c  (_imap4d_attrlist): Remove \Recent
      (util_attribute_to_type): Handle \Recent separately.
      (util_format_attribute_flags): New function.
      (util_print_flags): Rewrite as an extra entry point to the above.
      
      mailboxes: New event MU_EVT_MAILBOX_MESSAGE_EXPUNGE.
      
      * include/mailutils/observer.h: Rearrange and partially rename
      event constants (all uses updated):
      MU_EVT_MESSAGE_APPEND   =>   MU_EVT_MAILBOX_MESSAGE_APPEND
      MU_EVT_AUTHORITY_FAILED =>   MU_EVT_FOLDER_AUTHORITY_FAILED
      (MU_EVT_MAILBOX_MESSAGE_EXPUNGE): New event.
      * libproto/mbox/mbox.c: Generate MU_EVT_MAILBOX_MESSAGE_EXPUNGE.
      * libproto/pop/mbox.c: Likewise.
      * libmailutils/base/amd.c: Likewise.
      Sergey Poznyakoff authored
    • * include/mailutils/sys/amd.h (_amd_message_append, amd_sort): New protos.
      * libmailutils/base/amd.c (amd_array_expand): Call memmove only if there is
      actually something to move.
      (_amd_message_append, amd_sort): New functions.
      * libproto/maildir/mbox.c (maildir_scan_dir): Append new messages to the
      end of the array, and sort it afterwards. This avoids unnecessary memory
      moves, which improves performance considerably, especially on large
      mailboxes.
      * libproto/mh/mbox.c (mh_scan0): Likewise.
      Sergey Poznyakoff authored
    • * libmu_sieve/extensions/vacation.c (build_mime): Remove superfluous seek.
      (test_and_update_prop): days==0 means "forever", i.e. send a replay to
      each user only once.
      (vacation_reply): If :file tag is given, treat the argument as the
      name of a file containing the reply message.
      (vacation_tags): Add "sender" and "file" tags.
      
      * libmu_sieve/extensions/moderator.c: Always unref transport stream
      after passing it to mu_stream_to_message.
      * maidag/lmtp.c: Likewise.
      * mh/mh_stream.c: Likewise.
      * mh/prompter.c: Likewise.
      * mh/burst.c (flush_stream): Remove extra unnref.
      * sieve/sieve.c: Likewise.
      * testsuite/smtpsend.c: Likewise.
      Sergey Poznyakoff authored
  11. 27 Dec, 2010 1 commit
  12. 25 Dec, 2010 2 commits
    • * libmu_auth/tls.c (_tls_ioctl): Fix typo (opcode used instead of
      code).
      * mu/filter.c (mutool_filter): Reference mu_strin to prevent it from
      destroying.
      * testsuite/smtpsend.c (main): Call mu_stdstream_setup.
      Sergey Poznyakoff authored
    • * libproto/pop/mbox.c (pop_close): Destroy the cached data.
      (pop_destroy): Avoid freeing the same data twice.
      (pop_body_get_stream,pop_body_size,pop_body_lines): Owner is mu_message_t.
      (pop_create_body): Change the owner of the created mu_body_t object.
      
      * movemail/movemail.c: Correctly close both mailboxes if unhandled errors
      occur.
      Sergey Poznyakoff authored
  13. 24 Dec, 2010 1 commit
  14. 23 Dec, 2010 10 commits
    • * libmailutils/base/list.c (list_itrctl): Accept mu_itrctl_set_direction
      and mu_itrctl_qry_direction even if mu_iterator_first has not been called
      yet.
      * movemail/movemail.c: Rewrite using iterators.
      
      * libmailutils/mailer/mailer.c (safe_address_create): Bugfix.
      Sergey Poznyakoff authored
    • * libmu_sieve/util.c (mu_sieve_error, mu_sieve_debug)
      (mu_sieve_log_action): Format location only if locus.mu_file
      is not NULL.
      Sergey Poznyakoff authored
    • * libmailutils/mailbox/mbxitr.c (mailbox_iterator)<backwards>: New member.
      (mbx_first): Position to the last message if itr->backwards is set.
      (mbx_next): Decrement index if itr->backwards is set.
      (mbx_finished_p): Take into account iteration direction.
      (mbx_itrctl): new method.
      (mu_mailbox_get_iterator): Set itrctl method.
      Sergey Poznyakoff authored
    • New configuration options allow to specify the maximum number of messages
      to be copied and control the actions of movemail when an error occurs while
      appending a message.
      
      * movemail/movemail.c (ONERROR_OPTION,MAX_MESSAGES_OPTION): New option codes.
      (options): New options --onerror and --max-messages.
      (max_messages_option, onerror_flags): New variable.
      (ONERROR_SKIP, ONERROR_DELETE, ONERROR_COUNT): New defines.
      (parse_opt): Handle ONERROR_OPTION.
      (cb_onerror): New callback.
      (movemail_cfg_param): New configuration statements: "max-messages"
      and "onerror".
      (move_message): Delete the message if ONERROR_DELETE is set.
      (main): Handle the limit on the number of processed messages and
      onerror flags.
      Use mu_mailbox_expunge instead of mu_mailbox_flush.  This preserves
      the attributes of not processed options (in case max_messages_option is
      not 0) and speeds up the things considerably, especially on huge
      mailboxes.
      Sergey Poznyakoff authored
    • Be more liberal when guessing sender and recipient names. Tolerate
      deviations from RFC822.
      
      * libmailutils/mailer/mailer.c (copy_fragment)
      (recover_email, safe_address_create): New functions.
      (_set_from, _set_to): Use safe_address_create.
      Sergey Poznyakoff authored
    • * frm/common.c [!HAVE_LIBFRIBIDI] (puts_bidi): Fix definition.
      * libproto/pop/mbox.c (pop_destroy): Fix coredump (occurred
      if the mailbox has not been scanned).
      Sergey Poznyakoff authored
    • * libmailutils/base/lcall.c (mu_parse_lc_all): Allow for arg==NULL.
      * mh/Makefile.am: Define mhlibdir.
      * mh/pick.y (match_header): Use sget accessors.
      * mh/repl.c: Accept -noquery silently.
      Sergey Poznyakoff authored
    • * mail/mail.h (mail_execute): Change signature. All callers updated.
      * mail/shell.c (expand_bang): Change signature.  Take the
      string to be expanded as the 2nd and the last command as 3rd arguments.
      Always allocate the return string, even if there's nothing to expand.
      (mail_execute): fix memory management.
      * mail/escape.c: Update.
      * mail/escape.c: Update calls to mail_execute.
      Sergey Poznyakoff authored
    • * libmu_sieve/util.c: Update.
      Sergey Poznyakoff authored
    • * libmailutils/stream/logstream.c (_log_ctl): Handle MU_IOCTL_SYSLOGSTREAM,
      pass it to the transport stream.
      * libmu_sieve/sieve.l (pop_source): Restore input_stream.
      * libmu_sieve/util.c (mu_sieve_error, mu_sieve_debug)
      (mu_sieve_log_action): Set location information on the errstream.
      Sergey Poznyakoff authored
  15. 22 Dec, 2010 7 commits
    • * sieve/tests/list.at: New file.
      * sieve/tests/Makefile.am (TESTSUITE_AT): Add list.at.
      * sieve/tests/testsuite.at: Include list.at.
      Sergey Poznyakoff authored
    • New parser accepts range specifications (mailbox.trace3-prot).
      mu_debug_format_spec outputs specs in the canonical form.
      
      * include/mailutils/debug.h (MU_DEBUG_LEVEL_RANGE): New macro.
      (mu_debug_set_category_level): Change return type to int.
      (mu_debug_get_category_level): New proto.
      * libmailutils/diag/debug.c (mu_debug_set_category_level): Change
      return type to int.
      (mu_debug_get_category_level): New function.
      (mu_debug_level_from_string): New function.
      (parse_spec): Accept range specification.  Negation at the start
      of spec implies 'proto'.
      (mu_debug_format_spec): Rewrite.
      
      * libmailutils/tests/debugspec.c: New file.
      * libmailutils/tests/debugspec.at: New file.
      * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add debugspec.
      (TESTSUITE_AT): add debugspec.at
      * libmailutils/tests/testsuite.at: Include debugspec.at.
      * libmailutils/tests/.gitignore: Add debugspec.
      
      * sieve/sieve.c: Do not advertise 'T' and 'P' arguments to --debug.
      (debug_level): Remove.
      (set_debug_level): Rewrite the handling of legacy debug specifiers 'TP'.
      Sergey Poznyakoff authored
    • * include/mailutils/types.hin (mu_debug_handle_t)
      (mu_debug_level_t): New data types.
      * include/mailutils/debug.h (mu_debug_level_p)
      (mu_debug_category_level)
      (mu_debug_set_category_level): Change argument types to
      mu_debug_handle_t/mu_debug_level_t.
      * libmailutils/diag/debug.c: Likewise.
      
      * libmailutils/server/acl.c (_run_entry): Call mu_debug_log_nl
      instead of mu_debug_log_end with an empty format string.
      
      * include/mailutils/sieve.h
      * libmailutils/filter/base64.c
      * libmailutils/stream/stream.c
      * libmu_sieve/conf.c
      * libmu_sieve/extensions/spamd.c
      * libmu_sieve/sieve.y
      * sieve/sieve.c: Commit the changes c522de11 failed to commit.
      Sergey Poznyakoff authored
    • * libmailutils/filter/iconvflt.c (_icvt_decoder): Do not iconv_close
      if cd is -1.
      * mh/mboxprop.c (mh_mailbox_get_cur): Ignore whitespace following the cur
      value.
      Sergey Poznyakoff authored
    • * libmu_sieve/extensions/pipe.c: Include sys/wait.h
      * testsuite/Makefile.am: Distribute testsuite.inc
      Sergey Poznyakoff authored
    • * include/mailutils/filter.h (MU_FILTER_MAX_AGAIN): Add a comment.
      * libmailutils/stream/fltstream.c (filter_read): Use
      mu_debug on the filter.error level, instead of plain mu_error.
      If the xcoder returns OK and does not consume all input when
      processing the last buffer, assume mu_filter_again.
      Fix loop condition.
      (filter_write_internal): Use
      mu_debug on the filter.error level, instead of plain mu_error.
      Sergey Poznyakoff authored
    • * include/mailutils/sieve.h (mu_sieve_debug_handle): New declaration.
      (mu_sieve_debug_init): New prototype.
      * libmu_sieve/conf.c (mu_sieve_debug_handle): New global.
      (mu_sieve_module_init): Call mu_sieve_debug_init.
      * libmu_sieve/extensions/spamd.c (spamd_connect_tcp)
      (spamd_connect_socket): Fix stream creation.
      (spamd_send_message): Switch to full buffering on the transport
      stream and indicate it is a payload (in case transcript is enabled),
      before copying data.  Restore things to their original state afterwards.
      (spamd_read_line): Rewrite using mu_stream_getline.
      (decode_float): Additional argument endp. Unless NULL, store there the
      position in the input string where the parsing has stopped.
      (parse_response_line): New function.
      (spamd_test): Rewrite using new API.
      * sieve/sieve.c (parser): --dry-run implies --verbose.
      
      * libmailutils/filter/base64.c (_base64_decoder): when not enough data
      are available and cmd is not mu_filter_lastbuf, return mu_filter_lastbuf.
      * libmailutils/stream/stream.c (mu_stream_shutdown): Flush the buffers before
      shutting the transport down.
      
      * libmailutils/tests/fltst.c (main): New option bufsize=
      Sergey Poznyakoff authored