Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Obviously, the answer to the question in the title is yes. But I really want to know if I can do it without breaking anything.

I am using offlineimap to back up my Gmail account to a Maildir on my local computer. Since Gmail lets you easily assign multiple labels to your mail, my backup directory ends up with multiple copies of most of my mails. I would like to save space by replacing copies of the same message with hard links, using a script called hardlink. Could this possibly cause problems for applications using the Maildir, or could it cause applications to corrupt my mailboxes? Or would modification of any mail files simply break any hard links associated with that file, without affecting the previous version that was hard-linked elsewhere?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Hardlinking copies of the same message is done by several IMAP servers.

On the other hand, those IMAP servers expect hardlinks. Some other Maildir programs may not. But it should not cause any damage, other than breaking the link.


Could this possibly cause problems for applications using the Maildir

Unlikely.

or could it cause applications to corrupt my mailboxes?

There is nothing that can get corrupted in a Maildir -- except possibly header caches kept by some MUAs and/or IMAP servers, but a cache is something that can be thrown away.

Or would modification of any mail files simply break any hard links associated with that file, without affecting the previous version that was hard-linked elsewhere?

Depends on how the modification is made.

  • Truncate and overwrite: Works fine. Other directories have the updated message.
  • Write temporary file and rename: Works, but the link is broken and updates will not be visible in other folders (which have the old file).

Although I can't imagine why would offlineimap modify a message...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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