0

I'm using the latest Wanderlust under Emacs 26.3, and I've also tried later Emacs versions up through 28.x.

In Wanderlust's "folders" file, for each IMAP folder there are entries which look like this:

%inbox.IMAPFOLDERNAME:[email protected]:starttls!! "FolderIdentifier"

... where IMAPFOLDERNAME is the name of the IMAP folder, "FolderIdentifier" is the identifier which will show up for that IMAP folder on the folders screen, and LOGINID is the login ID to use for connecting to the imap.example.com IMAP server for accessing that folder.

This works just fine in most instances. However, in some cases, the login ID contains an "at" sign (@). For example, for a certain account, I might have to log in as follows:

User ID:     [email protected]
IMAP Server: imap.example.com

If I put the following into the "folders" file, it's invalid syntax for Wanderlust because of the presence of two "at" signs:

%inbox.IMAPFOLDERNAME:[email protected]@imap.example.com:starttls!! "FolderIdentifier"

All that happens in this case is that on the folders screen, this folder is shown in pink (instead of normal white), and if I try to enter the folder, I get the following message in the status line, even though there definitely are validly accessible messages in that IMAP folder:

No updates for "%inbox.IMAPFOLDERNAME:[email protected]@imap.example.com:starttls!!"

This simply means that Wanderlust was unable to properly log in to the IMAP site, and that indicates that the login ID and/or IMAP server name must have been incorrectly parsed.

How in Wanderlust can I encode this entry in the "folders" file to accomodate a login ID which contains an "at" sign?

Thank you very much in advance.

PS: In my case, I don't have the ability to alter any IMAP login ID's, because the IMAP server is not managed by me.

6
  • It is probably just a regex that needs to be modified to handle your additional use-case. The error message will probably lead you to the place in the code where you can backtrace to find the regex, which is probably a variable. ...
    – lawlist
    Commented Apr 12 at 2:50
  • As you can see from my "Answer" that I posted, I found a place in the elmo code which can be modified and then used for this purpose. I'm wondering, however, if the kind of hack that I describe in my Answer would actually be the best way to do this. If there already is something in the Wanderlust code base that I overlooked which can handle this situation without my hacking the source code, I'd prefer to use such a thing instead of my hack.
    – HippoMan
    Commented Apr 12 at 3:01
  • As @lawlist suggests, the exact error message is important: you can use it to grep through the sources to see who produced it and then trace back through the calls in the code to find the culprit. So adding the EXACT error message to your question might help in getting you an answer.
    – NickD
    Commented Apr 12 at 3:15
  • I already did all of that grepping and searching, and I know what the code is currently doing. A regex is not used to separate the LOGINID from the server name. Instead, the string is split with "@" as the delimiter, under the assumption that only one "@" would be given. Therefore, a change in coding would be necessary to perform that split differently. But again, I'm hoping that perhaps there is some configuration variable built into Wanderlust or elmo which will do what I want, without my having to modify any source code. And anyway, the source-code modification in my Answer works.
    – HippoMan
    Commented Apr 12 at 3:21
  • PS: The error indications that occur in this case have been added to the question above. The only "error message" is that the normally white folder name text is changed to the color pink on the folders screen, and Wanderlust simply says that there are no updates in the IMAP folder, even though there definitely "are" updates. This simply means that Wanderlust couldn't properly log in to the IMAP server ... which means that the login ID and/or IMAP server name must have been incorrectly parsed. No other error indicators are shown.
    – HippoMan
    Commented Apr 12 at 15:42

1 Answer 1

0

The explanation given below my "OLD ANSWER THAT ISN'T NEEDED" text, below, is now deprecated, since I now have figured out the correct way to accomplish what I want, without making any changes to the Wanderlust nor elmo code bases.

I thought that I had been running the latest Wanderlust and elmo, but I now realize that I had accidentally installed them in the wrong directory, and that all this time I had been unknowingly running ancient, stone-age versions of both of these packages.

Once I properly installed the latest versions of both of these packages in the correct directory, the following started working properly:

%inbox.IMAPFOLDERNAME:"[email protected]"@imap.example.com:starttls!! "FolderIdentifier"

In other words, all that's needed is to put "[email protected]" in double quotes within the folder string, and the "@" inside of that login ID is accepted.

And I've been able to get rid of my "==ATSIGN==" hack, which is described in the deprecated Answer, below.

==== OLD ANSWER THAT ISN'T NEEDED ====

I figured out a hack to handle the "at" sign in the login ID:

In elmo-imap4.el in the "elmo" code base, I replaced the following ...

(defalias 'elmo-imap4-userid 'elmo-imap4-astring)

... with this:

(defun elmo-imap4-userid (string)
  (elmo-imap4-astring (replace-regexp-in-string "==ATSIGN==" "@" string)))

And I recompiled elmo-imap4.el .

Then, the following construct in the "folders" file started working to represent login ID "[email protected]":

%inbox.IMAPFOLDERNAME:[email protected]:starttls!! "FolderIdentifier"

I don't have any login ID's which contain the string "==ATSIGN==", so this works fine for me.

I'm still wondering, however, if there might be a less hacky way to accomplish this.

2
  • I have to wait another day before this site will let me accept my own Answer, but I plan to wait longer than that, to see if I might receive an Answer which describes how this can be accomplished without hacking the Wanderlust or elmo source code, and instead, by means of some sort of configuration variable, perhaps. If no such Answer comes in after maybe a week, I'll then accept this current Answer.
    – HippoMan
    Commented Apr 12 at 15:32
  • So, I finally figured out the correct way to fix this without hacking any Wanderlust nor elmo source code. See my updated Answer, above. I'll be able to accept that answer within 6 hours, and I will do so.
    – HippoMan
    Commented Apr 13 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.