reddit / emacs

offlineimap cannot find file - I think I'm missing something basic

thephatmaster · 2022-09-20 09:36
Hi there, I'm setting up MU4E and having an issue with both mbsync and offlineimap. Authentication is fine, and the directory structure after my specified MAILDIR is created. However, a temp file is not found (because, presumably, it is not created) and an error results. The various online guides guides and the Arch wiki don't mention this issue. So, I feel I'm missing something fundamental. I tried to ask for help on r/linuxquestions previously but that thread went cold. \*system setup\* -KDE NEON (Ubuntu 20.04 base, KDE Plasma 5.25, Wayland) -Device = Surface Go v1 (128,8) My `.offlineimaprc` looks like (some info anonymised in <brackets>): ``` [general] # GmailAcccount, OutlookAccount accounts = GmailAccount, OutlookAccount # ----------- Gmail Account ----------- [Account GmailAccount] localrepository = LocalGmailAccount remoterepository = RepositoryGmailAccount quick = 10 [Repository LocalGmailAccount] type = Maildir localfolders = /media/<USER>/Storage\_512/Maildir/GmailAccount [Repository RepositoryGmailAccount] type = Gmail maxconnections = 2 remoteuser = <USER>@gmail.com remotepass = <PASS> sslcacertfile = /etc/ssl/certs/ca-certificates.crt # ----------- OutlookAccount ----------- [Account OutlookAccount] localrepository = LocalOutlookAccount remoterepository = RemoteOutlookAccount [Repository LocalOutlookAccount] type = Maildir localfolders = /media/<USER>/Storage\_512/Maildir/OutlookAccount [Repository RemoteOutlookAccount] type = IMAP ssl = yes remotehost = outlook.office365.com remoteuser = <USER>@<EMAIL> remotepass = <PASS> sslcacertfile = /etc/ssl/certs/ca-certificates.crt ``` \*the issue\* Full error with tracebacks below (also some info anonymised in <brackets>): ``` OfflineIMAP 7.2.3 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v2.57 (system), Python v2.7.18, OpenSSL 1.1.1f 31 Mar 2020 Account sync GmailAccount: *** Processing account GmailAccount Establishing connection to imap.gmail.com:993 (RepositoryGmailAccount) Folder [Gmail]/All Mail [acc: GmailAccount]: Syncing [Gmail]/All Mail: Gmail -> Maildir Folder [Gmail]/Archive [acc: GmailAccount]: Syncing [Gmail]/Archive: Gmail -> Maildir Establishing connection to imap.gmail.com:993 (RepositoryGmailAccount) Copy message UID 2 (1/1) RepositoryGmailAccount:[Gmail]/Archive -> LocalGmailAccount:[Gmail].Archive Copy message from RepositoryGmailAccount:[Gmail]/Archive: ERROR: Copying message 2 [acc: GmailAccount] [Errno 2] No such file or directory: '/media/<USER>/Storage_512/Maildir/GmailAccount/[Gmail].Archive/tmp/1663665831_0.5316.<USER>surfacego,U=2,FMD5=312a26d26d7c877e152f72dd5ddbc11f:2,S' Thread 'Copy message from RepositoryGmailAccount:[Gmail]/Archive' terminated with exception: Traceback (most recent call last): File "/usr/share/offlineimap/offlineimap/threadutil.py", line 160, in run Thread.run(self) File "/usr/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/usr/share/offlineimap/offlineimap/folder/Gmail.py", line 289, in copymessageto super(GmailFolder, self).copymessageto(uid, dstfolder, statusfolder, register) File "/usr/share/offlineimap/offlineimap/folder/Base.py", line 844, in copymessageto new_uid = dstfolder.savemessage(uid, message, flags, rtime) File "/usr/share/offlineimap/offlineimap/folder/Maildir.py", line 393, in savemessage tmpname = self.save_to_tmp_file(messagename, content) File "/usr/share/offlineimap/offlineimap/folder/Maildir.py", line 318, in save_to_tmp_file os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0o666) OSError: [Errno 2] No such file or directory: '/media/<USER>/Storage_512/Maildir/GmailAccount/[Gmail].Archive/tmp/1663665831_0.5316.<USER>surfacego,U=2,FMD5=312a26d26d7c877e152f72dd5ddbc11f:2,S' Last 3 debug messages logged for Copy message from RepositoryGmailAccount:[Gmail]/Archive prior to exception: thread: Register new thread 'Copy message from RepositoryGmailAccount:[Gmail]/Archive' (account 'GmailAccount') imap: Returned object from fetching 2: 'Delivered-To: <USER>@gmail.com Received: by 10.194.202.162 with SMTP id kj2csp1293295wjc; Wed, 28 Jan 2015 06:34:00 -0800 (PST) Return..."></body></html> --001a11c3226617f971050db7431c-- ' maildir: Write mail '[Gmail].Archive:2' with flags set(['S']) ERROR: Exceptions occurred during the run! ERROR: Copying message 2 [acc: GmailAccount] [Errno 2] No such file or directory: '/media/<USER>/Storage_512/Maildir/GmailAccount/[Gmail].Archive/tmp/1663665831_0.5316.<USER>surfacego,U=2,FMD5=312a26d26d7c877e152f72dd5ddbc11f:2,S' Folder [Gmail]/Drafts [acc: GmailAccount]: Syncing [Gmail]/Drafts: Gmail -> Maildir Traceback: File "/usr/share/offlineimap/offlineimap/folder/Base.py", line 844, in copymessageto new_uid = dstfolder.savemessage(uid, message, flags, rtime) File "/usr/share/offlineimap/offlineimap/folder/Maildir.py", line 393, in savemessage tmpname = self.save_to_tmp_file(messagename, content) File "/usr/share/offlineimap/offlineimap/folder/Maildir.py", line 318, in save_to_tmp_file os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0o666) ```
whudwl · 2022-09-20 10:21
what filesystem is it
thephatmaster · 2022-09-20 10:28
Very good question. It's an SD card, so FAT
whudwl · 2022-09-20 10:30
Putting maildir on FAT is probably a terrible idea.
thephatmaster · 2022-09-20 10:39
It's kinda the only place I have
MangyCanine · 2022-09-21 06:13
> [Errno 2] No such file or directory: '/media/<USER>/Storage_512/Maildir/GmailAccount/[Gmail].Archive/tmp/1663665831_0.5316.<USER>surfacego,U=2,FMD5=312a26d26d7c877e152f72dd5ddbc11f:2,S' If that is the actual file name, it will not work on any Microsoft filesystem due to the presence of the colon (colons are illegal in a Microsoft filename). And that’s ignoring the odd presence of ”<USER>” in the filename.
thephatmaster · 2022-09-21 08:42
Thanks Sorry I put <USER> there as a placeholder My SD card needs to be exfat, so I'll probably need a workaround. I don't see anything online that helps
thephatmaster · 2022-09-21 08:51
Actually, thanks again, now I know it's the colon that's the issue I've seen in the FAQ for offlineimap that there is an option I can specify in my config to use `!` instead
MangyCanine · 2022-09-21 14:13
I mentioned that because, not only did it seem weird, but < and > are probably not allowed in windows filenames, too.
thephatmaster · 2022-09-21 15:01
Very sensible, unfortunately I tried the "windows"option in my config but it didn't do anything - further debugging required
holgerschurig · 2022-09-22 20:01
When you run OfflineIMAP with GMail ... perhaps you are interested int IEER instead? https://github.com/gauteh/lieer It's so much faster and hassle free than offlineimap.
holgerschurig · 2022-09-22 20:03
You can format an SD-Card also with ext4fs. They don't have to use a filesystem that was already outdated 20 years ago ...
thephatmaster · 2022-09-22 21:19
It's a card shared with windows (dual boot) and occasionally various cameras, so fat is convenient