*/
#include <stdio.h>
+#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
#endif
char *concat ();
+void fatal(), error(), pfatal_with_name();
+void mbx_write(), mbx_delimit_begin(), mbx_delimit_end();
+int pop_init(), popmail(), pop_command(), pop_stat(), pop_retr();
+int getline(), multiline(), putline();
+
extern int errno;
/* Nonzero means this is name of a lock file to delete on fatal error. */
char *delete_lockname;
-main (argc, argv)
+int main (argc, argv)
int argc;
char **argv;
{
\f
/* Print error message and exit. */
-fatal (s1, s2)
+void fatal (s1, s2)
char *s1, *s2;
{
if (delete_lockname)
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
-error (s1, s2, s3)
+void error (s1, s2, s3)
char *s1, *s2, *s3;
{
printf ("movemail: ");
printf ("\n");
}
-pfatal_with_name (name)
+void pfatal_with_name (name)
char *name;
{
char *s;
static int debug = 0;
-popmail(user, outfile)
+int popmail(user, outfile)
char *user;
char *outfile;
{
int mbfi;
FILE *mbf;
char *getenv();
- int mbx_write();
char *get_errmsg();
#ifdef HESIOD
struct hes_postoffice *p;
return(0);
}
-pop_init(host)
+int pop_init(host)
char *host;
{
register struct hostent *hp;
register struct servent *sp;
+#ifndef KERBEROS
int lport = IPPORT_RESERVED - 1;
+#endif
struct sockaddr_in sin;
int s;
char *get_errmsg();
}
#endif /* KRB4 */
#ifdef KRB5
- krb5_init_context(&context);
- krb5_init_ets(context);
+ retval = krb5_init_context(&context);
+ if (retval) {
+ com_err("movemail", retval, "while initializing krb5");
+ exit(1);
+ }
- if (retval = krb5_cc_default(context, &ccdef)) {
+ if ((retval = krb5_cc_default(context, &ccdef))) {
krb5error:
sprintf(Errmsg, "krb5 error: %s", error_message(retval));
close(s);
return(NOTOK);
}
- if (retval = krb5_cc_get_principal(context, ccdef, &client)) {
+ if ((retval = krb5_cc_get_principal(context, ccdef, &client))) {
goto krb5error;
}
- if (retval = krb5_sname_to_principal(context, hostname, POP_SNAME,
- KRB5_NT_SRV_HST, &server)) {
+ if ((retval = krb5_sname_to_principal(context, hostname, POP_SNAME,
+ KRB5_NT_SRV_HST, &server))) {
goto krb5error;
}
return(OK);
}
-pop_command(fmt, a, b, c, d)
+int pop_command(fmt, a, b, c, d)
char *fmt;
char *a, *b, *c, *d;
{
}
-pop_stat(nmsgs, nbytes)
+int pop_stat(nmsgs, nbytes)
int *nmsgs, *nbytes;
{
char buf[128];
}
}
-pop_retr(msgno, action, arg)
+int pop_retr(msgno, action, arg)
int msgno;
-int (*action)();
+void (*action)();
void* arg; /* may always be FILE* -- eichin -- XXX */
{
char buf[1024];
}
}
-getline(buf, n, f)
+int getline(buf, n, f)
char *buf;
register int n;
FILE *f;
return(OK);
}
-multiline(buf, n, f)
+int multiline(buf, n, f)
char *buf;
register int n;
FILE *f;
return(s);
}
-putline(buf, err, f)
+int putline(buf, err, f)
char *buf;
char *err;
FILE *f;
return(OK);
}
-mbx_write(line, mbf)
+void mbx_write(line, mbf)
char *line;
FILE *mbf;
{
fputc(0x0a, mbf);
}
-mbx_delimit_begin(mbf)
+void mbx_delimit_begin(mbf)
FILE *mbf;
{
#ifdef OUTPUT_MMDF_FORMAT
#endif
}
-mbx_delimit_end(mbf)
+void mbx_delimit_end(mbf)
FILE *mbf;
{
#ifdef OUTPUT_MMDF_FORMAT