Skip to content

Commit

Permalink
reintegrate multiple-proxies branch
Browse files Browse the repository at this point in the history
git-svn-id: http://mireka.googlecode.com/svn/trunk@80 741d60a8-641f-389e-c7ec-093451e00b49
  • Loading branch information
hontvari committed Nov 2, 2010
2 parents 8f226b5 + c3157be commit 043eed6
Show file tree
Hide file tree
Showing 110 changed files with 1,601 additions and 664 deletions.
25 changes: 6 additions & 19 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,20 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="build/test" path="test"/>
<classpathentry kind="lib" path="lib/build-only/jmockit-0.997-preview1.jar"/>
<classpathentry kind="lib" path="lib/build-only/jmockit.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="MIREKA_RESIN_HOME/lib/resin.jar" sourcepath="/MIREKA_LIB_DOC/resin-4_0-snap-src.zip"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.5.8.jar"/>
<classpathentry kind="lib" path="lib/mail.jar" sourcepath="lib-doc/javamail-1.4.2-src.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/smtp/lib-doc/javamail-1.4.2-docs.zip!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/subethasmtp-UNVERSIONED.jar" sourcepath="lib-doc/subethasmtp-3.1.2-src.zip"/>
<classpathentry kind="lib" path="lib/subethasmtp-UNVERSIONED.jar" sourcepath="lib-doc/SubEthaSMTP-src.zip"/>
<classpathentry kind="lib" path="lib/dnsjava-2.0.6.jar" sourcepath="lib-doc/dnsjava-2.0.6-src.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/mireka/lib-doc/dnsjava-2.0.6-javadoc.zip!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/logback-classic-0.9.17.jar">
<accessrules>
<accessrule kind="accessible" pattern="ch/qos/logback/classic/LoggerContext"/>
<accessrule kind="nonaccessible" pattern="**"/>
</accessrules>
</classpathentry>
<classpathentry kind="lib" path="lib/logback-core-0.9.17.jar">
<accessrules>
<accessrule kind="nonaccessible" pattern="**"/>
</accessrules>
</classpathentry>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.5.8.jar">
<accessrules>
<accessrule kind="nonaccessible" pattern="**"/>
</accessrules>
</classpathentry>
<classpathentry kind="lib" path="lib/build-only/mockito-core-1.8.0.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/mireka/lib-doc/mockito-1.8.0-doc.zip!/"/>
Expand All @@ -50,5 +33,9 @@
<classpathentry kind="lib" path="lib/build-only/com.springsource.org.hamcrest.core-1.1.0.jar"/>
<classpathentry kind="lib" path="lib/apache-mime4j-core-0.7-SNAPSHOT.jar" sourcepath="lib-doc/apache-mime4j-core-0.7-SNAPSHOT-sources.jar"/>
<classpathentry kind="lib" path="lib/build-only/junit-dep-4.7.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.6.1.jar"/>
<classpathentry kind="lib" path="lib/logback-classic-0.9.26.jar"/>
<classpathentry kind="lib" path="lib/logback-core-0.9.26.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.6.1.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
18 changes: 16 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
================================= -->
<target name="test"
depends="test.compile"
description="Execute JUnit tests.">
description="Execute JUnit tests accorsing to all.test and test properties">
<condition property="quick.tests">
<not>
<or>
Expand Down Expand Up @@ -160,12 +160,26 @@
<batchtest if="all.test" todir="build/junit">
<fileset dir="${test.dir}">
<include name="**/*Test*.java" />
<!-- it seems it takes very long if coverage information is collected -->
<exclude name="**/DnsMailCreatorLargeOriginalTest.java" />
</fileset>
</batchtest>
<formatter type="plain" />
</junit>
</target>

<!-- =================================
target: all.test
================================= -->
<target name="all.test"
depends=""
description="Execute all JUnit tests">
<antcall target="test">
<param name="all.test" value="true" />
</antcall>
</target>


<target name="javadoc" depends="init-dist">
<javadoc destdir="${build.dir}/javadoc"
packagenames="*"
Expand Down Expand Up @@ -283,4 +297,4 @@
<target name="clean" description="Cleans all previous build artifacts">
<delete dir="${build.dir}" />
</target>
</project>
</project>
Binary file removed lib/build-only/jmockit-0.997-preview1.jar
Binary file not shown.
Binary file removed lib/build-only/jmockit-coverage-0.997-preview1.jar
Binary file not shown.
Binary file added lib/build-only/jmockit-coverage-htmlfull.jar
Binary file not shown.
Binary file added lib/build-only/jmockit-coverage.jar
Binary file not shown.
Binary file added lib/build-only/jmockit.jar
Binary file not shown.
Binary file removed lib/jcl-over-slf4j-1.5.8.jar
Binary file not shown.
Binary file added lib/jcl-over-slf4j-1.6.1.jar
Binary file not shown.
Binary file removed lib/logback-classic-0.9.17.jar
Binary file not shown.
Binary file added lib/logback-classic-0.9.26.jar
Binary file not shown.
Binary file removed lib/logback-core-0.9.17.jar
Binary file not shown.
Binary file added lib/logback-core-0.9.26.jar
Binary file not shown.
Binary file removed lib/slf4j-api-1.5.8.jar
Binary file not shown.
Binary file added lib/slf4j-api-1.6.1.jar
Binary file not shown.
22 changes: 6 additions & 16 deletions setup/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<layout class="ch.qos.logback.classic.PatternLayout">
<encoder>
<pattern>%date %-29([%3.3X{smtpServerLocalSocketAddress}] [%.21thread]) %-5level %logger{20} %m %ex%n</pattern>
</layout>
</encoder>
</appender>

<evaluator name="SUPRESS_TRACE_EVAL" class="ch.qos.logback.classic.boolex.JaninoEventEvaluator">
Expand All @@ -26,25 +26,15 @@

<appender class="ch.qos.logback.core.rolling.RollingFileAppender"
name="Access">
<!--
uncomment if the server receives more than 100 000 mail transactions
and it is busy. In this case the listener section in mireka.xml
should be uncommented too, otherwise on shutdown the last log
messages will be lost. Log messages will be flushed to disk only
after the buffer is completely filled.
-->
<!--
<BufferedIO>true</BufferedIO>
-->
<file>${log.dir}/access.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${log.dir}/access.%d{yyyy-MM-dd}.log</FileNamePattern>
<!-- keep specified number of log files of history -->
<MaxHistory>90</MaxHistory>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<encoder>
<pattern>%date %-29([%3.3X{smtpServerLocalSocketAddress}] [%.21thread]) %-5level %logger{20} %m %ex{full, SUPRESS_TRACE_EVAL}%n</pattern>
</layout>
</encoder>
</appender>

<!--
Expand All @@ -61,9 +51,9 @@
<OnMismatch>DENY</OnMismatch>
<OnMatch>ACCEPT</OnMatch>
</filter>
<layout class="ch.qos.logback.classic.PatternLayout">
<encoder>
<pattern>%date %-29([%3.3X{smtpServerLocalSocketAddress}] [%.21thread]) %-5level %logger{20} %m %ex%n</pattern>
</layout>
</encoder>
</appender>
-->

Expand Down
5 changes: 0 additions & 5 deletions setup/conf/mireka.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
<system-property logback.configurationFile="${__DIR__}/logback.xml"/>
<dependency path="${__DIR__}/logback.xml" />

<!-- uncomment if you enabled BufferedIO on a Logback log file -->
<!--
<listener listener-class="mireka.server.LogFlushingServletContextListener" />
-->

<system-property helo="mail.example.com"/>

<mireka:ClientFactory>
Expand Down
48 changes: 39 additions & 9 deletions setup/conf/mx/mx.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
<mireka:RecipientSpecifications>
<Named>validRecipients</Named>

<mireka:specification>
<mireka:GlobalPostmasterSpecification />
</mireka:specification>

<!-- this matches Postmaster@... addresses for any domain, not
only for local domains, but non-local ones will be
rejected by the ProhibitRelaying filter anyway -->
<mireka:specification>
<mireka:AnyDomainPostmaster />
</mireka:specification>

