Changeset 66
- Timestamp:
- 03/08/07 15:25:19 (2 years ago)
- Files:
-
- mailblogger/lib.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mailblogger/lib.php
r39 r66 10 10 $CFG->mailblogger_imapusername - required 11 11 $CFG->mailblogger_imappassword - required 12 $CFG->mailblogger_toaddress - required, defines the address messages are sent to 12 13 13 14 $CFG->mailblogger_hostname - optional, defaults to "localhost" … … 20 21 NB: SSL unlikely to work on Windows 21 22 22 $CFG->mailblogger_maildomain - optional.Used in To address detection and in user blurb23 $CFG->mailblogger_maildomain - Used in To address detection and in user blurb 23 24 $CFG->mailblogger_disablecron - optional, defaults to false; 24 25 $CFG->mailblogger_imaprejectedmailbox - optional, if not set, rejected messages are deleted. can not be the same as $CFG->mailblogger_imapmailbox … … 215 216 216 217 if (is_resource($imapresource) && $uid) { 217 218 218 if ($structure = imap_fetchstructure($imapresource, $uid, FT_UID)) { 219 219 $overview = array_shift(imap_fetch_overview($imapresource, $uid, FT_UID)); … … 221 221 $continue = false; 222 222 // TODO - this regexp might want tuning if impure addresses are expected 223 if (preg_match('/^(.+)([0-9]{4}) @(.+)$/', $overview->to, $matches)) {223 if (preg_match('/^(.+)([0-9]{4})$/', $overview->subject, $matches)) { 224 224 $username = $matches[1]; 225 225 $userpin = $matches[2]; 226 $domain = $matches[3]; 226 // $domain = $matches[3]; 227 /* 227 228 if ($CFG->mailblogger_maildomain && $CFG->mailblogger_maildomain != $domain) { 228 229 mtrace('mailblogger: ignored a message due to bad To domain'); 229 } elseif ($userid = user_info_username('ident', $username)) { 230 } else 231 */ 232 if ($userid = user_info_username('ident', $username)) { 230 233 231 234 //in the absence of a general "can this username log in" function, cheat... … … 367 370 if ($postbody) { 368 371 $post = new StdClass; 369 $post->title = $overview->subject; 372 // $post->title = $overview->subject; 373 $post->title = __gettext("External message"); 370 374 $post->body = $postbody; 371 375 if ($CFG->default_access == 'PRIVATE') { … … 515 519 $username = user_info('username', $userid); 516 520 if ($username && $userpin && $CFG->mailblogger_maildomain) { 517 $blurb .= '<br />' . __gettext("To blog by phone/mail, send your post to ") . $username . $userpin . '@' . $CFG->mailblogger_maildomain;521 $blurb .= '<br />' . sprintf(__gettext("To blog by phone/mail, send your post to %s with %s as your subject line."), $CFG->mailblogger_toaddress, $username . $userpin . '@' . $CFG->mailblogger_maildomain); 518 522 } 519 523
