@verb #26:"DATA" none none none rdo #55 @program #26:"DATA" none none none "DATA" " Following text is collected as the message." " End with a single dot." if (this.state != 3) return player:tell("503 RCPT must be issued before DATA.") endif player:tell("354 DATA accepted, end with . alone on line.") r = "" cache = {} data = {} for p in ($msg:properties()) if (p[1] == "&") cache = `{@cache, {$msg.(p)[2], strsub(tostr(p, ";"), "_", "")}} ! E_RANGE, E_TYPE => cache' endif endfor while (1) r = read(this) "Silently fail on a stupid pobox bounce message. -whiz" " if (index(r, \"552 Error\") != 0)" " while (1)" " r = read(this);" " if (r == \".\")" " player:tell(\"250 Mail sent successfully.\");" " this:rset();" " return;" " endif" " endwhile" " boot_player(this);" " return;" " endif" if (r == ".") break endif r && r[1] == "." && (r = r[2..$]) "Ok, we're not done yet. We now need to translate the quoted-printable encoding into ampersand-codes. --Cecil" " while (m = match(r, \"=[0-9a-f][0-9a-f]\", 0))" " char = r[m[1] + 1..m[2]];" " code = `listassoc(\"~\" + char, cache)[2] ! E_RANGE => \"\"';" " r = strsub(r, \"=\" + char, code);" " endwhile" data = {@data, r} endwhile this.message = data subj = "" for i in [1..length(this.message)] "Ack, we accidentally removed a line." if (i > length(this.message)) break endif x = this.message[i] if (x == "") this.message = this.message[i..$] if (`this.message[1] ! E_RANGE' == "") this.message = `this.message[2..$] ! E_RANGE => this.message' endif break elseif (index(x, "Subject:") == 1) subj = x[length($string_utils:explode(x)[1]) + 2..$] " this.message = `this.message[i + 1..$] ! E_RANGE => {}';" elseif (match(x, "^Message-ID:")) "Ignore their message id." else this.other_headers = {@this.other_headers, x} endif endfor if (length(subj) > 6 && subj[$ - 6..$] != " (SMTP)") subj = tostr(subj, " (SMTP)") endif "this.message = {@this.message, \"*** Receieved via Internet by SMTP ***\"};" "I think the warning message looked a little too harsh. - Raptor" "I think it still does. Let's put it in the subject line. - Lao" this.other_headers = $mail_agent:unfold_rfc822(this.other_headers) this.other_headers = listinsert(this.other_headers, tostr("Received: from ", $su:connection_hostname(connection_name(player)), " by ", $site, " ; ", $time_utils:rfc1123_time(time())), $mail_agent:locate_received_insert(this.other_headers)) while (rcpt = listassoc(this.daemon, this.to)) if (typeof(this.from) == $OBJ) from = `this.from.email_address ! E_PROPNF => "email@address.none"' else from = this.from endif message = this.message fork (0) this.daemon:("special_rcpt_" + tostr(rcpt[2]))(from, tostr(rcpt[2], "@", $site), subj, message, this.other_headers) endfork this.to = setremove(this.to, rcpt) endwhile try $mail_agent:send_message(this.from, this.to, {subj, @this.other_headers}, this.message) except q (ANY) #8084:tell(toliteral(q)) player:tell("550 Unable to send message.") this:rset() return endtry this:rset() player:tell("250 Message sent successfully.") "Last modified by Lao-Tzu (#8084) on Fri Mar 22 08:00:25 2002 MST." "This verb previously owned by manta (#7165), and chowned to $slacker upon dewizarding (Sat Aug 17 14:50:04 2002 MDT)." "Last modified by Dax (#789) on Tue May 3 13:47:06 2005 MDT." .