X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=mts%2Fsmtp%2Fsmtp.c;h=025bb966c3516f7c5e653382d5680d42e7f6dfcb;hp=f7756381d2df2aae2858534215fa9ab575f9d79b;hb=2da3024caea2be71550f9eabd2fbc08fefe29bb5;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index f775638..025bb96 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -9,6 +9,12 @@ #include "smtp.h" #include #include +#include +#ifdef MPOP +#include +#endif + + /* * This module implements an interface to SendMail very similar @@ -71,10 +77,6 @@ static char *sm_moreply = "; "; struct smtp sm_reply; /* global... */ -#ifdef MPOP -extern int errno; -#endif - #define MAXEHLO 20 @@ -105,6 +107,8 @@ static int smail_brkany (char, char *); char **smail_copyip (char **, char **, int); #endif +/* from zotnet/mts/client.c */ +int client (char *, char *, char *, int, char *, int); int sm_init (char *client, char *server, int watch, int verbose, @@ -126,11 +130,13 @@ sm_init (char *client, char *server, int watch, int verbose, if (sm_rfp != NULL && sm_wfp != NULL) goto send_options; - if (client == NULL || *client == '\0') - if (clientname) + if (client == NULL || *client == '\0') { + if (clientname) { client = clientname; - else + } else { client = LocalName(); /* no clientname -> LocalName */ + } + } #ifdef ZMAILER if (client == NULL || *client == '\0') @@ -248,12 +254,16 @@ rclient (char *server, char *protocol, char *service) if ((dp = strrchr(*ap, '/')) && *++dp == NULL) *--dp = NULL; snprintf (sm_tmpfil, sizeof(sm_tmpfil), "%s/smtpXXXXXX", *ap); +#ifdef HAVE_MKSTEMP + sd = mkstemp (sm_tmpfil); +#else mktemp (sm_tmpfil); if ((sd = creat (sm_tmpfil, 0600)) != NOTOK) { sm_ispool = 1; break; } +#endif } free (cp); @@ -1001,16 +1011,17 @@ sm_wstream (char *buffer, int len) } -#ifdef _AIX /* - * AIX by default will inline the strlen and strcpy commands by redefining - * them as __strlen and __strcpy respectively. This causes compile problems - * with the #ifdef MPOP in the middle. Should the #ifdef MPOP be removed, - * remove these #undefs. + * On some systems, strlen and strcpy are defined as preprocessor macros. This + * causes compile problems with the #ifdef MPOP in the middle. Should the + * #ifdef MPOP be removed, remove these #undefs. */ +#ifdef strlen # undef strlen +#endif +#ifdef strcpy # undef strcpy -#endif /* _AIX */ +#endif static int sm_werror (void)