X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fpopi.c;h=3a03c0a5232a2cd32902d05b4e707b312e05bc2b;hp=2fae38164b4f6b8eca626d840bff9fa3490a587a;hb=fb49dd82ec42997b9df97f221c920f6596102c0a;hpb=8f4c5da8971926f7eccc912f7998c343aef3c33b diff --git a/uip/popi.c b/uip/popi.c index 2fae381..3a03c0a 100644 --- a/uip/popi.c +++ b/uip/popi.c @@ -3,12 +3,17 @@ * popi.c -- POP initiator for MPOP * * $Id$ + * + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include #include #include -#include +#include +#include #include #ifndef RPOP @@ -76,7 +81,6 @@ static char mailname[BUFSIZ]; static char *nfs = NULL; static struct msgs *mp; -extern int errno; extern char response[]; /* @@ -211,7 +215,7 @@ main (int argc, char **argv) } snprintf (mailname, sizeof(mailname), "PO box for %s@%s", user, host); - if (pop_init (host, user, pass, snoop, rpop) == NOTOK) + if (pop_init (host, user, pass, NULL, snoop, rpop) == NOTOK) adios (NULL, "%s", response); if (rpop > 0) setuid (getuid ()); @@ -225,16 +229,7 @@ main (int argc, char **argv) folder = getfolder (0); maildir = m_maildir (folder); - if (stat (maildir, &st) == NOTOK) { - if (errno != ENOENT) - adios (maildir, "error on folder"); - cp = concat ("Create folder \"", maildir, "\"? ", NULL); - if (noisy && !getanswer (cp)) - done (1); - free (cp); - if (!makedir (maildir)) - adios (NULL, "unable to create folder %s", maildir); - } + create_folder(maildir, 0, done); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); @@ -399,8 +394,7 @@ popi (void) if (*dp == '\\' || *dp == '"' || *dp == '\n') i++; i++; - if ((ep = malloc ((unsigned) i)) == NULL) - adios (NULL, "out of memory"); + ep = mh_xmalloc ((unsigned) i); for (dp = nfs, fp = ep; *dp; dp++) { if (*dp == '\n') { *fp++ = '\\', *fp++ = 'n'; @@ -515,7 +509,7 @@ msh (void) #ifdef SMTPMTS -#include +#include #include static int