- /*
- * Now add it to the config
- */
-
- RoomMailAddressLen = strlen(RoomMailAddress);
- listsub_generate_token(token);
- Line = (RoomNetCfgLine*)malloc(sizeof(RoomNetCfgLine));
- memset(Line, 0, sizeof(RoomNetCfgLine));
-
- Line->Value = (StrBuf**) malloc(sizeof(StrBuf*) * 5);
-
- Line->Value[0] = *email; *email = NULL;
- Line->Value[1] = *subtype; *subtype = NULL;
- Line->Value[2] = NewStrBufPlain(token, -1);
- Line->Value[3] = NewStrBufPlain(NULL, 10);
- StrBufPrintf(Line->Value[3], "%ld", time(NULL));
- Line->Value[4] = *webpage; *webpage = NULL;
- Line->nValues = 5;
-
- AddRoomCfgLine(OneRNCfg, &qrbuf, subpending, Line);
-
- /* Generate and send the confirmation request */
- UrlRoom = NewStrBuf();
- StrBufUrlescAppend(UrlRoom, NULL, qrbuf.QRname);
-
- cf_req = NewStrBufPlain(NULL, 2048);
- StrBufAppendBufPlain(
- cf_req,
- HKEY("MIME-Version: 1.0\n"
- "Content-Type: multipart/alternative; boundary=\"__ctdlmultipart__\"\n"
- "\n"
- "This is a multipart message in MIME format.\n"
- "\n"
- "--__ctdlmultipart__\n"
- "Content-type: text/plain\n"
- "\n"
- "Someone (probably you) has submitted a request to subscribe\n"
- "<"), 0);
- StrBufAppendBuf(cf_req, Line->Value[0], 0);
-
- StrBufAppendBufPlain(cf_req, HKEY("> to the '"), 0);
- StrBufAppendBufPlain(cf_req, RoomMailAddress, RoomMailAddressLen, 0);
-
- StrBufAppendBufPlain(
- cf_req,
- HKEY("' mailing list.\n"
- "\n"
- "Please go here to confirm this request:\n"
- " "), 0);
- StrBufAppendBuf(cf_req, Line->Value[4], 0);
-
- StrBufAppendBufPlain(cf_req, HKEY("?room="), 0);
- StrBufAppendBuf(cf_req, UrlRoom, 0);
-
- StrBufAppendBufPlain(cf_req, HKEY("&token="), 0);
- StrBufAppendBuf(cf_req, Line->Value[2], 0);
-
- StrBufAppendBufPlain(
- cf_req,
- HKEY("&cmd=confirm \n"
- "\n"
- "If this request has been submitted in error and you do not\n"
- "wish to receive the '"), 0);
- StrBufAppendBufPlain(cf_req, RoomMailAddress, RoomMailAddressLen, 0);
-
- StrBufAppendBufPlain(
- cf_req,
- HKEY("' mailing list, simply do nothing,\n"
- "and you will not receive any further mailings.\n"
- "\n"
- "--__ctdlmultipart__\n"
- "Content-type: text/html\n"
- "\n"
- "<HTML><BODY>\n"
- "Someone (probably you) has submitted a request to subscribe\n"
- "<"), 0);
- StrBufAppendBuf(cf_req, Line->Value[0], 0);
-
- StrBufAppendBufPlain(cf_req, HKEY( "> to the <B>"), 0);
-
- StrBufAppendBufPlain(cf_req, RoomMailAddress, RoomMailAddressLen, 0);
-
- StrBufAppendBufPlain(
- cf_req,
- HKEY("'</B> mailing list.<BR><BR>\n"
- "Please click here to confirm this request:<BR>\n"
- "<A HREF=\""), 0);
- StrBufAppendBuf(cf_req, Line->Value[4], 0);
-
- StrBufAppendBufPlain(cf_req, HKEY("?room="), 0);
- StrBufAppendBuf(cf_req, UrlRoom, 0);
-
- StrBufAppendBufPlain(cf_req, HKEY("&token="), 0);
- StrBufAppendBuf(cf_req, Line->Value[2], 0);
-
- StrBufAppendBufPlain(cf_req, HKEY("&cmd=confirm\">"), 0);
- StrBufAppendBuf(cf_req, Line->Value[4], 0);
-
- StrBufAppendBufPlain(cf_req, HKEY("?room="), 0);
- StrBufAppendBuf(cf_req, UrlRoom, 0);
-
- StrBufAppendBufPlain(cf_req, HKEY("&token="), 0);
- StrBufAppendBuf(cf_req, Line->Value[2], 0);
-
- StrBufAppendBufPlain(
- cf_req,
- HKEY("&cmd=confirm</A><BR><BR>\n"
- "If this request has been submitted in error and you do not\n"
- "wish to receive the '"), 0);
- StrBufAppendBufPlain(cf_req, RoomMailAddress, RoomMailAddressLen, 0);
-
- StrBufAppendBufPlain(
- cf_req,
- HKEY("' mailing list, simply do nothing,\n"
- "and you will not receive any further mailings.\n"
- "</BODY></HTML>\n"
- "\n"
- "--__ctdlmultipart__--\n"), 0);
-
- end_critical_section(S_NETCONFIGS);
-
- pcf_req = SmashStrBuf(&cf_req);
- quickie_message( /* This delivers the message */
- "Citadel",
- NULL,
- ChrPtr(*email),
- NULL,
- pcf_req,
- FMT_RFC822,
- "Please confirm your list subscription"
- );
- free(cf_req);
- cprintf("%d Subscription entered; confirmation request sent\n", CIT_OK);
-
- FreeStrBuf(&UrlRoom);
-}