Commit 74ebca57 authored by R A Lichtensteiger's avatar R A Lichtensteiger Committed by Richard P. Curnow

Skip symlinks when using mbox

I use a lot of symlinks for people who have multiple email addresses, so that
the emails all land in the right place.

Unfortunately for me, mairix happily indexes all of those symlinks as files.  I
made some changes to mbox.c to have it skip symlinks while in
parent c74b79d7
......@@ -773,14 +773,21 @@ void build_mbox_lists(struct database *db, const char *folder_base, /*{{{*/
for (i=0; i<n_paths; i++) {
char *path = paths[i];
if (stat(path, &sb) < 0) {
if (lstat(path, &sb) < 0) {
/* can't stat */
} else {
if (S_ISLNK(sb.st_mode)) {
/* Skip mbox if symlink */
if (verbose) {
printf("%s is a link - skipping\n", path);
} else {
extant_mboxen[n_extant].full_path = new_string(path);
extant_mboxen[n_extant].mtime = sb.st_mtime;
extant_mboxen[n_extant].size = sb.st_size;
if (paths) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment