diff --git a/network/main/mkgeturl.c b/network/main/mkgeturl.c index 9cb4046dec8b..31cb0228aeb7 100644 --- a/network/main/mkgeturl.c +++ b/network/main/mkgeturl.c @@ -795,7 +795,9 @@ NET_InitNetLib(int socket_buffer_size, int max_number_of_connections) #endif NET_InitTotallyRandomStuffPeopleAddedProtocols(); +#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE) NET_InitMailtoProtocol(); /* has a stub for MOZ_MAIL_NEWS */ +#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */ #ifdef MOZ_MAIL_NEWS NET_InitNewsProtocol(); NET_InitMailboxProtocol(); @@ -4868,7 +4870,7 @@ NET_DestroyEvidence() NET_SetMemoryCacheSize(oldSize); /* set it back up */ } -#ifndef MOZ_MAIL_NEWS +#if !defined(MOZ_MAIL_NEWS) && !defined(MOZ_MAIL_COMPOSE) /* this whole mess should get moved to the mksmtp.c file * where it can share the InitMailtoProtocol function diff --git a/network/main/mkutils.c b/network/main/mkutils.c index 44b9d5e5adc1..d7c6027a4352 100644 --- a/network/main/mkutils.c +++ b/network/main/mkutils.c @@ -2386,7 +2386,7 @@ NET_AddLOSubmitDataToURLStruct(LO_FormSubmitData * sub_data, /* If we're posting to mailto, then generate the full complement of mail headers; and allow the url to specify additional headers as well. */ -#ifdef MOZ_MAIL_NEWS +#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE) if (!PL_strncasecmp(url_struct->address, "mailto:", 7)) { #ifdef MOZILLA_CLIENT @@ -2413,7 +2413,7 @@ NET_AddLOSubmitDataToURLStruct(LO_FormSubmitData * sub_data, PR_ASSERT(0); #endif /* MOZILLA_CLIENT */ } -#endif /* MOZ_MAIL_NEWS */ +#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */ if(encoding && !PL_strcasecmp(encoding, "text/plain")) { @@ -3418,7 +3418,7 @@ NET_InitWAISProtocol(void) NET_RegisterProtocolImplementation(&wais_proto_impl, WAIS_TYPE_URL); } -#ifdef MOZ_MAIL_NEWS +#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE) PUBLIC char * NET_Base64Encode (char *src, int32 srclen) @@ -3485,7 +3485,7 @@ NET_Base64Decode (char *src, return bs.buffer; } -#endif /* MOZ_MAIL_NEWS */ +#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */ /* A utility function to fetch a file from cache right away, * and update it (from the original server) after its used. diff --git a/network/protocol/Makefile b/network/protocol/Makefile index d598bbf28f65..1b52c13ffef2 100644 --- a/network/protocol/Makefile +++ b/network/protocol/Makefile @@ -50,6 +50,12 @@ DIRS += \ imap4 \ certld \ $(NULL) +else +ifdef MOZ_MAIL_COMPOSE +DIRS += \ + smtp \ + $(NULL) +endif endif DIRS += http diff --git a/network/protocol/smtp/mksmtp.c b/network/protocol/smtp/mksmtp.c index 369f5dabc4bf..67d244f0b342 100644 --- a/network/protocol/smtp/mksmtp.c +++ b/network/protocol/smtp/mksmtp.c @@ -543,15 +543,17 @@ net_smtp_auth_login_response(ActiveEntry *cur_entry) switch (CD_RESPONSE_CODE/100) { case 2: { +#ifdef MOZ_MAIL_NEWS char *pop_password = (char *)NET_GetPopPassword(); CD_NEXT_STATE = SMTP_SEND_HELO_RESPONSE; if (pop_password == NULL) NET_SetPopPassword2(net_smtp_password); -#ifdef MOZ_MAIL_NEWS if ( IMAP_GetPassword() == NULL ) IMAP_SetPassword(net_smtp_password); -#endif /* MOZ_MAIL_NEWS */ XP_FREEIF(pop_password); +#else /* MOZ_MAIL_NEWS */ + XP_ASSERT(0); +#endif /* MOZ_MAIL_NEWS */ } break; case 3: @@ -565,7 +567,7 @@ net_smtp_auth_login_response(ActiveEntry *cur_entry) char *username = 0; char host[256]; int len = 256; -#endif; +#endif /* NET_GetPopUsername () returns pointer to the cached * username. It did *NOT* alloc a new string */ @@ -656,7 +658,9 @@ net_smtp_auth_login_password(ActiveEntry *cur_entry) if (!net_smtp_password || !*net_smtp_password) { XP_FREEIF(net_smtp_password); /* in case its an empty string */ +#ifdef MOZ_MAIL_NEWS net_smtp_password = (char *) NET_GetPopPassword(); +#endif /* MOZ_MAIL_NEWS */ } if (!net_smtp_password || !*net_smtp_password) { @@ -1304,10 +1308,12 @@ HG61365 encrypt_p, sign_p, force_plain_text, html_part); +#ifdef MOZ_MAIL_NEWS if (cpane && CE_URL_S->fe_data) { /* Tell libmsg what to do after deliver the message */ MSG_SetPostDeliveryActionInfo (cpane, CE_URL_S->fe_data); } +#endif /* MOZ_MAIL_NEWS */ FREEIF(from); FREEIF(reply_to); @@ -1679,6 +1685,13 @@ Subject: %s\n\ } +#ifndef MOZ_MAIL_NEWS +PUBLIC const char* +NET_GetPopUsername () +{ + return 0; +} +#endif /* MOZ_MAIL_NEWS */ #endif /* defined(MOZILLA_CLIENT) || defined(LIBNET_SMTP) */