Adrian Aichner <aichner(a)ecf.teradyne.com> writes:
When I define MAIL_USE_POP, I can't get movemail.c compile due
to
undefined macros like O_CREAT. I tried compiling with HAVE_FCNTL_H
too, to get <fcntl.h> included. Even adding _POSIX_=1 did not do the
trick.
As always, any help would be appreciated.
Adrian
This is the quick and dirty one that will do the trick. Something is
wrong with native win32 in src/systime.h, because including winsock
bugs withe redefinition of dome types.
Also, movemail.exe need to be linked to winsock to use pop.
I guess there are cleaner ways to handle the cases login/password
stuff, but I doubt they are useful under native win32.
--
Fabrice POPINEAU
------------------------
e-mail: popineau(a)ese-metz.fr | "God is real ...
Fabrice.POPINEAU(a)supelec.fr |
voice-mail: +33 (0) 387764715 | ... unless integer ?"
surface-mail: Supelec, 2 rue E. Belin, |
F-57078 Metz Cedex 3 |
--- nt/xemacs.mak~ Mon Dec 14 11:20:29 1998
+++ nt/xemacs.mak Mon Dec 14 14:06:27 1998
@@ -504,6 +504,9 @@
ETAGS_DEPS = $(LIB_SRC)/getopt.c $(LIB_SRC)/getopt1.c $(LIB_SRC)/../src/regex.c
$(LIB_SRC)/etags.exe : $(LIB_SRC)/etags.c $(ETAGS_DEPS)
$(LIB_SRC)/movemail.exe: $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS)
+ @cd $(LIB_SRC)
+ $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) -O2 -W3 -Fe$@ $**
wsock32.lib
+ @cd $(NT)
LIB_SRC_TOOLS = \
$(LIB_SRC)/make-docfile.exe \
--- src/config.h~ Mon Dec 14 11:20:29 1998
+++ src/config.h Mon Dec 14 14:00:55 1998
@@ -605,7 +605,7 @@
/* movemail options */
/* Should movemail use POP3 for mail access? */
-#undef MAIL_USE_POP
+#define MAIL_USE_POP
/* Should movemail use kerberos for POP authentication? */
#undef KERBEROS
/* Should movemail use hesiod for getting POP server host? */
--- lib-src/pop.c~ Tue Mar 31 21:10:58 1998
+++ lib-src/pop.c Mon Dec 14 14:05:30 1998
@@ -38,7 +38,7 @@
#include <sys/types.h>
#ifdef WINDOWSNT
-#include "ntlib.h"
+#include "../src/config.h"
#include <winsock.h>
#undef SOCKET_ERROR
#define RECV(s,buf,len,flags) recv(s,buf,len,flags)
@@ -77,7 +77,9 @@
#include <sys/stat.h>
#include <sys/file.h>
#include "../src/syswait.h"
+#ifndef WINDOWSNT
#include "../src/systime.h"
+#endif
#include <stdlib.h>
#include <string.h>
@@ -183,6 +185,7 @@
username = getenv ("USER");
if (! (username && *username))
{
+#ifndef WINDOWSNT
username = getlogin ();
if (! (username && *username))
{
@@ -198,6 +201,10 @@
return (0);
}
}
+#else
+ strcpy (pop_error, "Could not determine username");
+ return (0);
+#endif
}
}
@@ -247,10 +254,12 @@
if ((! password) && (! DONT_NEED_PASSWORD))
{
+#ifndef WINDOWSNT
if (! (flags & POP_NO_GETPASS))
{
password = getpass ("Enter POP password:");
}
+#endif
if (! password)
{
strcpy (pop_error, "Could not determine POP password");
--- lib-src/movemail.c~ Mon Dec 14 11:16:35 1998
+++ lib-src/movemail.c Mon Dec 14 14:05:08 1998
@@ -61,8 +61,11 @@
#include <sys/file.h>
#include <stdio.h>
#include <errno.h>
+#include "../src/sysfile.h"
#include "../src/syswait.h"
+#ifndef WINDOWSNT
#include "../src/systime.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include "getopt.h"
@@ -305,7 +308,9 @@
exit (retcode);
}
+#ifndef WINDOWSNT
setuid (getuid ());
+#endif
#endif /* MAIL_USE_POP */
#ifndef DISABLE_DIRECT_ACCESS
@@ -632,7 +637,7 @@
error ("Error in open: %s, %s", strerror (errno), outfile);
return (1);
}
-#ifndef __CYGWIN32__
+#if !defined(__CYGWIN32__) && !defined(WINDOWSNT)
fchown (mbfi, getuid (), -1);
#endif