[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how can I convince WL to check the IMAP connection before sending mail?
I have had an ongoing long-standing problem with WL in the way it sends
mail and saves the message to a Sent folder.
The problem is when my IMAP password has "timed out", and then I flub
typing the password. Either I end up sending duplicate messages, or I
never get the copy saved to my Sent folder (unless I jump into the Draft
summary and manually refile it into the Send folder). (There's also the
case where I fail to see the password prompt and I think then the
message simply doesn't get sent or saved -- though I'm not sure exactly.)
The general problem of course is one of trying to combine two separate
operations into one transaction, and rolling back both if one fails. In
this case one cannot be rolled back (the sending operation).
I think WL's problem is that it tries to combine re-authenticating to
IMAP with the actual storing of the sent message.
I think it can be solved by having a function which will attempt to
login to the IMAP server, but effectively do nothing (except return
success on being able to this "nothing"). This function can then be
called first, and then if it works the message send can be attempted and
finally the sent message can be stored.
This separation of re-authentication and the storing of the sent message
should be much more reliable so long as the password timeout is longer
than any message send attempt can ever take (and of course so long as
the IMAP server doesn't go away during the message send, but that's not
a problem I'm trying to solve, or even worried about at this point).
I haven't yet looked at any code -- I just wanted to put this out there,
sort of as a way of documenting the problem, and with a slim hope that
someone might have a quick fix to suggest.
Another fix might be to store the message in the Sent folder first, then
try sending the message, and if the send fails to delete and expunge the
message from the Sent folder while keeping the draft buffer open. I
think though that this option would require quite a bit more
restructuring and new code.
--
Greg A. Woods
Planix, Inc.
<woods@planix.com> +1 250 762-7675 http://www.planix.com/