Re: wanderlust file name too long

Kazuhiro Ito <[email protected]> Fri, 01 Dec 2017 22:37:25 +0900
Newsgroups gmane.mail.wanderlust.general
Message-ID <86fu8uin6y.wl--xmue__41245.8220766441$1512135547$gmane$org@d1.dion.ne.jp>
> I have an email in my inbox that I cannot open. It says "Creating
> directory: File name too long, /home/tomas/.elmo/cache/10/..."
> 
> Do you have any idea how to fix this, or where the in the code to
> look?

Wanderlust builds cache filename from message-id.  If message-id is
too long, filename may be too long.  As a workaround, using hash
function can avoid the problem.  Please try the below code.

;; Adjust according to your environment.
(defvar elmo-msgid-to-chace-max-length 128)

(eval-after-load "elmo-util"
  '(defun elmo-msgid-to-cache (msgid)
     (save-match-data
       (when (and msgid
                  (string-match "<\\(.+\\)>$" msgid))
         (let ((result (elmo-replace-string-as-filename
                        (match-string 1 msgid))))
           (if (or (null elmo-msgid-to-chace-max-length)
                   (<= (length result) elmo-msgid-to-chace-max-length))
               result
             (sha1 msgid)))))))

-- 
Kazuhiro Ito