X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fmail%2FConfirmation.java;h=6f3428da0aaf4ee8568ecefd154dedc359794e57;hb=4b76a31e8f86bc8de673899bbb45252c01e9a0f6;hp=ccb8793c514bcd2781ff314462aaa87a44d5dbba;hpb=e78a29d33bcfa1bc071cf6df0a59d1a170514a6b;p=org.ibex.mail.git diff --git a/src/org/ibex/mail/Confirmation.java b/src/org/ibex/mail/Confirmation.java index ccb8793..6f3428d 100644 --- a/src/org/ibex/mail/Confirmation.java +++ b/src/org/ibex/mail/Confirmation.java @@ -4,7 +4,6 @@ package org.ibex.mail; import java.lang.reflect.*; -//import org.prevayler.*; import org.ibex.crypto.*; import org.ibex.util.*; import org.ibex.mail.protocol.*; @@ -30,7 +29,7 @@ public abstract class Confirmation implements Externalizable { public long expiration; public abstract String getDescription(); public abstract String getURL(String tail); - public int serial; + public int serial; private static HashMap all = new HashMap(); @@ -102,17 +101,20 @@ public abstract class Confirmation implements Externalizable { } public void signAndSend(Address sender, long secret, Date now) throws IOException, Message.Malformed { - SMTP.Outgoing.accept(Message.newMessage(new Fountain.StringFountain("From: " + sender + "\r\n" + - "To: " + who.toString(true) + "\r\n" + - "Subject: confirm " + getDescription() + "\r\n" + - "Message-Id: "+Message.generateFreshMessageId()+"\r\n" + - "\r\n" + - "Please click the link below to " + getDescription() + "\r\n" + - getURL(sign(secret))), - sender, - who - ) - ); + + Headers h = new Headers(new String[] { + "From", sender.toString(true), + "To", who.toString(true), + "Message-Id", Message.generateFreshMessageId(), + "Date", new Date()+"" /*FIXME!!!*/, + "Subject", "confirm " + getDescription() + }); + + Fountain fountain = Fountain.Util.create("Please click the link below to " + + getDescription() + "\r\n" + + getURL(sign(secret))); + Message m = Message.newMessageFromHeadersAndBody(h, fountain, sender, who); + SMTP.Outgoing.enqueue(m); } public String sign(long secret) throws IOException {