-#ifdef MAILGROUP
- setgid(getgid()); /* Return us to normal privileges */
-#endif /* MAILGROUP */
-
- if (audfile) {
- if ((i = stat (audfile, &st)) == NOTOK)
- advise (NULL, "Creating Receive-Audit: %s", audfile);
- if ((aud = fopen (audfile, "a")) == NULL)
- adios (audfile, "unable to append to");
- else if (i == NOTOK)
- chmod (audfile, m_gmprot ());
-
-#ifdef POP
- fprintf (aud, from ? "<<inc>> %s -ms %s\n"
- : host ? "<<inc>> %s -host %s -user %s%s\n"
- : "<<inc>> %s\n",
- dtimenow (0), from ? from : host, user,
- rpop < 0 ? " -apop" : rpop > 0 ? " -rpop" : "");
-#else /* POP */
- fprintf (aud, from ? "<<inc>> %s -ms %s\n" : "<<inc>> %s\n",
- dtimenow (0), from);
-#endif /* POP */
- }
-
-#ifdef MHE
- if (context_find ("mhe")) {
- cp = concat (maildir, "/++", NULL);
- i = stat (cp, &st);
- if ((mhe = fopen (cp, "a")) == NULL)
- admonish (cp, "unable to append to");
- else
- if (i == NOTOK)
- chmod (cp, m_gmprot ());
- free (cp);
- }
-#endif /* MHE */
-
- /* Get new format string */
- nfs = new_fs (form, format, FORMAT);
-
- if (noisy) {
- printf ("Incorporating new mail into %s...\n\n", folder);
- fflush (stdout);
- }
-
-#ifdef POP
- /*
- * Get the mail from a POP server
- */
- if (inc_type == INC_POP) {
- if (packfile) {
- packfile = path (packfile, TFILE);
- if (stat (packfile, &st) == NOTOK) {
- if (errno != ENOENT)
- adios (packfile, "error on file");
- cp = concat ("Create file \"", packfile, "\"? ", NULL);
- if (noisy && !getanswer (cp))
- done (1);
- free (cp);
- }
- msgnum = map_count ();
- if ((pd = mbx_open (packfile, mbx_style, getuid(), getgid(), m_gmprot()))
- == NOTOK)
- adios (packfile, "unable to open");
- if ((pf = fdopen (pd, "w+")) == NULL)
- adios (NULL, "unable to fdopen %s", packfile);
- } else {
- hghnum = msgnum = mp->hghmsg;
- /*
- * Check if we have enough message space for all the new
- * messages. If not, then realloc the folder and add enough
- * space for all new messages plus 10 additional slots.
- */
- if (mp->hghmsg + nmsgs >= mp->hghoff
- && !(mp = folder_realloc (mp, mp->lowoff, mp->hghmsg + nmsgs + 10)))
- adios (NULL, "unable to allocate folder storage");
- }