Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Store Mails in External Disk

153 views
Skip to first unread message

Jaydip C

unread,
Jul 27, 2021, 8:57:37 AM7/27/21
to
Hi,

I have installed Neomutt on Arch Linux using Luke Smith's Mutt-Wizard.
It's working fine. I am storing all my emails in my local laptop's
~/.config/mutt/accounts folder which is mentioned in my .muttrc file.
But I have thousands of emails. And very soon there will be some space
problem. So I wanted to change the location of storing the mails. I
intend to store them on an external hard disk. But when I write the
location of external disk in my .muttrc, Neomutt gives me error as
"Cannot execute .muttrc file".
Is there any way to config this?
Please help.

Thanks.

Chris Green

unread,
Jul 27, 2021, 10:33:03 AM7/27/21
to
I think you must have some sort of misconfiguration of where things
are. It should be quite easy to do what you want.

What hve you actually put in your .muttrc file? You could post the
whole thing here, less passwords and anything else private of course.

This newsgroup is pretty quiet by the way, the mutt mailing list is
much more active.

--
Chris Green
·

Jaydip C

unread,
Jul 27, 2021, 1:22:28 PM7/27/21
to
Thanks for your reply.
I have some cloud drives, like Google, NextCloud, Mega etc. I configured
Rclone to automount them in home directory. I created a directory "Mutt"
in my "NextCloud" directory.
Now in my gmx muttrc, which is sourced from original
~/.config/mutt/muttrc, in place of 'set folder =
"~/.local/share/mail/joy_...@gmx.com"', I put 'set folder =
"~/NextCloud/Mutt/joy_...@gmx.com"'. But then when I started Neomutt,
it says, "Cannot source joy_...@gmx.com.muttrc from muttrc". Then it
asked if it should create the necessary directories. When I typed "Yes",
it created all the mailboxes except Inbox. And I cannot see any emails
in any mail folders.
I know I am missing something.

Also how do I access mutt mailing list?

Thanks again.

Chris Green

unread,
Jul 27, 2021, 2:18:04 PM7/27/21
to
That says to me that, for whatever reason, the file either doesn't exist or
isn't visible to mutt. If you exit mutt and do:-
ls -l ~/NextCloud/Mutt/joy_...@gmx.comk

what do you see? I wonder if the @ in the file name is causing the
problem?


> asked if it should create the necessary directories. When I typed "Yes",
> it created all the mailboxes except Inbox. And I cannot see any emails
> in any mail folders.
> I know I am missing something.
>
> Also how do I access mutt mailing list?
>

Go to mutt.org and scroll down to the link for 'Mailing Lists', on the
page that takes you to there are links to subscribe, etc. You want
the mutt_users mailing list.

--
Chris Green
·

Keith Thompson

unread,
Jul 27, 2021, 5:21:23 PM7/27/21
to
Your excerpts from your .muttrc file are line-wrapped, which makes it
difficult to tell exactly what you really have in the file. And you've
shown us only the excerpts that you assume are relevant -- but as you
say, you don't know what the problem is.

If you don't want to share your .muttrc file (and anything it sources),
perhaps you can reduce it to a smaller version that reproduces the
problem and show us that.

As Chris Green suggested, the first thing to do is to verify that you
can access ~/NextCloud/Mutt/joy_...@gmx.com from your shell:

ls -l ~/NextCloud/Mutt/joy_...@gmx.com

If there's a problem with that file, I'd expect a more specific error
message than "Cannot source ..." from mutt. You apparently have a
"source" command in your .muttrc. Mutt isn't complaining about
~/NextCloud/Mutt/joy_...@gmx.com
It's complaining about
joy_...@gmx.com.muttrc
My guess is that you have a syntax error somwhere in your .muttrc or in
something it refers to.

The string "Cannot source" does not occur anywhere in the current
neomutt source code, and there are no occurrences of "Cannot" that are
not followed by something other than "source". In other words, I don't
see how neomutt could have produced that message. Are you sure that's
*exactly* what it printed? If you want to show us an error message,
copy-and-paste it, don't re-type it.

I presume that your ~/NextCloud directory is actually a separate file
system. If it's not, if it's just synchronized with NextCloud, then
it's going to take up just as much space on your local file system.

Another solution would be to leave your .muttrc alone and make the
folder directory a symbolic link. But that's not going to help with the
problem you're reporting.

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Jaydip C

unread,
Jul 28, 2021, 2:27:55 AM7/28/21
to
You are right. I don't see anything there.

ls -l ~/NextCloud/Mutt/
total 0

So what needs to be changed?

Thanks.

Jaydip C

unread,
Jul 28, 2021, 2:49:40 AM7/28/21
to
Yes. There's nothing in ~/NextCloud/Mutt/ folder.

Here is my original muttrc in ~/.config/mutt/muttrc

