Author: norman Date: Sun Jul 9 06:02:12 2006 New Revision: 420289 URL: http://svn.apache.org/viewvc?rev=420289&view=rev Log: Throw MessagingException if needed config values missed. See JAMES-560
Modified: james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/SetMimeHeader.java Modified: james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/SetMimeHeader.java URL: http://svn.apache.org/viewvc/james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/SetMimeHeader.java?rev=420289&r1=420288&r2=420289&view=diff ============================================================================== --- james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/SetMimeHeader.java (original) +++ james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/SetMimeHeader.java Sun Jul 9 06:02:12 2006 @@ -17,6 +17,7 @@ package org.apache.james.transport.mailets; +import javax.mail.MessagingException; import javax.mail.internet.MimeMessage ; import org.apache.mailet.GenericMailet ; @@ -50,9 +51,15 @@ /** * Initialize the mailet. */ - public void init() { + public void init() throws MessagingException { headerName = getInitParameter("name"); headerValue = getInitParameter("value"); + + // Check if needed config values are used + if (headerName == null || headerName.equals("") || headerValue == null + || headerValue.equals("")) { + throw new MessagingException("Please configure a name and a value"); + } } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]