diff options
author | Friendika <info@friendika.com> | 2011-09-12 22:24:36 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-09-12 22:24:36 -0700 |
commit | 08fc3e91b6084c71e502e6e7915ac566ea21e9ee (patch) | |
tree | deb1b82e81c988e771a177af9d54ad2177612fc6 /include/Scrape.php | |
parent | 4f24494b0baca1d991cbc74bf3929631c657b676 (diff) | |
download | volse-hubzilla-08fc3e91b6084c71e502e6e7915ac566ea21e9ee.tar.gz volse-hubzilla-08fc3e91b6084c71e502e6e7915ac566ea21e9ee.tar.bz2 volse-hubzilla-08fc3e91b6084c71e502e6e7915ac566ea21e9ee.zip |
bug #148 email subscription issue
Diffstat (limited to 'include/Scrape.php')
-rw-r--r-- | include/Scrape.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/Scrape.php b/include/Scrape.php index b80f24c22..58468a40d 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -430,7 +430,8 @@ function probe_url($url, $mode = PROBE_NORMAL) { $addr = $orig_url; $network = NETWORK_MAIL; $name = substr($url,0,strpos($url,'@')); - $profile = 'http://' . substr($url,strpos($url,'@')+1); + $phost = substr($url,strpos($url,'@')+1); + $profile = 'http://' . $phost; // fix nick character range $vcard = array('fn' => $name, 'nick' => $name, 'photo' => gravatar_img($url)); $notify = 'smtp ' . random_string(); @@ -441,8 +442,15 @@ function probe_url($url, $mode = PROBE_NORMAL) { $adr = imap_rfc822_parse_adrlist($x->from,''); elseif(stristr($x->to,$orig_url)) $adr = imap_rfc822_parse_adrlist($x->to,''); - if(isset($adr) && strlen($adr[0]->personal)) - $vcard['fn'] = notags($adr[0]->personal); + if(isset($adr)) { + foreach($adr as $feadr) { + if((strcasecmp($feadr->mailbox,$name) == 0) + &&(strcasecmp($feadr->host,$phost) == 0) + && (strlen($feadr->personal))) { + $vcard['fn'] = notags($feadr->personal); + } + } + } } imap_close($mbox); } |