# vim: filetype=neomuttrc
source /usr/share/mutt-wizard/mutt-wizard.muttrc
source /home/jaydipc/.config/mutt/accounts/1-chal...@gmail.com.muttrc
macro index,pager i1 '<sync-mailbox><enter-command>source /home/
jaydipc/.config/mutt/accounts/1-chal...@gmail.com.muttrc<enter><change-
folder>!<enter>;<check-stats>' "switch to chala...@gmail.com"
macro index,pager i2 '<sync-mailbox><enter-command>source /home/
jaydipc/.config/mutt/accounts/2-joy...@gmx.com.muttrc<enter><change-
folder>!<enter>;<check-stats>' "switch to joy_...@gmx.com"

This is original ~/.config/mutt/accounts/2-joy...@gmx.com.muttrc

# vim: filetype=neomuttrc
# muttrc file for account joy_...@gmx.com
set realname = "joy_deep"
set from = "joy_...@gmx.com"
set sendmail = "msmtp -a joy_...@gmx.com"
alias me joy_deep <joy_...@gmx.com>
set folder = "/home/jaydipc/.local/share/mail/joy_...@gmx.com"
set header_cache = /home/jaydipc/.cache/mutt-wizard/joy_...@gmx.com/
headers
set message_cachedir = /home/jaydipc/.cache/mutt-wizard/joy_...@gmx.com/
bodies
set mbox_type = Maildir


bind index,pager gg noop
bind index,pager g noop
bind index,pager M noop
bind index,pager C noop
bind index gg first-entry
unmailboxes *
unalternates *
unset signature
unmacro index o
macro index o "<shell-escape>mw -y joy_...@gmx.com<enter>" "run mbsync to
sync joy_...@gmx.com"

mailboxes "=Archive" "=Deleted Items" "=Drafts" "=INBOX" "=Junk" "=Junk E-
mail" "=MailCollect/jaydi...@yahoo.com" "=OUTBOX" "=Queue" "=Sent"
"=Sent Items" "=Spam" "=Trash"
macro index,pager ga "<change-folder>=Archive<enter>" "go to archive"
macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to
archive"
macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to
archive"
set postponed = "+Drafts"
macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts"
macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts"
macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts"
macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox"
macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox"
macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox"
set spoolfile = "+INBOX"
macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk"
macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk"
set record = "+Sent"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent"
set record = "+Sent"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent"
macro index,pager gS "<change-folder>=Spam<enter>" "go to spam"
macro index,pager MS ";<save-message>=Spam<enter>" "move mail to spam"
macro index,pager CS ";<copy-message>=Spam<enter>" "copy mail to spam"
macro index,pager gt "<change-folder>=Trash<enter>" "go to trash"
macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash"
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash"
set trash = "+Trash"

This is working fine.

This is after changing to NextCloud muttrc in ~/.config/mutt/muttrc

# vim: filetype=neomuttrc
source /usr/share/mutt-wizard/mutt-wizard.muttrc
source /home/jaydipc/.config/mutt/accounts/1-chal...@gmail.com.muttrc
macro index,pager i1 '<sync-mailbox><enter-command>source /home/
jaydipc/.config/mutt/accounts/1-chal...@gmail.com.muttrc<enter><change-
folder>!<enter>;<check-stats>' "switch to chala...@gmail.com"
macro index,pager i2 '<sync-mailbox><enter-command>source /home/
jaydipc/.config/mutt/accounts/2-joy...@gmx.com.muttrc<enter><change-
folder>!<enter>;<check-stats>' "switch to joy_...@gmx.com"

This is after changing to NextCloud ~/.config/mutt/accounts/2-
joy_...@gmx.com.muttrc


# vim: filetype=neomuttrc
# muttrc file for account joy_...@gmx.com
set realname = "joy_deep"
set from = "joy_...@gmx.com"
set sendmail = "msmtp -a joy_...@gmx.com"
alias me joy_deep <joy_...@gmx.com>
set folder = "/home/jaydipc/NextCloud/Mutt/joy_...@gmx.com"
set header_cache = /home/jaydipc/.cache/mutt-wizard/joy_...@gmx.com/
headers
set message_cachedir = /home/jaydipc/.cache/mutt-wizard/joy_...@gmx.com/
bodies
set mbox_type = Maildir


bind index,pager gg noop
bind index,pager g noop
bind index,pager M noop
bind index,pager C noop
bind index gg first-entry
unmailboxes *
unalternates *
unset signature
unmacro index o
macro index o "<shell-escape>mw -y joy_...@gmx.com<enter>" "run mbsync to
sync joy_...@gmx.com"

mailboxes "=Archive" "=Deleted Items" "=Drafts" "=INBOX" "=Junk" "=Junk E-
mail" "=MailCollect/jaydi...@yahoo.com" "=OUTBOX" "=Queue" "=Sent"
"=Sent Items" "=Spam" "=Trash"
macro index,pager ga "<change-folder>=Archive<enter>" "go to archive"
macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to
archive"
macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to
archive"
set postponed = "+Drafts"
macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts"
macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts"
macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts"
macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox"
macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox"
macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox"
set spoolfile = "+INBOX"
macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk"
macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk"
set record = "+Sent"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent"
set record = "+Sent"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent"
macro index,pager gS "<change-folder>=Spam<enter>" "go to spam"
macro index,pager MS ";<save-message>=Spam<enter>" "move mail to spam"
macro index,pager CS ";<copy-message>=Spam<enter>" "copy mail to spam"
macro index,pager gt "<change-folder>=Trash<enter>" "go to trash"
macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash"
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash"
set trash = "+Trash"