<mireka:specification>
<mireka:InlineRecipientRegistry>
<resin:import path="${__DIR__}/individual-recipients.xml" />
Expand All @@ -31,9 +42,27 @@
<resin:import path="${__DIR__}/wildcard-recipients.xml" />

</mireka:RecipientSpecifications>

<mireka:RecipientTable>
<Named>recipientTable</Named>
<mireka:mapper>
<mireka:RecipientSpecificationDestinationPair>
<mireka:recipientSpecification>
#{validRecipients}
</mireka:recipientSpecification>
<mireka:destination>
<mireka:Relay>
<mireka:backendServer>
#{backendServer}
</mireka:backendServer>
</mireka:Relay>
</mireka:destination>
</mireka:RecipientSpecificationDestinationPair>
</mireka:mapper>
</mireka:RecipientTable>

<resource name="mxTrafficSummary" mbean-name="mireka:type=TrafficSummary,name=MX"
type="mireka.filter.builtin.TrafficSummary" />
type="mireka.filter.misc.TrafficSummary" />

<mireka:Filters>
<Named>mxFilters</Named>
Expand All @@ -45,6 +74,13 @@
</mireka:trafficSummary>
</mireka:MeasureTraffic>
</mireka:filter>
<mireka:filter>
<mireka:LookupDestination>
<mireka:recipientDestinationMapper>
#{recipientTable}
</mireka:recipientDestinationMapper>
</mireka:LookupDestination>
</mireka:filter>
<mireka:filter>
<mireka:RejectLargeMail/>
</mireka:filter>
Expand Down Expand Up @@ -77,11 +113,7 @@
</mireka:RefuseBlacklistedRecipient>
</mireka:filter>
<mireka:filter>
<mireka:RefuseUnknownRecipient>
<mireka:recipientSpecification>
#{validRecipients}
</mireka:recipientSpecification>
</mireka:RefuseUnknownRecipient>
<mireka:RefuseUnknownRecipient />
</mireka:filter>
<mireka:filter>
<mireka:RejectOnFailedSpfCheck />
Expand All @@ -98,9 +130,7 @@
<mireka:StopLoop />
</mireka:filter>
<mireka:filter>
<mireka:RelayMailTransaction>
<backendServer>#{backendServer}</backendServer>
</mireka:RelayMailTransaction>
<mireka:RelayMailTransaction />
</mireka:filter>
</mireka:Filters>

Expand Down
31 changes: 27 additions & 4 deletions setup/conf/submission-proxy/submission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,27 @@
xmlns:ee="urn:java:ee"
>

<mireka:RecipientTable>
<Named>submissionRecipientTable</Named>
<mireka:mapper>
<mireka:RecipientSpecificationDestinationPair>
<mireka:recipientSpecification>
<mireka:AnyRecipient />
</mireka:recipientSpecification>
<mireka:destination>
<mireka:Relay>
<mireka:backendServer>
#{backendServer}
</mireka:backendServer>
</mireka:Relay>
</mireka:destination>
</mireka:RecipientSpecificationDestinationPair>
</mireka:mapper>
</mireka:RecipientTable>

<resource name="submissionTrafficSummary"
mbean-name="mireka:type=TrafficSummary,name=Submission"
type="mireka.filter.builtin.TrafficSummary" />
type="mireka.filter.misc.TrafficSummary" />

<mireka:Filters>
<Named>submissionFilters</Named>
Expand All @@ -21,6 +39,13 @@
</mireka:trafficSummary>
</mireka:MeasureTraffic>
</mireka:filter>
<mireka:filter>
<mireka:LookupDestination>
<mireka:recipientDestinationMapper>
#{submissionRecipientTable}
</mireka:recipientDestinationMapper>
</mireka:LookupDestination>
</mireka:filter>
<mireka:filter>
<mireka:RejectIfUnauthenticated>
<mireka:authenticatedSpecification>
Expand Down Expand Up @@ -54,9 +79,7 @@
<mireka:StopLoop />
</mireka:filter>
<mireka:filter>
<mireka:RelayMailTransaction>
<backendServer>#{backendServer}</backendServer>
</mireka:RelayMailTransaction>
<mireka:RelayMailTransaction />
</mireka:filter>
</mireka:Filters>

