<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://startofentry.blogdns.org/rdf'>
    <s:Snip rdf:ID='source-changed-MailPasswordKey'
         s:name='source-changed-MailPasswordKey'
         s:cUser='case'
         s:oUser='case'
         s:mUser='case'>
        <s:content>1 ~~NOT ACTIVE ANY MORE~~&#xA;&#xA;&#xA;1 Reason&#xA;&#xA;Again, because dynamic IP, behind router, no DNS, my snipsnap could not post and ForgottenPassword Email providing the correct link to update the password. I managed to post a forwarding link, but that caused problems due to the forwarding (mail key was not valid).&#xA;&#xA;1 Updated org.snipsnap.net.MailPasswordKeyServlet&#xA;&#xA;The Workaround is to get the dynamic IP from a webserver (where it is delivered by a scirpt or a server side include, parse it and include it into the mail-url. I also added a new application.conf entry where you can specify an html page delivering the current ip of the server.&#xA;&#xA;{code}&#xA;public void doPost(HttpServletRequest request, HttpServletResponse response)&#xA;&#9;throws ServletException, IOException {&#xA;   [...]&#xA;   String subject = &quot;Forgotten password&quot;;&#xA;&#9;String url =&#xA;&#9;   WMuteAdressGetter.getWintermuteHostAdress()&#xA;&#9;&#9;+ &quot;/exec/changepass.jsp?key=&quot;&#xA;&#9;&#9;+ key;&#xA;&#9;   String content =&#xA;&#9;&#9;&quot;To change your password go to &lt;a href=\&quot;&quot;&#xA;&#9;&#9;+ url&#xA;&#9;&#9;+ &quot;\&quot;&gt;&quot;&#xA;&#9;&#9;+ url&#xA;&#9;&#9;+ &quot;&lt;/a&gt;&quot;&#xA;&#9;&#9;+ &quot; As the server&apos;s ip address&#xA;                is changing regulary, the link may be outdated soon.&quot;&#xA;&#9;&#9;+ &quot; If this has happend, you can repeat your request&#xA;                for a password key any time again. &quot;&#xA;&#9;&#9;+ &quot;Have a nice day! .&quot;&#xA;&#9;&#9;+ configuration.getName();&#xA;&#xA;&#9;&#9;Mail.getInstance().sendMail(receiver, subject, content);&#xA;  [...]&#xA;{code}&#xA;&#xA;The WMuteAdressGetter was added to retrieve the IP Address-url.&#xA;&#xA;{code}&#xA;public class WMuteAdressGetter {&#xA;   final static String HEADER = &quot;http://&quot;;&#xA;   static String PORT = &quot;:&quot;;&#xA;   public static String getWintermuteHostAdress() {&#xA;&#9;AppConfiguration configuration = Application.get().getConfiguration();&#xA;&#9;String ipUrl = configuration.getProperty(&quot;app.ipurl&quot;);&#xA;&#9;&#xA;&#9;HttpURLConnection httpCon;&#xA;&#9;String result = &quot;HOST_ADRESS_FROM_WINTERMUTE.DE/HOME&quot;;&#xA;&#9;try {&#xA;&#9;   URL url = new URL(ipUrl);&#xA;   &#9;   httpCon = (HttpURLConnection) url.openConnection();&#xA;&#9;   httpCon.setFollowRedirects(true);&#xA;&#9;   BufferedReader in =&#xA;&#9;&#9;new BufferedReader(&#xA;&#9;&#9;new InputStreamReader(httpCon.getInputStream()));&#xA;   &#9;   String line;&#xA;&#9;   StringBuffer sb = new StringBuffer();&#xA;&#9;   while ((line = in.readLine()) != null) {&#xA;&#9;&#9;sb.append(line);&#xA;&#9;   }&#xA;&#9;   in.close();&#xA;&#9;   httpCon.disconnect();&#xA;&#9;   result = HEADER + parseIP(sb.toString()) + PORT + &#xA;              configuration.getProperty(&quot;app.port&quot;);&#xA;&#9;} catch (UnknownHostException e) {&#xA;&#9;} catch (IOException e) {&#xA;&#9;}&#xA;      return result;&#xA;   }&#xA;   /**&#xA;    * Method parseIP.&#xA;    * @param string&#xA;    * @return String&#xA;    */&#xA;    private static String parseIP(String string) {&#xA;&#9;String result = &quot;wintermute.de/home&quot;;&#xA;&#9;Pattern p =&#xA;&#9;   Pattern.compile(&#xA;&#9;&#9;&quot;.*\\s((?:[0-9]{1,3}[.]){3}(?:[0-9]{1,3})).*&quot;,&#xA;&#9;&#9;Pattern.DOTALL);&#xA;        Matcher m = p.matcher(string);&#xA;&#9;boolean b = m.matches();&#xA;&#9;if (b) {&#xA;           int start = m.start(1);&#xA;           int end = m.end(1);&#xA;           result = string.substring(start, end);&#xA;        }&#xA;&#9;return result;&#xA;    }&#xA;} &#xA;{code}&#xA;</s:content>
        <s:mTime>2004-01-25 13:40:09.08</s:mTime>
        <s:cTime>2003-01-23 22:01:45.952</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#SnipSnap'/>
                <rdf:li rdf:resource='#Snipsnap'/>
                <rdf:li rdf:resource='#source-changed-commentsnip'/>
                <rdf:li rdf:resource='#source-changed-mailpasswordkey'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