Now neomutt is starting okay. But when I switch account to
joy_...@gmx.com, it displays nothing. And if I try to go to Inbox, it
says, "/home/jaydipc/NextCloud/Mutt/joy_...@gmx.com/INBOX is not a
mailbox".

Thanks for helping.

Chris Green

unread,
Jul 28, 2021, 4:18:04 AM7/28/21
to
Jaydip C <chala...@gmail.com> wrote:
> >
> > That says to me that, for whatever reason, the file either doesn't exist
> > or isn't visible to mutt. If you exit mutt and do:-
> > ls -l ~/NextCloud/Mutt/joy_...@gmx.comk
> >
> > what do you see? I wonder if the @ in the file name is causing the
> > problem?
> >
> >
[snip]
>
> You are right. I don't see anything there.
>
> ls -l ~/NextCloud/Mutt/
> total 0
>
> So what needs to be changed?
>
That's nothing to do with mutt or your muttrc.

If you can't see the file joy_...@gmx.comk from the command line then
mutt isn't going to be able to see it either.

I still think that @ sign may be an issue. Also are there any case
sensitivity issues there?

Did you just edit the file joy_...@gmx.comk locally and then copy it
to the remote storage or what exactly? Try creating a file with no
special characters in the name (my standard test file name is "fred")
and, if that works in terms of being able to see it then work slowly
from that simple name to the one you are trying and see what breaks
things.

--
Chris Green
·

Jaydip C

unread,
Jul 28, 2021, 12:40:23 PM7/28/21
to
As suggested, I changed the folder name from joy_...@gmx.com to gmx. I
also created the folder gmx in ~/NextCloud/Mutt/ directory. now when I run
mbsync -a, I get error "Maildir error: cannot read UIDVALIDITY". Also it
gives me error "Error: channel joy_...@gmx.com: near side box INBOX
cannot be opened". That error is there for all the mail folders. Although,
I found all the direcotories have been created. But when I start Neomutt,
I don't see any emails in the Inbox.

Thanks.

Chris Green

unread,
Jul 28, 2021, 3:48:04 PM7/28/21
to
You are getting farther and farther from mutt problems! :-)

When using maildir remember that many systems create *all* their
maildirs in one directory with the 'folder' names being part of very
long directory names separated by dots.

E.g. if you have maildir mailboxes in sub-folders of a directory
called root what you will actually see is directories as follows:-

root.folder1
root.folder2
root.folder3.sub-folder3

Then, inside these directories are the cur, new and tmp directories
that make up a maildir mailbox. Trying to manage this sort of thing
across an interface to cloud storage can be fraught with difficulties.

The error about "... near side box INBOX cannot be opened" sounds like
it's talking about imap4, yet another can of worms IMHO.

I think you need to try and simplify what you are doing and work your
way up to what you want.

--
Chris Green
·

Jaydip C

unread,
Jul 30, 2021, 5:12:27 AM7/30/21
to
Now I can see all the mailboxes in neomutt. I don't see any mails in them.
So I guess my .muttrc file is okay.
Whenever I issue command 'mbsync -a', I get error

Maildir error: cannot read UIDVALIDITY.
Error: channel joy_...@gmx.com: near side box INBOX cannot be opened.

So here is my .mbsyncrc file. Please have a look and suggest if it's okay.




IMAPStore joy_...@gmx.com-remote
Host imap.gmx.net
Port 993
User joy_...@gmx.com
PassCmd "pass joy_...@gmx.com"
AuthMechs LOGIN
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt

MaildirStore joy_...@gmx.com-local
Subfolders Verbatim
Path /home/jaydipc/NextCloud/Mutt/gmx/
Inbox /home/jaydipc/NextCloud/Mutt/gmx/INBOX

Channel joy_...@gmx.com
Expunge Both
Master :joy_...@gmx.com-remote:
Slave :joy_...@gmx.com-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile

Thanks.

Chris Green

unread,
Jul 30, 2021, 5:33:03 AM7/30/21
to
Jaydip C <chala...@gmail.com> wrote:
>
> Now I can see all the mailboxes in neomutt. I don't see any mails in them.
> So I guess my .muttrc file is okay.
> Whenever I issue command 'mbsync -a', I get error
>
> Maildir error: cannot read UIDVALIDITY.
> Error: channel joy_...@gmx.com: near side box INBOX cannot be opened.
>
> So here is my .mbsyncrc file. Please have a look and suggest if it's okay.
>
I know nothing about mbsync, you need to ask elsewhere, start at:-

https://isync.sourceforge.io/

--
Chris Green
·

Jaydip C

unread,
Jul 30, 2021, 11:29:38 PM7/30/21
to
I got it figured out. I copied the mw file to mymw file. I changed the
bash script. In maildir location, I put my Nextcloud folder. Changed same
for .mbsyncrc file. Now it works.

Thanks for all the advices.
0 new messages