Expand Down
27 changes: 24 additions & 3 deletions setup/conf/submission/submission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,23 @@

<resin:import path="${__DIR__}/queues.xml" />

<mireka:RecipientTable>
<Named>submissionRecipientTable</Named>
<mireka:mapper>
<mireka:RecipientSpecificationDestinationPair>
<mireka:recipientSpecification>
<mireka:AnyRecipient />
</mireka:recipientSpecification>
<mireka:destination>
<mireka:Transmit />
</mireka:destination>
</mireka:RecipientSpecificationDestinationPair>
</mireka:mapper>
</mireka:RecipientTable>

<resource name="submissionTrafficSummary"
mbean-name="mireka:type=SubmissionTraffic,name=Submission"
type="mireka.filter.builtin.TrafficSummary" />
type="mireka.filter.misc.TrafficSummary" />

<mireka:Filters>
<Named>submissionFilters</Named>
Expand All @@ -35,6 +49,13 @@
</mireka:authenticatedSpecification>
</mireka:RejectIfUnauthenticated>
</mireka:filter>
<mireka:filter>
<mireka:LookupDestination>
<mireka:recipientDestinationMapper>
#{submissionRecipientTable}
</mireka:recipientDestinationMapper>
</mireka:LookupDestination>
</mireka:filter>
<mireka:filter>
<mireka:RejectLargeMail/>
</mireka:filter>
Expand All @@ -56,11 +77,11 @@
<mireka:StopLoop />
</mireka:filter>
<mireka:filter>
<mireka:Transmit>
<mireka:TransmitFilter>
<mireka:transmitter>
#{primaryTransmitter}
</mireka:transmitter>
</mireka:Transmit>
</mireka:TransmitFilter>
</mireka:filter>
</mireka:Filters>

Expand Down
3 changes: 2 additions & 1 deletion setup/doc/administration.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ <h3>${resin.dir>/log/jvm-default.log</h3>
startup and shutdown messages.

<h3>${mirekaHome}/log/access.log</h3>
It contains every SMTP command received or send and some additional info from
It contains every SMTP command received or sent and some additional information
from
filters. It contains errors and warnings as well. If you have more then 100 000
mail transactions per day, then you may want to switch on buffering on this log.

Expand Down
10 changes: 6 additions & 4 deletions setup/doc/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ <h3>Mail services</h3>
connections.</li>
<li>the backend server. It specifies the server, to where mails are relayed for
delivery or submission. It is used by the relay filter. By default both proxy
sevices use the same backend server, however this is not required.</li>
</ul>
sevices use the same backend server, however this is not required. Moreover,
it is possible to use more than one server, and configure Mireka to select a
backend server based on the recipient.</li>
</ul>
</td></tr>
<tr><th><a href="mx.html">mx</a></th><td>Configuration files related to the MX
service, which receives mails sent to the local domains by any server on the
internet. The service, in turn, relays all received mails to the backend server.
internet. The service, in turn, relays all received mails to a backend server.
</td></tr>
<tr><th><a href="submission.html">submission</a></th><td>Configuration files
related to the Submission service, used by local users to send mails either to
Expand All @@ -87,7 +89,7 @@ <h3>Mail services</h3>
<tr><th><a href="submission-proxy.html">submission-proxy</a></th><td>Configuration
files related to the Submission Proxy service, used by local users to send mails
either to other local users, or to other domains on the internet. The service,
in turn, relays all submitted mails to the backend server.
in turn, relays all submitted mails to a backend server.
</td></tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion setup/doc/filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>Filters</h1>
<p>
The processing what Mireka does on a mail is mostly determined by
the filter chain. The filter chain consists of filters. For example
<a href="javadoc/index.html?mireka/filter/builtin/local/AcceptGlobalPostmaster.html">AcceptGlobalPostmaster</a>
<a href="javadoc/index.html?mireka/filter/local/AcceptGlobalPostmaster.html">AcceptGlobalPostmaster</a>
is a simple filter, which can be used to make sure that an email sent to the
special <kbd>postmaster</kbd> recipient is accepted without further checks.
</p>
Expand Down
Loading

0 comments on commit 043eed6

Please sign in to comment.