Hello to the list.
I have a situation that causes a crash in mailutils (snapshot
20050623). I include the 
program I used (slightly modified of my previously used
version) which reads a mailbox and executes a sieve script over each
message, the test mailbox and the sieve script.
Also find attached the relevant backtrace from gdb.

Thanks,
Kostas 

-- 
  Kostas Zorbadelos
  Systems Designer/Developer, Otenet SA 
  [EMAIL PROTECTED] contact: kzorba (at) otenet.gr
  
  Out there in the darkness, out there in the night
  out there in the starlight, one soul burns brighter
  than a thousand suns.

/*------------------------------------------------------------------
 * testsieve.c
 * This program tests the functionality of the mailutils libraries,
 * specifically libmailbox and libsieve.
 *
 * The program expects as input a mailbox location and a file containing
 * a sieve script. It reads and runs the sieve script for each message of 
 * the mailbox in turn.
 ------------------------------------------------------------------*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include "mailutils/mailutils.h"

#define MU_DEBUG_LEVEL (MU_DEBUG_ERROR|MU_DEBUG_TRACE|MU_DEBUG_PROT|MU_SIEVE_DEBUG_TRACE)
#define SIEVE_DEBUG_LEVEL 0

int main(int argc, char* argv[]) {

  char *from;
  char *subject;
  mailbox_t mbox;
  size_t msgno, total = 0;
  int status;
  sieve_machine_t mach;
  mu_debug_t debug = NULL;


  /* Register the formats. */
  /* This supports mbox, maildir and mh */ 
  mu_register_local_mbox_formats();
  /*  mu_register_all_mbox_formats ();  */
  /* Register the mailer formats */
  mu_register_all_mailer_formats();

  /* Create the instance of the sieve machine */
  status = sieve_machine_init(&mach,NULL);
  if (status !=0) {
    mu_error ("Cannot initialize sieve machine: %s", mu_strerror (status));
    exit (EXIT_FAILURE);;
  }

  if (getenv ("MU_DEBUG"))
    {
      if ((status = mu_debug_create (&debug, mach)))
	{
	  mu_error ("mu_debug_create: %s", mu_strerror (status));
	  abort ();
	}
      if ((status = mu_debug_set_level (debug, MU_DEBUG_LEVEL)))
	{
	  mu_error ("mu_debug_set_level: %s", mu_strerror (status));
	  abort ();
	}
      sieve_set_debug_level (mach, debug, SIEVE_DEBUG_LEVEL);
    }

  status = sieve_compile(mach,argv[2]);
  if (status !=0) {
    mu_error ("Error compile sieve script: %s", mu_strerror (status));
    exit (EXIT_FAILURE);;
  }
  

  status = mailbox_create(&mbox, argv[1]);
  if (status != 0) {
    mu_error ("mailbox_create: %s", mu_strerror (status));
    exit (EXIT_FAILURE);
  }
  
  status = mailbox_open(mbox, MU_STREAM_READ);
  if (status != 0) {
    mu_error ("mailbox_open: %s", mu_strerror (status));
    exit (EXIT_FAILURE);
  }
  
  mailbox_messages_count (mbox, &total);
  
  for (msgno = 1; msgno <= total; msgno++) {

      message_t msg;
      header_t hdr;
      attribute_t attr;

      if ((status = mailbox_get_message (mbox, msgno, &msg)) != 0
	  || (status = message_get_header (msg, &hdr)) != 0) {
	mu_error ("Error message: %s", mu_strerror (status));
	exit (EXIT_FAILURE);
      }

      message_get_attribute (msg, &attr);
      attribute_unset_deleted (attr);
      
      if (header_aget_value (hdr, MU_HEADER_FROM, &from))
	from = strdup ("(NO FROM)");
      
      if (header_aget_value (hdr, MU_HEADER_SUBJECT, &subject))
	subject = strdup ("(NO SUBJECT)");


      status = sieve_message(mach,msg);
      if (status != 0)
	mu_error ("Error sieve_message: %s", mu_strerror (status));
      else
	status = attribute_is_deleted (attr) == 0;
      
      printf ("\nFrom: %s\n Subject: %s\n Sieve flag: %d\n", from, subject,status);
      free (from);
      free (subject);
  }
  
  status = mailbox_close (mbox);
  if (status != 0) {
    mu_error ("mailbox_close: %s", mu_strerror (status));
    exit (EXIT_FAILURE);
  }
  
  sieve_machine_destroy(&mach);
  mailbox_destroy (&mbox);
  return 0;
}

CC = gcc
CCOPTS = -Wall -pedantic -g  -ggdb -Wl,-R /usr/local/mailutils/lib
LIBS = -lmailbox -lmu_mbox -lmu_maildir -lmu_mh -lsieve
PATHS = -I /usr/local/mailutils/include -L /usr/local/mailutils/lib

default: all

all: testsieve 

testsieve: testsieve.c Makefile
        $(CC) $(CCOPTS) $(PATHS) -o testsieve testsieve.c $(LIBS)
#searchpath "/usr/local/mailutils/lib/mailutils"
require ["vacation","fileinto","redirect","reject"];

vacation :subject "I am on vacation"  "I am on vacation. Yahoo!!";

if header :contains "from" "[EMAIL PROTECTED]"
 {
  fileinto "xxx";
 }
elsif header :contains "from" "[EMAIL PROTECTED]"
 {
  reject "I do not accept mails from you...";
 }
elsif header :contains "from" "smaraf"
 {
  redirect "[EMAIL PROTECTED]";
 }
else
 {
  keep;
 }
>From [EMAIL PROTECTED] Fri Jun  3 18:36:03 2005
Return-Path: <[EMAIL PROTECTED]>
X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: from localhost (enigma.otenet.gr [127.0.0.1])
        by enigma.otenet.gr (Postfix) with ESMTP id A2939AA60C
        for <[EMAIL PROTECTED]>; Fri,  3 Jun 2005 18:36:03 +0300 (EEST)
Received: from noc.otenet.gr [195.170.0.29]
        by localhost with POP3 (fetchmail-6.2.5)
        for [EMAIL PROTECTED] (single-drop); Fri, 03 Jun 2005 18:36:03 +0300 
(EEST)
Received: from pinky.otenet.gr (pinky.otenet.gr [195.170.0.24])
        by noc.otenet.gr (8.13.4/8.13.4) with ESMTP id j53FXp3W015958
        for <[EMAIL PROTECTED]>; Fri, 3 Jun 2005 18:33:51 +0300 (EEST)
Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206])
        by pinky.otenet.gr (8.13.4/8.13.4/Debian-1) with ESMTP id j53FW1td018887
        for <[EMAIL PROTECTED]>; Fri, 3 Jun 2005 18:32:01 +0300
Received: by wproxy.gmail.com with SMTP id 57so975720wri
        for <[EMAIL PROTECTED]>; Fri, 03 Jun 2005 08:33:48 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        
h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        
b=VxABdWZPJFzSzBgjKdCVDAwp5As3r+FxvlJDeKJ3W/rY/LE+H00vTxgZgbuD6U87pxGkvjLV3rXX4TzuG1WjGupwvDr9q5/fRwAjQwDqmTGIE99gVdVDYj+pMOSSOxfCTL/3TcZWzot8ntVR4YSdX3Qa9PEcGyJTcidFbpMR4SU=
Received: by 10.54.78.16 with SMTP id a16mr1195422wrb;
        Fri, 03 Jun 2005 08:33:48 -0700 (PDT)
Received: by 10.54.67.6 with HTTP; Fri, 3 Jun 2005 08:33:48 -0700 (PDT)
Message-ID: <[EMAIL PROTECTED]>
Date: Fri, 3 Jun 2005 18:33:48 +0300
From: Smara Frementiti <[EMAIL PROTECTED]>
Reply-To: Smara Frementiti <[EMAIL PROTECTED]>
To: Kostas Zorbadelos <[EMAIL PROTECTED]>
Subject: SE THELO TORA
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
X-Spam-Status: No, score=0.4 required=4.5 tests=RCVD_BY_IP,SUBJ_ALL_CAPS 
        autolearn=no version=3.0.3
X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on bilbo.otenet.gr
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by noc.otenet.gr id 
j53FXp3W015958
X-UIDL: iW#"!i`N"!OaJ!!9c0"!
Status: RO
X-Status: A
Content-Length: 83
Lines: 3

ELA NA PIOYME KAFE MORO,EXEI TOSO ORAIA MERA KAI ISE KLEISMENOS EKEIIIIIIIIIIII!



>From [EMAIL PROTECTED] Thu Jun 30 12:33:25 2005
Return-Path: <[EMAIL PROTECTED]>
X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: from localhost (enigma.otenet.gr [127.0.0.1])
        by enigma.otenet.gr (Postfix) with ESMTP id 4AE80AA708
        for <[EMAIL PROTECTED]>; Thu, 30 Jun 2005 12:33:25 +0300 (EEST)
Received: from noc.otenet.gr [195.170.0.29]
        by localhost with POP3 (fetchmail-6.2.5)
        for [EMAIL PROTECTED] (single-drop); Thu, 30 Jun 2005 12:33:25 +0300 
(EEST)
Received: from diablo.otenet.gr (diablo.otenet.gr [195.170.0.33])
        by noc.otenet.gr (8.13.4/8.13.4) with ESMTP id j5U9VMWs004593
        for <[EMAIL PROTECTED]>; Thu, 30 Jun 2005 12:31:22 +0300 (EEST)
Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206])
        by diablo.otenet.gr (8.13.4/8.13.4/Debian-1) with ESMTP id 
j5U9UnUt020379
        for <[EMAIL PROTECTED]>; Thu, 30 Jun 2005 12:30:49 +0300
Received: by wproxy.gmail.com with SMTP id 71so57637wra
        for <[EMAIL PROTECTED]>; Thu, 30 Jun 2005 02:31:21 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        
h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        
b=Xq5cabjB0mAK4xR6qXZmy3OEBaKWvhfun/7JU/vjyDU6tj4h7auC89Fp6cxGJRW/IdbmCMcM5uPz5usrEgnrMwP/10oRrvmLbEcO557A2+9uCLnXNzWBq24SlH41RL8c4XAhD5HIeUveroTnwGQ+l+XC8p20uG33XK5gEeKa7yc=
Received: by 10.54.115.4 with SMTP id n4mr263578wrc;
        Thu, 30 Jun 2005 02:31:20 -0700 (PDT)
Received: by 10.54.22.29 with HTTP; Thu, 30 Jun 2005 02:31:20 -0700 (PDT)
Message-ID: <[EMAIL PROTECTED]>
Date: Thu, 30 Jun 2005 12:31:20 +0300
From: Kostas Zorbadelos <[EMAIL PROTECTED]>
Reply-To: Kostas Zorbadelos <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Test from gmail
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
X-Spam-Status: No, score=0.0 required=4.5 tests=RCVD_BY_IP autolearn=failed 
        version=3.0.3
X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on bilbo.otenet.gr
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by noc.otenet.gr id 
j5U9VMWs004593
X-UIDL: bKn"!;ej"!H7-"!pL>!!
Status: RO
Content-Length: 10
Lines: 3

Test it



>From [EMAIL PROTECTED] Tue Jul  5 16:21:27 2005
Return-Path: <[EMAIL PROTECTED]>
X-Original-To: kzorba
Delivered-To: [EMAIL PROTECTED]
Received: by enigma.otenet.gr (Postfix, from userid 1000)
        id 01539AA708; Tue,  5 Jul 2005 16:21:27 +0300 (EEST)
Date: Tue, 5 Jul 2005 16:21:26 +0300
From: Kostas Zorbadelos <[EMAIL PROTECTED]>
To: Kostas Zorbadelos <[EMAIL PROTECTED]>
Subject: Test
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.9i
Status: RO
Content-Length: 242
Lines: 10

Test
-- 
  Kostas Zorbadelos
  Systems Designer/Developer, Otenet SA 
  [EMAIL PROTECTED] contact: kzorba (at) otenet.gr
  
  Out there in the darkness, out there in the night
  out there in the starlight, one soul burns brighter
  than a thousand suns.


>From [EMAIL PROTECTED] Mon Jul 18 18:03:41 2005
Return-Path: <[EMAIL PROTECTED]>
X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: from localhost (enigma.otenet.gr [127.0.0.1])
        by enigma.otenet.gr (Postfix) with ESMTP id A8607AA709
        for <[EMAIL PROTECTED]>; Mon, 18 Jul 2005 18:03:41 +0300 (EEST)
Received: from noc.otenet.gr [195.170.0.29]
        by localhost with POP3 (fetchmail-6.2.5)
        for [EMAIL PROTECTED] (single-drop); Mon, 18 Jul 2005 18:03:41 +0300 
(EEST)
Received: from pinky.otenet.gr (pinky.otenet.gr [195.170.0.24])
        by noc.otenet.gr (8.13.4/8.13.4) with ESMTP id j6IF2wcZ013260;
        Mon, 18 Jul 2005 18:02:58 +0300 (EEST)
Received: from AIAS.hq.otenet.gr (smtp.hq.otenet.gr [212.205.69.161])
        by pinky.otenet.gr (8.13.4/8.13.4/Debian-1) with ESMTP id 
j6IF0ILT001222;
        Mon, 18 Jul 2005 18:00:18 +0300
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
        charset="iso-8859-7"
Subject: RE: Messaging project Current status
Date: Mon, 18 Jul 2005 18:02:55 +0300
Message-ID: <[EMAIL PROTECTED]>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Messaging project Current status
thread-index: AcWLqW98/OavCPX7QGuhm0sPusSLpgAAD0wg
From: "Papanikolaou Pandelis" <[EMAIL PROTECTED]>
To: "Kostas Zorbadelos" <[EMAIL PROTECTED]>,
        "Vassiliki Iakovou" <[EMAIL PROTECTED]>,
        "Costas Tavernarakis" <[EMAIL PROTECTED]>,
        "Dimitris Paouris" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Cc: "George Zacharoyiannis" <[EMAIL PROTECTED]>
X-Spam-Status: No, score=0.0 required=4.5 tests=none autolearn=failed 
        version=3.0.3
X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on bilbo.otenet.gr
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by noc.otenet.gr id 
j6IF2wcZ013260
X-UIDL: [EMAIL PROTECTED]"!iB(#!hb`"!
Status: RO
Content-Length: 2780

Efkairias dothousis akolouthoun ta minutes apo ti simerini sinantisi

Επικοινωνία με Hobson (εικαστικό)
Escalation για Συνοδινό
Escalation για Provisioning
Επικοινωνία με Product development για αλλαγή του configuration των clients του 
corpmail (webmail.domain.gr smtp.domain.gr pop.domain.gr)
Calendar Server/ Access Manager (Έχουμε προσφορές. Procurement process speedup)
Πρέπει να μας δώσουν το σχήμα της βάσης (follow up - dpaou)
Επικοινωνία με "Dialogos" αφού πάρουμε την πληροφορία από in-access (dpaou)
Detailed migration plan (15/8 - Papanikolaou)

Να μπει σαν consideration η υποστήριξη της υπηρεσίας και να ενημερωθούν οι 
εμπλεκόμενοι.


P.
 

> -----Original Message-----
> From: Kostas Zorbadelos [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 18, 2005 6:02 PM
> To: Vassiliki Iakovou
> Cc: Costas Tavernarakis; Dimitris Paouris; [EMAIL PROTECTED]; 
> [EMAIL PROTECTED]
> Subject: Re: Messaging project Current status
> 
> On Mon, Jul 18, 2005 at 05:23:29PM +0300, Vassiliki Iakovou wrote:
> > Synadelfoi,
> > 
> > epeidh prepei na fygw, please steilte moy merika bullets gia na 
> > symplhrwsw ayrio to prwi to Current status gia to Messaging project 
> > (gia thn evdomada 12/7 - 19/7)
> >
> 
> Sympliroste me opou xreiazetai
> 
> - Frontends
> Ksekinise i emploki tou Thanasi Liapi apo pleyras dieythynsis 
> Liva. Egine proti synantisi me Product Development, InAccess, 
> Etairikes Efarmoges kai emas. Stoxos i parakolouthisi tou 
> ergou. Egine synantisi me tous emporikous. Anamenoume apo 
> aytous perigrafi tou eikastikou gia na epikoinonithei stin 
> InAccess. To cool4u paramenei os exei, den ginetai KAMIA allagi.
> 
> - Development perivallon gia InAccess
> Exei stithei kai i InAccess ekane kapoia douleia me ayto mesa 
> stin evdomada. Dimiourgithikan provlimata pou prokalesan to 
> stisimo toy apo tin arxi ek neou.
> 
> - Provisioning
> Status unchanged, den exoume tipote apo tin pleyra tous (oute 
> ektimisi xronou). 
> 
> - Mda
> Proxora to development me vasi ton kodika tou mail.local ton 
> GNU mailutils. Sto telos tis trexousas evdomadas tha exoume 
> mia proti ekdosi pou tha douleyei.
> 
> - Migration
> Ayto to vazo gia na arxisei na yparxei sto status. Prepei na 
> ektimithoun oi enallaktikes kai to effort pou xreiazetai gia 
> tin kathe mia mexri 15 Aug.
> 
>  
> > thanks !!
> > 
> > --
> > Vassiliki Iakovou                           
> > Systems & Services Section
> > OTEnet S.A Internet Service Provider                
> > e-mail: [EMAIL PROTECTED]
> > tel.: +30-210-6151697
> > fax : +30-210-6151900
> > 
> 
> --
>   Kostas Zorbadelos
>   Systems Designer/Developer, Otenet SA
>   [EMAIL PROTECTED] contact: kzorba (at) otenet.gr
>   
>   Out there in the darkness, out there in the night
>   out there in the starlight, one soul burns brighter
>   than a thousand suns.
> 
> 



;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.

(gdb) n
vacation: 1: vacation compiled without DBM support. Ignoring :days tag

Program received signal SIGSEGV, Segmentation fault.
0x40113b3a in mallopt () from /lib/tls/libc.so.6
(gdb) bt
#0  0x40113b3a in mallopt () from /lib/tls/libc.so.6
#1  0x40113394 in calloc () from /lib/tls/libc.so.6
#2  0x40033278 in header_parse (header=0x805a5a0, 
    blurb=0x805a710 "Subject: 
=?iso-8859-1?Q?I_am_on_vacationtenet.gr>\nX-Spam-Status: No, 
score=0.A\001?=p<[EMAIL PROTECTED]<[EMAIL PROTECTED] tests=none 
autolearn=failed \n\tversion=3.0.3\nX-Spam-Checker-Version: SpamAssassin 3.0.3 
(2005-04-27) on bilbo"..., len=525) at header.c:155
#3  0x40033926 in header_set_value (header=0x805a5a0, 
    fn=0x4023714f "Subject", 
    fv=0x805b9a0 "=?iso-8859-1?Q?I_am_on_vacationtenet.gr>\nX-Spam-Status: No, 
score=0.A\001?=p<[EMAIL PROTECTED] tests=none autolearn=failed 
\n\tversion=3.0.3\nX-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on 
bilbo.otenet.g"..., replace=0) at header.c:398
#4  0x40233ab4 in vacation_subject (mach=0x804b0f8, tags=0x80500c8, 
    msg=0x8059a80, newhdr=0x805a5a0) at vacation.c:416
#5  0x40233bef in vacation_reply (mach=0x804b0f8, tags=0x80500c8, 
    msg=0x8059a80, text=0x80504c8 "I am on vacation. Yahoo!!", 
    to=0x8058990 "[EMAIL PROTECTED]", 
    from=0x8054740 "[EMAIL PROTECTED]") at vacation.c:452
#6  0x40233f7f in sieve_action_vacation (mach=0x804b0f8, args=0x804fed8, 
    tags=0x80500c8) at vacation.c:541
#7  0x40083efa in instr_run (mach=0x804b0f8) at runtime.c:85
#8  0x40083f8f in instr_action (mach=0x804b0f8) at runtime.c:98
#9  0x400845c1 in sieve_run (mach=0x804b0f8) at runtime.c:283
#10 0x40084884 in sieve_message (mach=0x804b0f8, msg=0x8059a80)
    at runtime.c:362
#11 0x0804904c in main (argc=3, argv=0xbffff994) at testsieve.c:104
(gdb) 




_______________________________________________
Bug-mailutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-mailutils

Reply via email to