<?=_Thanks for signing up with SomeCA.org, below is the link you need to open to verify your account. Once your account is verified you will be able to start issuing certificates to your heart's content!?>
<?=$link?>
-
-<?=_Best regards?>
-
-<?=_SomeCA.org Support?>
--- /dev/null
+
+<?=_Kind regards?>,
+<?=_SomeCA.org?>
+
+--
+<?=_This message has automatically been sent by the system.?>
+
+<?=_All emails originating from this domain use S/MIME protection through digital signatures and optional encryption.?>\
+<?=_Please report any unsigned emails, claiming to have originated from this service, to our support (please sign your email if available), by forwarding them including full email headers.?>
+
+<?=_Our support AND all personnel working on our behalf will NEVER ask you to reveal or provide your account credentials (i.e. passwords); although be aware that you might be asked to prove your identity (e.g. by signing your email) in order for support tickets regarding your account to be carried out.?>
+
+<?=_If you are unsure regarding communication you receive via this service, feel free to contact our support.?>
public class MailTemplate extends Template {
+ private static final Template FOOTER = new Template(MailTemplate.class.getResource("MailFooter.templ"));
+
public static final String SUBJECT_TAG = "[SomeCA] ";
private TemplateBlock subjectBlock;
vars.put(Outputable.OUT_KEY_PLAIN, true);
String body = runTemplate(this, l, vars);
+ body += runTemplate(FOOTER, l, vars);
String subject = runTemplate(subjectBlock, l, vars);
SendMail.getInstance().sendMail(to, SUBJECT_TAG + subject, body, null, null, null, null, false);
<?=$link?>
<?=_This process will expire in ${hour_max} hours.?>
-
-<?=_Best regards?>
-<?=_SomeCA.org Support?>
<? if($gotGreaterAll) { ?>\
<?=_You can now apply for RA Agent status or code signing ability.?>
<? } ?>\
-
-<?=_RA DB?>
package org.cacert.gigi.template;
+import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.io.IOException;
testExecuteMail(vars, "Subject: subj\n\n<?=$var?>l");
TestMail tm = getMailReceiver().receive();
assertEquals(MailTemplate.SUBJECT_TAG + "subj", tm.getSubject());
- assertEquals("vall", tm.getMessage());
+ assertThat(tm.getMessage(), startsWith("vall"));
}
@Test
testExecuteMail(vars, "Subject: a<?=$var?>b\n\n<?=$var2?>l");
TestMail tm = getMailReceiver().receive();
assertEquals(MailTemplate.SUBJECT_TAG + "aval\">b", tm.getSubject());
- assertEquals("sl\">l", tm.getMessage());
+ assertThat(tm.getMessage(), startsWith("sl\">l"));
}
testExecuteMail(vars, "Subject: a<?=_a<?>b\n\nc<?=_b\"?>l");
TestMail tm = getMailReceiver().receive();
assertEquals(MailTemplate.SUBJECT_TAG + "aa<b", tm.getSubject());
- assertEquals("cb\"l", tm.getMessage());
+ assertThat(tm.getMessage(), startsWith("cb\"l"));
}
}