/** * Return the sender of the mail which was supplied int the MAIL FROM: * command. If its a "null" sender, null will get returned * * @deprecated @see {@link #getMaybeSender()} * * Note that SMTP null sender ( "<>" ) needs to be implicitly handled by the caller under the form of 'null' or * {@link MailAddress#nullSender()}. Replacement method adds type safety on this operation. * * @return sender */ @Deprecated default MailAddress getSender() { return getMaybeSender().asOptional().orElse(MailAddress.nullSender()); }
protected static void checkEnvelope(MailEnvelope env, String sender, List<String> recipients, String msg) throws IOException { assertThat(env.getMaybeSender().asString()).isEqualTo(sender);