Discussion:
BAD Missing or invalid argument to APPEND
Robert Hardy
2010-01-12 00:49:43 UTC
Permalink
I get the error message "BAD Missing or invalid argument to APPEND" from my
mail clients (Profimail 3.25 and I think alpine 2.00 too) when sending a
message and it's saving in sent-mail. I tried upgrading to imap-2007e from
imap-2007b but this hasn't helped.

Can someone tell me if this is a server bug or a client bug, what is wrong
and ideally how to fix it?

Regards,
Rob
Robert Hardy
2010-01-12 01:09:52 UTC
Permalink
Post by Robert Hardy
I get the error message "BAD Missing or invalid argument to APPEND" from my
mail clients (Profimail 3.25 and I think alpine 2.00 too) when sending a
message and it's saving in sent-mail. I tried upgrading to imap-2007e from
imap-2007b but this hasn't helped.
Can someone tell me if this is a server bug or a client bug, what is wrong
and ideally how to fix it?
To clarify this only happens rarely with certain messages. Once it happens
with a particular message I can't ever save that message to sent-mail.

I tried to include an attached IMAP trace from Profimail but it seemed to get
striped by the mailing list.

Here is the text inline with the names/addresses changed to protect the
innocent:

Connect
Connection already active, using it
Socket opened
Connect to host mail.mydomain.ca:993
Connect to IP mail IP addr
Connected: mail.mydomain.ca:993
Init SSL
SSL inited
SSL handshake done
* OK [CAPABILITY IMAP4REV1 I18NLEVEL=1 LITERAL+ SASL-IR LOGIN-REFERRALS AUTH=PLAIN AUTH=LOGIN] mail.mydomain.ca IMAP4rev1 2007b.404 at Mon, 11 Jan 2010 15:34:59 -0500 (EST)
:> 1 CAPABILITY
* CAPABILITY IMAP4REV1 I18NLEVEL=1 LITERAL+ IDLE UIDPLUS NAMESPACE CHILDREN MAILBOX-REFERRALS BINARY UNSELECT ESEARCH WITHIN SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND SASL-IR LOGIN-REFERRALS AUTH=PLAIN AUTH=LOGIN
1 OK CAPABILITY completed
:> <login command sent>
2 OK [CAPABILITY IMAP4REV1 I18NLEVEL=1 LITERAL+ IDLE UIDPLUS NAMESPACE CHILDREN MAILBOX-REFERRALS BINARY UNSELECT ESEARCH WITHIN SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND] User rhardy authenticated
:> 3 APPEND "mail/sent-mail_mobile" (\Seen) {990}
+ Ready for argument
:> Subject: =?utf-8?q?Re:_Reply_to_your_"3_Toilets_for_sale_from_renovation"_Ad_on_Kijiji?=
Date: Mon, 11 Jan 2010 13:56:57 -0500
From: "Robert Hardy" <***@mydomain.ca>
To: ***@theirdomain.com
MIME-Version: 1.0
X-Mailer: LCG ProfiMail
Message-ID: <***@mydomain.ca>
In-Reply-To: <***@kj-classy018.intern.kijiji.com>
Content-Type: text/plain; charset=utf-8; format=flowed

:> > Yes they are. There is someone interested in 3 coming on Weds but it is
Post by Robert Hardy
first come first serve.
Rob

------- Original message -------
Post by Robert Hardy
Sent: '10-01-11, 10:27
Hello! The following is a reply to your "3 Toilets for sale from
Hi I am interested in one ... please let me know if they are still
available.
Martha
:>
3 BAD Missing or invalid argument to APPEND
Destroying socket
Socket cancel: OK
SSLsock close: OK
Socket close
Ok
~finished
Mark Crispin
2010-01-12 01:36:50 UTC
Permalink
Although my analysis is limited due to the log being damaged (by your own
admission, you changed names/addresses), I see the cause of the error.

Profimail 3.25 is sending the message data incorrectly. After exactly 990
message text bytes (the stated count in your message) the IMAP protocol
expects either a CR/LF sequence (to terminate the append) or a space
followed by the arguments to define another message to append.

Unfortunately, because you have edited your trace I can not tell for
certain if it sent a short message size count, or if it sent a spurious
space after the message. The message text, as you have it, is either 989
bytes with UNIX-style LF-only newlines (a bug if the client is doing that)
or 1016 bytes with proper CR/LF newlines. However, because you changed
things, those counts can not be relied upon.

In IMAP, counts must be exact; even the slightest variation completely
changes the interpretation of the protocol.

I also can't tell what the client means by the following in the log:

:> 3 BAD Missing or invalid argument to APPEND

The ":> " is apparently its prefix for something that it is sending; but
the server sent the "3 BAD Missing or invalid argument to APPEND" message.
I would expect to see something like ":> " followed by a newline.

