Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
N/A
Description
James automatically adds a PostmasterAlias mailet to the root processor. This is ok for a simple setup, but causes problems in a virtual hosting environment, as different domains may have different postmaster accounts.
The fix is to remove the hard-coded mailet, and put it in the xml configuration file.
A patch to do this is as follows:
— src\conf\james-config_orig.xml Mon Apr 04 12:20:31 2005
+++ src\conf\james-config.xml Mon Apr 04 12:29:52 2005
@@ -149,6 +149,12 @@
<!-- This configuration is a sample configuration for the root processor. -->
<processor name="root">
+ <!-- This mailet redirects mail for the user 'postmaster' at any local domain to -->
+ <!-- the postmaster address specified for the server. The postmaster address -->
+ <!-- is required by rfc822. Do not remove this mailet unless you are meeting -->
+ <!-- this requirement through other means (e.g. a XML/JDBCVirtualUserTable mailet) -->
+ <mailet match="All" class="PostmasterAlias"/>
+
<!-- Checks that the email Sender is associated with a valid domain. -->
<!-- Useful for detecting and eliminating spam. -->
<!-- For this block to function, the spam processor must be configured. -->
— src\java\org\apache\james\transport\JamesSpoolManager_orig.java Mon Apr 04 12:23:22 2005
+++ src\java\org\apache\james\transport\JamesSpoolManager.java Mon Apr 04 12:30:04 2005
@@ -196,16 +196,6 @@
processor.initialize();
processors.put(processorName, processor);
- // If this is the root processor, add the PostmasterAlias
- // mailet silently to the top
- if (processorName.equals("root"))
{
- Matcher matcher = matchLoader.getMatcher("All",
- mailetContext);
- Mailet mailet = mailetLoader.getMailet("PostmasterAlias",
- mailetContext, null);
- processor.add(matcher, mailet);
- }
-
final Configuration[] mailetConfs
= processorConf.getChildren( "mailet" );
// Loop through the mailet configuration, load