Discussion:
[bug-mailutils] sieve: address: retriever failure: Malformed email address
Jean Louis
2016-12-25 11:26:27 UTC
Permalink
Dear Sergey,

I am using sieve, to sort thousands of emails.

And I get error:

sieve: /home/data1/protected/Documents/System Administration/save-by-from.sieve:2: address: retriever failure: Malformed email address

whereby save-by-from.sieve is:

require [ "fileinto", "variables" ];
if address :matches [ "from" ] "*" {
fileinto "~/Maildir/${1}";
}

Quite many mailboxes are not properly recognized for the from email
address.

However, bigger problem is that when the email address has status of
"mailformed", the messages becomes empty or appears 0 kilobytes in the
folder. The folders are however not empty, as I can see nice sizes
there.

Basically, the bodies of those not processed messages are
missing. So messages are probably lost and cannot be viewed in such
changed folder.

The program logic shall be changed, so that if email address is
"malformed" that messages are not tampered.

Example:

admin-> ls -l MBOX
-rw------- 1 admin admin 106847 Nov 7 2013 MBOX

I have 5 messages inside, all visible and readable by using mutt.

I process the mbox, and I get:

address: retriever failure: Malformed email address for each mailbox

Then again I can see that size of mbox did not considerably change:
-rw------- 1 admin admin 106517 Dec 25 14:23 MBOX

The email address in that mbox was:

From: TXSOS <***@sos.state.tx.us>

However, I can also see:

Return-Path: <***@sos.texas.gov>^M

with the ^M on the end, which I just think, maybe it is a problem?



Jean Louis
Sergey Poznyakoff
2016-12-25 16:19:42 UTC
Permalink
Post by Jean Louis
Dear Sergey,
I am using sieve, to sort thousands of emails.
sieve: /home/data1/protected/Documents/System Administration/save-by-from.sieve:2: address: retriever failure: Malformed email address
As far as I can tell, it was fixed by commit
9f1d5ced7ae7ba2489e5c3908b846f1c3f30889f.
That email is perfectly valid and sieve parses it without problems here.
Post by Jean Louis
with the ^M on the end, which I just think, maybe it is a problem?
If ^M appeared in the From header as well, then it could be. I will need
the entire header block to be sure.

Regards,
Sergey
Jean Louis
2016-12-25 19:13:18 UTC
Permalink
Hello,
Post by Sergey Poznyakoff
Post by Jean Louis
Dear Sergey,
I am using sieve, to sort thousands of emails.
sieve: /home/data1/protected/Documents/System Administration/save-by-from.sieve:2: address: retriever failure: Malformed email address
As far as I can tell, it was fixed by commit
9f1d5ced7ae7ba2489e5c3908b846f1c3f30889f.
I have tried latest pull, before this email, re-compiled, and I get
many of the same errors.

I am testing it now, when I see particular message, will let you know.

Jean
Jean Louis
2016-12-25 19:18:02 UTC
Permalink
This is one of addresses that is "malformed"

From: "craigslist - automated message, do not reply" <***@craigslist.org>
Sergey Poznyakoff
2016-12-25 19:28:46 UTC
Permalink
Hi Jean,
Post by Jean Louis
This is one of addresses that is "malformed"
No, it is perfectly valid - all mailutils programs process it normally.

Please note, that when you encounter anything wrong with the parsing of
any of email headers, it is not enough to just copy and paste the
offending value to the list -- most of the information in that case is
lost and your sample is actually devoid of any practical value. What is
needed in order to reproduce and analyze the case is the actual message
as it is stored in your mailbox. Since you are using maildir, you'd better
just tar or gzip the file in your cur subdirectory containing the offending
message and send it to me.

Regards,
Sergey
Jean Louis
2016-12-25 19:39:03 UTC
Permalink
Post by Sergey Poznyakoff
Post by Jean Louis
Dear Sergey,
I am using sieve, to sort thousands of emails.
sieve: /home/data1/protected/Documents/System Administration/save-by-from.sieve:2: address: retriever failure: Malformed email address
As far as I can tell, it was fixed by commit
9f1d5ced7ae7ba2489e5c3908b846f1c3f30889f.
I can confirm, that after testing from the latest git, the mbox-es get
totally destroyed basically. Messages appear to have 0 bytes in mutt,
as they are distorted. And they are not moved, due to the malformed
address.

The malformed address check shall be first, then the message should be
removed. I guess it is so. You may confirm it.

On the other hand, I am thinking, maybe the messages are not cut
correctly? Then the second message and all the subsequent could not be
recognized as such. Just an idea, not that I looked into the code (or
that I could).

Jean
Jean Louis
2016-12-25 19:14:46 UTC
Permalink
Post by Jean Louis
require [ "fileinto", "variables" ];
if address :matches [ "from" ] "*" {
fileinto "~/Maildir/${1}";
}
Is there a command to lowercase the ${1} ?

Is there are command to run the shell?

Jean
Sergey Poznyakoff
2016-12-25 19:22:48 UTC
Permalink
Post by Jean Louis
Is there a command to lowercase the ${1} ?
if address :matches [ "from" ] "*" {
set "recipient" :lower "${1}";
fileinto "~/Maildir/${recipient}";
}
Post by Jean Louis
Is there are command to run the shell?
See "pipe".

http://mailutils.org/manual/html_section/Extensions.html#pipe
http://mailutils.org/manual/html_section/Actions.html

Regards,
Sergey
Jean Louis
2016-12-25 20:35:27 UTC
Permalink
Oh, that is good one! Thank you.
Post by Jean Louis
Post by Jean Louis
Is there a command to lowercase the ${1} ?
if address :matches [ "from" ] "*" {
set "recipient" :lower "${1}";
fileinto "~/Maildir/${recipient}";
}
Post by Jean Louis
Is there are command to run the shell?
See "pipe".
http://mailutils.org/manual/html_section/Extensions.html#pipe
http://mailutils.org/manual/html_section/Actions.html
Regards,
Sergey
Loading...