+/*
+ * Backend function for smtp_webcit_preferences_hack().
+ * Look at a message and determine if it's the preferences file.
+ */
+void smtp_webcit_preferences_hack_backend(long msgnum, void *userdata) {
+ struct CtdlMessage *msg;
+ char **webcit_conf = (char **) userdata;
+
+ if (*webcit_conf) {
+ return; // already got it
+ }
+
+ msg = CtdlFetchMessage(msgnum, 1);
+ if (msg == NULL) {
+ return;
+ }
+
+ if ( (msg->cm_fields['U']) && (!strcasecmp(msg->cm_fields['U'], "__ WebCit Preferences __")) ) {
+ /* This is it! Change ownership of the message text so it doesn't get freed. */
+ *webcit_conf = (char *)msg->cm_fields['M'];
+ msg->cm_fields['M'] = NULL;
+ }
+ CtdlFreeMessage(msg);
+}
+
+