if (s.equals(".")) break;
if (s.startsWith(".")) s = s.substring(1);
buf.append(s + "\r\n");
+ if (MAX_MESSAGE_SIZE != -1 && buf.length() > MAX_MESSAGE_SIZE) {
+ Log.error("**"+conn.getRemoteAddress()+"**",
+ "sorry, this mail server only accepts messages of less than " +
+ ByteSize.toString(MAX_MESSAGE_SIZE));
+ throw new MailException.Malformed("sorry, this mail server only accepts messages of less than " +
+ ByteSize.toString(MAX_MESSAGE_SIZE));
+ }
}
String body = buf.toString();
Message m = null;
} catch (Reject.RejectException re) {
Log.warn(SMTP.class, "rejecting message due to: " + re.reason + "\n " + re.m.summary());
conn.println("501 " + re.reason);
- } catch (MailException.Malformed mfe) { conn.println("501 " + mfe.toString());
+ } catch (MailException.Malformed mfe) { conn.println("501 " + mfe.toString());
} catch (MailException.MailboxFull mbf) { conn.println("452 " + mbf);
} catch (Later.LaterException le) { conn.println("453 try again later");
} catch (IOException ioe) {