smtp_sendmsg()

This commit is contained in:
psyc://psyced.org/~lynX 2010-01-31 06:35:49 +01:00
parent 4084c8312b
commit 69c1a1e2f5
2 changed files with 22 additions and 2 deletions

View File

@ -621,6 +621,21 @@ int greater_user(object a, object b) { return file_name(a) > file_name(b); }
object* sorted_users() { return sort_array(users(), #'greater_user; }
#endif
volatile mixed mailer;
// simple SMTP interface.. used from person:logAppend - why target?
// assumes that mailto: rcpt has already been checked with legal_mailto() !
int smtp_sendmsg(string target, string method, string data,
mapping vars, string source, string rcpt, string loginurl) {
#ifdef SMTP_PATH
unless (mailer) mailer = SMTP_PATH "outgoing" -> load();
return mailer -> enqueue(target, method, data, vars, source, rcpt,
loginurl);
#else
return 0;
#endif
}
int xmpp_sendmsg(mixed target, string mc, mixed data, mapping vars,
mixed source, array(mixed) u, int showingLog, string otarget) {
string tmp;

View File

@ -86,8 +86,11 @@ reset(a) {
}
create() {
#ifdef DEFAULT_LAYOUT
sTextPath (DEFAULT_LAYOUT, DEFLANG, "smtp");
#else
sTextPath (0, 0, "smtp");
#endif
unless (spool) {
restore_object(SPOOL_FILE);
if (file_format != FILE_FORMAT) spool = 0;
@ -337,9 +340,11 @@ rendermsg(rcpt) {
if (o) m += w("_warning_omitted_messages",
"[_amount_messages_omitted] messages omitted.",
([ "_amount_messages_omitted" : o ]) );
#ifndef _flag_disable_mail_signature
#ifdef DEFAULT_URL_LOGIN
# ifndef _flag_disable_mail_signature
m += "\n--\n"+ w( "_info_mail_signature", "Reply by E-Mail is not possible. Please log in:\n[_URL_login]",
([ "_URL_login": (t2 || DEFAULT_URL_LOGIN) ]) ) + "\n";
# endif
#endif
t2 = "Content-Type: text/plain; charset=" SYSTEM_CHARSET "\n"
#ifndef SEND_FIRST_MSG_AS_SUBJECT