Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-363

Move PostmasterAlias from code to james-confix.xml

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.3.0
    • 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

      Attachments

        Activity

          People

            bago Stefano Bagnara
            pezzer Daniel Perry
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: