Well,
I am back with 2 issues in vacation action. I include the (familiar)
program to reproduce them, a test mbox, as well as gdb backtraces. The
program is called as
$testsieve mbox:test.mbox filters.sieve
- The first has to do with the fact that temporary files created by
the vacation action in /tmp (files of the form /tmp/mu*) are not
unlinked. These files contain the message text sent in the body
of the produced mail message from MAILER-DAEMON (the argument to the
action). The relevant gdb backtrace is shown below.
---------- The temporary file that is not deleted -----------------------------
#0 mu_body_get_stream (body=0x8055f88, pstream=0xbfffdc08) at body.c:159
#1 0xb7dd5423 in build_mime (pmime=0xbfffdc68, msg=0x8054010,
text=0x804ff60 "I am on vacation. Yahoo!! \305\353\353\347\355\351\352\334
\352\341\351 \363\364\357 body...") at vacation.c:\
66
#2 0xb7dd5c38 in vacation_reply (mach=0x804b0f8, tags=0x8050098, msg=0x8054010,
text=0x804ff60 "I am on vacation. Yahoo!! \305\353\353\347\355\351\352\334
\352\341\351 \363\364\357 body...", to=0x8054738 "\
[EMAIL PROTECTED]",
from=0x80546c0 "[EMAIL PROTECTED]") at vacation.c:435
#3 0xb7dd609f in sieve_action_vacation (mach=0x804b0f8, args=0x80504e8,
tags=0x8050098) at vacation.c:539
#4 0xb7f7b0fa in instr_run (mach=0x804b0f8) at runtime.c:85
#5 0xb7f7b18f in instr_action (mach=0x804b0f8) at runtime.c:98
#6 0xb7f7b7c1 in sieve_run (mach=0x804b0f8) at runtime.c:283
#7 0xb7f7ba84 in mu_sieve_message (mach=0x804b0f8, msg=0x8054010) at
runtime.c:362
#8 0x0804902e in main (argc=3, argv=0xbfffde44) at testsieve.c:104
-------------------------------------------------------------------------------
As I can see the mu_body_get_stream creates the temporary file with a
call to mu_tempname() but this is never unlinked. I cannot tell with
certainty where it would be best to unlink the file, so I leave it up
to you to decide -:)
In earlier snapshots, I also experienced crashes in the vacation
action. I will stress test this snapshot to see if it exibits the same
behaviour.
- The second issue has to do with sending Greek text in the subject of
the vacation action. The subject becomes corrupted and is shown as
=?iso-8859-1?Q?<the greek text here>?= in mail clients (mutt and
gmail tested). Below is the backtrace
-------------------------- Greek subject -----------------------------------
#0 mu_rfc2047_encode (charset=0xb7dd9277 "iso-8859-1", encoding=0xb7dd92da
"quoted-printable",
text=0x804fef8 "\304\351\341\352\357\360\335\362 \341\353\334
\305\353\353\347\355\351\352\334...", result=0xbfffdc0c) at rfc\
2047.c:233
#1 0xb7dd5b86 in vacation_subject (mach=0x804b0f8, tags=0x8050098,
msg=0x8054010, newhdr=0x80551d0) at vacation.c:409
#2 0xb7dd5d0f in vacation_reply (mach=0x804b0f8, tags=0x8050098, msg=0x8054010,
text=0x804ff60 "I am on vacation. Yahoo!! \305\353\353\347\355\351\352\334
\352\341\351 \363\364\357 body...", to=0x8054738 "\
[EMAIL PROTECTED]",
from=0x80546c0 "[EMAIL PROTECTED]") at vacation.c:450
#3 0xb7dd609f in sieve_action_vacation (mach=0x804b0f8, args=0x80504e8,
tags=0x8050098) at vacation.c:539
#4 0xb7f7b0fa in instr_run (mach=0x804b0f8) at runtime.c:85
#5 0xb7f7b18f in instr_action (mach=0x804b0f8) at runtime.c:98
#6 0xb7f7b7c1 in sieve_run (mach=0x804b0f8) at runtime.c:283
#7 0xb7f7ba84 in mu_sieve_message (mach=0x804b0f8, msg=0x8054010) at
runtime.c:362
#8 0x0804902e in main (argc=3, argv=0xbfffde44) at testsieve.c:104
----------------------------------------------------------------------------
I can see that mu_rfc2047_encode is called with iso-8859-1 argument
and this creates the string in the subject. Any suggestions as to what
can fix the situation?
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;
mu_mailbox_t mbox;
size_t msgno, total = 0;
int status;
mu_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 = mu_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 ();
}
mu_sieve_set_debug_level (mach, debug, SIEVE_DEBUG_LEVEL);
}
status = mu_sieve_compile(mach,argv[2]);
if (status !=0) {
mu_error ("Error compile sieve script: %s", mu_strerror (status));
exit (EXIT_FAILURE);;
}
status = mu_mailbox_create(&mbox, argv[1]);
if (status != 0) {
mu_error ("mailbox_create: %s", mu_strerror (status));
exit (EXIT_FAILURE);
}
status = mu_mailbox_open(mbox, MU_STREAM_READ);
if (status != 0) {
mu_error ("mailbox_open: %s", mu_strerror (status));
exit (EXIT_FAILURE);
}
mu_mailbox_messages_count (mbox, &total);
for (msgno = 1; msgno <= total; msgno++) {
mu_message_t msg;
mu_header_t hdr;
mu_attribute_t attr;
if ((status = mu_mailbox_get_message (mbox, msgno, &msg)) != 0
|| (status = mu_message_get_header (msg, &hdr)) != 0) {
mu_error ("Error message: %s", mu_strerror (status));
exit (EXIT_FAILURE);
}
mu_message_get_attribute (msg, &attr);
mu_attribute_unset_deleted (attr);
if (mu_header_aget_value (hdr, MU_HEADER_FROM, &from))
from = strdup ("(NO FROM)");
if (mu_header_aget_value (hdr, MU_HEADER_SUBJECT, &subject))
subject = strdup ("(NO SUBJECT)");
status = mu_sieve_message(mach,msg);
if (status != 0)
mu_error ("Error sieve_message: %s", mu_strerror (status));
else
status = mu_attribute_is_deleted (attr) == 0;
printf ("\nFrom: %s\n Subject: %s\n Sieve flag: %d\n", from, subject,status);
free (from);
free (subject);
}
status = mu_mailbox_close (mbox);
if (status != 0) {
mu_error ("mailbox_close: %s", mu_strerror (status));
exit (EXIT_FAILURE);
}
mu_sieve_machine_destroy(&mach);
mu_mailbox_destroy (&mbox);
return 0;
}
>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.
#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;
}
_______________________________________________
Bug-mailutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-mailutils