In any case, that should be enough to get you started in producing a bug
report to them.
Post by Robert Hardy
Post by Robert Hardy
I get the error message "BAD Missing or invalid argument to APPEND" from my
mail clients (Profimail 3.25 and I think alpine 2.00 too) when sending a
message and it's saving in sent-mail. I tried upgrading to imap-2007e from
imap-2007b but this hasn't helped.
Can someone tell me if this is a server bug or a client bug, what is wrong
and ideally how to fix it?
To clarify this only happens rarely with certain messages. Once it happens
with a particular message I can't ever save that message to sent-mail.
I tried to include an attached IMAP trace from Profimail but it seemed to get
striped by the mailing list.
Here is the text inline with the names/addresses changed to protect the
Connect
Connection already active, using it
Socket opened
Connect to host mail.mydomain.ca:993
Connect to IP mail IP addr
Connected: mail.mydomain.ca:993
Init SSL
SSL inited
SSL handshake done
* OK [CAPABILITY IMAP4REV1 I18NLEVEL=1 LITERAL+ SASL-IR LOGIN-REFERRALS
AUTH=PLAIN AUTH=LOGIN] mail.mydomain.ca IMAP4rev1 2007b.404 at Mon, 11 Jan
2010 15:34:59 -0500 (EST)
:> 1 CAPABILITY
* CAPABILITY IMAP4REV1 I18NLEVEL=1 LITERAL+ IDLE UIDPLUS NAMESPACE CHILDREN
MAILBOX-REFERRALS BINARY UNSELECT ESEARCH WITHIN SCAN SORT THREAD=REFERENCES
THREAD=ORDEREDSUBJECT MULTIAPPEND SASL-IR LOGIN-REFERRALS AUTH=PLAIN
AUTH=LOGIN
1 OK CAPABILITY completed
:> <login command sent>
2 OK [CAPABILITY IMAP4REV1 I18NLEVEL=1 LITERAL+ IDLE UIDPLUS NAMESPACE
CHILDREN MAILBOX-REFERRALS BINARY UNSELECT ESEARCH WITHIN SCAN SORT
THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND] User rhardy
authenticated
:> 3 APPEND "mail/sent-mail_mobile" (\Seen) {990}
+ Ready for argument
=?utf-8?q?Re:_Reply_to_your_"3_Toilets_for_sale_from_renovation"_Ad_on_Kijiji?=
Date: Mon, 11 Jan 2010 13:56:57 -0500
MIME-Version: 1.0
X-Mailer: LCG ProfiMail
Content-Type: text/plain; charset=utf-8; format=flowed
:> > Yes they are. There is someone interested in 3 coming on Weds but it is
Post by Robert Hardy
first come first serve.
Rob
------- Original message -------
Post by Robert Hardy
Sent: '10-01-11, 10:27
Hello! The following is a reply to your "3 Toilets for sale from
Hi I am interested in one ... please let me know if they are still
available.
Martha
:> 3 BAD Missing or invalid argument to APPEND
Destroying socket
Socket cancel: OK
SSLsock close: OK
Socket close
Ok
~finished
_______________________________________________
Imap-uw mailing list
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw
-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.

Mark Crispin
2010-01-12 01:10:03 UTC
Permalink
Post by Robert Hardy
I get the error message "BAD Missing or invalid argument to APPEND" from my
mail clients (Profimail 3.25 and I think alpine 2.00 too) when sending a
message and it's saving in sent-mail.
I doubt very much that this is happening with Alpine 2.00. I would have
to see proof before I believe such a thing.

Proof would be a .pine-debug# file resulting a session started with the
command "alpine -d imap=4" in which the problem was made to happen.

I'm not saying that it's impossible. I am saying that I don't believe it;
and I won't believe it, unless/until I see a .pine-debug# file that shows
Alpine making it happen.

I wrote both the APPEND command generation code in Alpine 2.00, and the
APPEND command parsing code in UW IMAP. Those two segments of code have
interoperated successfully with each other for nearly two decades without
ever generating that error message. I would be extremely surprised if
there was a bug after all these years.

The error message is from UW IMAP. It is a catch-all for a syntax error
in the APPEND command from the client. I would have to see the command in
question to determine what, precisely, is wrong with it.
Post by Robert Hardy
Can someone tell me if this is a server bug or a client bug, what is wrong
and ideally how to fix it?
It is almost certainly a client bug.

If, as I suspect, you can not make the problem happen in Alpine 2.00 after
all, then delete the word "almost" from the previous sentence.

If that is the case, then see if there is some option in Profimail 3.25
that takes a telemetry transcript of the IMAP protocol negotiations. If
so, I can look at it for you, and tell you what Profimail 3.25 is doing
wrong. It will then be between you and the vendor of Profimail 3.25.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
Loading...