-
- snprintf(buffer, sizeof(buffer), "%s/%s",
- mmdfldir[0] ? mmdfldir : home,
- mmdflfil[0] ? mmdflfil : user);
+ char *maildrop;
+
+ if (personal) {
+ /*
+ ** Evaluate the env var and profile only if the check is
+ ** for the calling user.
+ */
+ if ((maildrop = getenv("MAILDROP")) && *maildrop) {
+ snprintf(buffer, sizeof buffer, "%s",
+ toabsdir(maildrop));
+ } else if ((maildrop=context_find("maildrop")) && *maildrop) {
+ snprintf(buffer, sizeof buffer, "%s",
+ toabsdir(maildrop));
+ } else {
+ snprintf(buffer, sizeof buffer, "%s/%s",
+ mailspool, user);
+ }
+ } else {
+ snprintf(buffer, sizeof(buffer), "%s/%s", mailspool, user);
+ }