- int i, j, others;
- register char *maildir;
- char cur[BUFSIZ];
- register struct dirent *dp;
- register DIR *dd;
-
- switch (i = chdir (maildir = m_maildir (folder))) {
- case OK:
- if (access (".", W_OK) != NOTOK && access ("..", W_OK) != NOTOK)
- break; /* fall otherwise */
-
- case NOTOK:
- snprintf (cur, sizeof(cur), "atr-%s-%s",
- current, m_mailpath (folder));
- if (!context_del (cur)) {
- printf ("[+%s de-referenced]\n", folder);
- return OK;
- }
- advise (NULL, "you have no profile entry for the %s folder +%s",
- i == NOTOK ? "unreadable" : "read-only", folder);
- return NOTOK;
- }
-
- if ((dd = opendir (".")) == NULL)
- adios (NULL, "unable to read folder +%s", folder);
- others = 0;
-
- j = strlen(BACKUP_PREFIX);
- while ((dp = readdir (dd))) {
- switch (dp->d_name[0]) {
- case '.':
- if (strcmp (dp->d_name, ".") == 0
- || strcmp (dp->d_name, "..") == 0)
- continue; /* else fall */
-
- case ',':
+ int i, j, others;
+ register char *maildir;
+ char cur[BUFSIZ];
+ register struct dirent *dp;
+ register DIR *dd;
+
+ switch (i = chdir(maildir = toabsdir(folder))) {
+ case OK:
+ if (access(".", W_OK) != NOTOK && access("..", W_OK) != NOTOK)
+ break; /* fall otherwise */
+
+ case NOTOK:
+ snprintf(cur, sizeof(cur), "atr-%s-%s", seq_cur,
+ toabsdir(folder));
+ if (!context_del(cur)) {
+ printf("[+%s de-referenced]\n", folder);
+ return OK;
+ }
+ advise(NULL, "you have no profile entry for the %s folder +%s",
+ i == NOTOK ? "unreadable" : "read-only",
+ folder);
+ return NOTOK;
+ }
+
+ if ((dd = opendir(".")) == NULL)
+ adios(NULL, "unable to read folder +%s", folder);
+ others = 0;
+
+ /*
+ ** Run the external delete hook program.
+ */
+
+ ext_hook("del-hook", maildir, NULL);
+
+ j = strlen(backup_prefix);
+ while ((dp = readdir(dd))) {
+ switch (dp->d_name[0]) {
+ case '.':
+ if (strcmp(dp->d_name, ".") == 0 ||
+ strcmp(dp->d_name, "..") == 0)
+ continue; /* else fall */
+
+ case ',':