FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Forum email address conversion  () 1 Vote
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Forum email address conversion [message #22576] Mon, 07 February 2005 16:19 Go to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Hi,

This forum converts all words containing "@" into email addresses. Examples: frank@localhost, scott@orcl, me@work and you@home.

Please consider checking for a "." as well to ensure they are more likely to be email addresses.

Best regards.

Frank
Re: Forum email address conversion [message #22578 is a reply to message #22576] Mon, 07 February 2005 16:47 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Actually

foo@localhost is a valid address. The "domain" does not necessarily need to have a ".", especially when dealing with 'local' addresses or aliases.


FUDforum Core Developer
Re: Forum email address conversion [message #22580 is a reply to message #22578] Mon, 07 February 2005 16:57 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Thank you for the reply. However, that is still not something you would want your users to click on.

I will prepare a fix for my forum, if anyone else is interested, please let me know.

Best regards.

Frank
Re: Forum email address conversion [message #22586 is a reply to message #22580] Mon, 07 February 2005 18:32 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Here is the patch:

--- ./src/post_proc.inc.t.old   2005-02-07 12:52:41.000000000 -0600
+++ ./src/post_proc.inc.t       2005-02-07 13:30:15.000000000 -0600
@@ -493,6 +493,9 @@
                }

                $email = str_replace('@', '@', substr($ostr, $es, $ee-$es));
+                if (strpos( substr($email,1,-1), '.') == false) {      // EMail must have a . (dot)
+                       $ppos = $pos += 1; continue;
+               }
                $email_url = '<a href="mailto:'.$email.'" target="_blank">'.$email.'</a>';
                $email_url_l = strlen($email_url);
                $ostr = fud_substr_replace($ostr, $email_url, $es, $ee-$es);


Best regards.

Frank
Re: Forum email address conversion [message #23328 is a reply to message #22586] Sat, 12 March 2005 18:49 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Please consider adding this patch (or a variation of it) to CVS.

Best regards.

Frank
Re: Forum email address conversion [message #23334 is a reply to message #23328] Sat, 12 March 2005 21:29 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
forum already does e-mail address encoding, it may not look it from the output, but if you view source of the HTML you'll see that the raw e-mail is not being displayed.

FUDforum Core Developer
Re: Forum email address conversion [message #23341 is a reply to message #23334] Sun, 13 March 2005 06:09 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
This thread is not about address encoding, but about too easily converting words to email addresses.

Currently all words with a "@" in it are converted to email addresses. With this patch, only words with a "@", and at least one "." will be converted.

Best regards.

Frank
Re: Forum email address conversion [message #23343 is a reply to message #23341] Sun, 13 March 2005 06:34 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
E-mail address does not need to have a "." to be valid. As long as host can be resolved it'll work, for example as long as my machine can resolve "foo" email@foo is a valid address.

FUDforum Core Developer
Re: Forum email address conversion [message #23344 is a reply to message #23343] Sun, 13 March 2005 07:13 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
OK, I've just read RFC 2822 and you are 100% spot on.

I will, however, still need to apply this patch on my forum where words with "@" and without a "." is more likely to be a connect string than an email address.

Thank you for your time.

Best regards.

Frank
Re: Forum email address conversion [message #23676 is a reply to message #22576] Fri, 25 March 2005 22:02 Go to previous messageGo to next message
krbvroc1 is currently offline  krbvroc1   United States
Messages: 31
Registered: February 2005
Karma: 0
Member
Using 2.6.9 - when people post an email address to the forum, when it is gatewayed to the newsgroup the email address is getting encoded. Why? How can I disable this?
Re: Forum email address conversion [message #23678 is a reply to message #23676] Fri, 25 March 2005 22:20 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
encoded how?

FUDforum Core Developer
Re: Forum email address conversion [message #23684 is a reply to message #23678] Sat, 26 March 2005 03:46 Go to previous messageGo to next message
Anonymous   United States
Ilia wrote on Fri, 25 March 2005 17:20

encoded how?


user(at)fudforum(dot)org shows up on the NNTP server
with the '@' symbol replaced with an 'ampersand pound 64 semicolon'.
Re: Forum email address conversion [message #23694 is a reply to message #23684] Sat, 26 March 2005 15:08 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
fixed in cvs.

FUDforum Core Developer
Re: Forum email address conversion [message #23703 is a reply to message #23694] Sat, 26 March 2005 21:28 Go to previous messageGo to next message
krbvroc1 is currently offline  krbvroc1   United States
Messages: 31
Registered: February 2005
Karma: 0
Member
Ilia wrote on Sat, 26 March 2005 10:08

fixed in cvs.


I applied the CVS (just for file email_msg_format.inc) and am having a problem. Instead of the

user(at)fudforum(dot)org showing up on the NNTP server as plain text, it shows up as HTML code.

test again of <a href="mailto:user(at)fudforum(dot)org" target="_blank">user(at)fudforum(dot)org</a><br />

(Note: I've got HTML posting disabled, only Fudcode allowed on my forum config since it gates to both a newsgroup and a mailing list).
Re: Forum email address conversion [message #23723 is a reply to message #23703] Sun, 27 March 2005 16:12 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
fixed in cvs.

FUDforum Core Developer
Re: Forum email address conversion [message #23724 is a reply to message #23703] Sun, 27 March 2005 16:13 Go to previous messageGo to next message
krbvroc1 is currently offline  krbvroc1   United States
Messages: 31
Registered: February 2005
Karma: 0
Member
krbvroc1 wrote on Sat, 26 March 2005 16:28

Ilia wrote on Sat, 26 March 2005 10:08

fixed in cvs.


I applied the CVS (just for file email_msg_format.inc) and am having a problem. Instead of the

user(at)fudforum(dot)org showing up on the NNTP server as plain text, it shows up as HTML code.

test again of <a href="mailto:user(at)fudforum(dot)org" target="_blank">user(at)fudforum(dot)org</a><br />

(Note: I've got HTML posting disabled, only Fudcode allowed on my forum config since it gates to both a newsgroup and a mailing list).


If I simply add the code to my version 1.12 of email_msg_format.inc

/* handle encoded e-mails */
if (strpos($data, '@') !== false) {
$data = str_replace('@', '@', $data);
}

it works. It seems for some reasons that the latest CVS of this file (1.13) broke something. The following (from 1.12) works

$data = strip_tags($data);
reverse_fmt($data);

return html_entity_decode($data);

BUT this (from 1.13) DOESN'T:

return html_entity_decode(reverse_fmt(strip_tags($data)));

Huh?
Re: Forum email address conversion [message #23726 is a reply to message #23724] Sun, 27 March 2005 16:17 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The newest patch fixes this.

FUDforum Core Developer
icon14.gif  Re: Forum email address conversion [message #24156 is a reply to message #22576] Sun, 17 April 2005 17:04 Go to previous message
Anonymous   China
kirkmont001(at)bytefocus(dot)com
north001(at)probenetwork(dot)com
sunrise001(at)bytefocus(dot)com

ttffmail(at)eyou(dot)com
lovesunny001(at)hotmail(dot)com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Forum navigation
Next Topic: Search Tree View
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Apr 24 02:43:14 GMT 2024

Total time taken to generate the page: 0.02514 seconds