| 1 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 | <jsmtpdsetup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="jsmtpd-plugin-config.xsd"> |
|---|
| 3 | <ACLSetup name="Ldap ACL" class="org.jsmtpd.plugins.acls.LdapACL"> |
|---|
| 4 | <propertyset name="adminBindDn" value="cn=directoryAdministor,dc=jsmtpd,dc=org"/><!-- admin dn to bind on ldap server --> |
|---|
| 5 | <propertyset name="adminBindPassword" value="it's my top secret password"/> <!-- admin password --> |
|---|
| 6 | <propertyset name="ldapUrl" value="ldap://address.of.the.ldap.server/"/> <!-- url of the ldap server --> |
|---|
| 7 | <propertyset name="ldapUserProvider" value="ou=people,dc=jsmtpd,dc=org"/> <!-- The branch in the DIT holding user objects (posix/shadow accounts) --> |
|---|
| 8 | <propertyset name="ldapNetworkProvider" value="ou=networks,dc=jsmtpd,dc=org"/> <!-- The branch holding the network objects --> |
|---|
| 9 | </ACLSetup> |
|---|
| 10 | |
|---|
| 11 | <DNSSetup class="org.jsmtpd.plugins.dnsServices.DNSJavaResolver" name="DNS Java"> |
|---|
| 12 | <propertyset name="dnsServers" value="ip.of.dns.server"/> <!-- DNS server used --> |
|---|
| 13 | </DNSSetup> |
|---|
| 14 | |
|---|
| 15 | <LocalDeliveryService name="relay to io" class="org.jsmtpd.plugins.deliveryServices.SMTPRelay"> |
|---|
| 16 | <!-- local mail is relayed to io.jsmtpd.org, of course io.jsmtpd.org has to accept theses connections --> |
|---|
| 17 | <propertyset name="relay" value="213.251.163.82"/> |
|---|
| 18 | <propertyset name="smtpPort" value="25"/> |
|---|
| 19 | </LocalDeliveryService> |
|---|
| 20 | |
|---|
| 21 | <RemoteDeliveryService name="Remote smtp sender" class="org.jsmtpd.plugins.deliveryServices.RemoteSmtpSender"> |
|---|
| 22 | </RemoteDeliveryService><!-- Outgoing mail is sent directly by this instance of Jsmtpd --> |
|---|
| 23 | |
|---|
| 24 | <smtpExtensions> |
|---|
| 25 | <smtpExtension name="tls" class="org.jsmtpd.plugins.smtpExtension.TLSSwitcher"> <!-- A plugin allowing to change clear connection to SSL connection --> |
|---|
| 26 | <propertyset name="keystoreName" value="keystore"/> <!-- must be in classpath, eg etc/ by example. It's holding the server's SSL cert --> |
|---|
| 27 | <propertyset name="keystorePassword" value="password_of_your_keystore"/> <!-- A password for the file holding the cert --> |
|---|
| 28 | </smtpExtension> |
|---|
| 29 | <smtpExtension name="auth" class="org.jsmtpd.plugins.smtpExtension.LdapAuthenticator"> |
|---|
| 30 | <propertyset name="adminBindDn" value="cn=directoryAdministor,dc=jsmtpd,dc=org"/> |
|---|
| 31 | <propertyset name="adminBindPassword" value="it's my top secret password"/> |
|---|
| 32 | <propertyset name="ldapUrl" value="ldap://address.of.the.ldap.server/"/> |
|---|
| 33 | <propertyset name="ldapUserProvider" value="ou=people,dc=jsmtpd,dc=org"/> |
|---|
| 34 | <propertyset name="ldapUserPassword" value="userPassword"/><!-- It specifies the name of the attribute holding users password. With shaddowAccount object class, this is userPassword --> |
|---|
| 35 | </smtpExtension> |
|---|
| 36 | <!-- The greylist / SPF checker, see dev.jsmtpd.org for details --> |
|---|
| 37 | <smtpExtension name="Greylist SPF" class="org.jsmtpd.plugins.smtpExtensions.GreyList"/> |
|---|
| 38 | </smtpExtensions> |
|---|
| 39 | |
|---|
| 40 | <filtersetup> |
|---|
| 41 | <!-- This filter always says true --> |
|---|
| 42 | <filterInit name="chainvalid" class="org.jsmtpd.plugins.filters.builtin.ChainSucces"> |
|---|
| 43 | </filterInit> |
|---|
| 44 | <!-- connectes to a spamassassin daemon (daemon) by TCP connection --> |
|---|
| 45 | <filterInit name="antispam" class="org.jsmtpd.plugins.filters.SA.SAFilter"> |
|---|
| 46 | <propertyset name="spamdHost" value="spamd.server.mydomain.com"/> <!-- Change to your Spamassassin server ip --> |
|---|
| 47 | <propertyset name="spamdPort" value="783"/><!-- Spamd default port --> |
|---|
| 48 | <propertyset name="socketTimeout" value="45"/> <!-- Spamd has 45 secs to process the mail, after the plugin disconnects --> |
|---|
| 49 | <propertyset name="skipIfSizeMore" value="524288"/><!-- Most spam are small, the plugin will not scan big mail that are likely not spams --> |
|---|
| 50 | </filterInit> |
|---|
| 51 | |
|---|
| 52 | <!-- connects to a clamav daemon, by tcp connection --> |
|---|
| 53 | <filterInit name="antivirus" class="org.jsmtpd.plugins.filters.ClamAV.ClamAVFilter"> |
|---|
| 54 | <propertyset name="clamdHost" value="spamd.server.mydomain.com"/> <!-- Change to your ClamAV server ip --> |
|---|
| 55 | <propertyset name="clamdPort" value="3310"/><!-- clamd default port --> |
|---|
| 56 | <propertyset name="socketTimeout" value="45"/> |
|---|
| 57 | <propertyset name="failOnError" value="true"/> <!-- If there is a virus in the mail, drop it regardless of the state of the filter tree --> |
|---|
| 58 | </filterInit> |
|---|
| 59 | |
|---|
| 60 | <!-- Query realtime black list servers. Theses are in fact DNS requests against free services --> |
|---|
| 61 | <filterInit class="org.jsmtpd.plugins.inputIPFilters.RBLFilter" name="rtBlackList"> |
|---|
| 62 | <propertyset name="bypassLocal" value="true"></propertyset> |
|---|
| 63 | <propertyset name="RBLServer" value="sbl-xbl.spamhaus.org"></propertyset> |
|---|
| 64 | <propertyset name="RBLServer" value="whois.rfc-ignorant.org"></propertyset> |
|---|
| 65 | <propertyset name="RBLServer" value="relays.ordb.org"></propertyset> |
|---|
| 66 | </filterInit> |
|---|
| 67 | |
|---|
| 68 | <!-- Ip registered here are rejected upon connection --> |
|---|
| 69 | <filterInit class="org.jsmtpd.plugins.inputIPFilters.ExpireBlackList" name="blacklist"> |
|---|
| 70 | <!-- Incoming connections from ACL's relayed host bypass this plugin --> |
|---|
| 71 | <propertyset name="bypassLocal" value="true"></propertyset> |
|---|
| 72 | <propertyset name="blacklistedIP" value="ip.of.a.smtp"></propertyset> |
|---|
| 73 | <!-- List is truncated ;) --> |
|---|
| 74 | </filterInit> |
|---|
| 75 | |
|---|
| 76 | <!-- This is the ldap aliases rewriter. When someone sends me a mail at jfp@jsmtpd.org, it is changed by this plugin to my real system mailbox --> |
|---|
| 77 | <!-- info about replacements is gathered from the ldap server --> |
|---|
| 78 | <filterInit class="org.jsmtpd.plugins.filters.ldap.LdapBodyRewriter" name="ldap rewriter"> |
|---|
| 79 | <propertyset name="adminBindDn" value="cn=directoryAdministor,dc=jsmtpd,dc=org"/> |
|---|
| 80 | <propertyset name="adminBindPassword" value="it's my top secret password"/> |
|---|
| 81 | <propertyset name="ldapUrl" value="ldap://address.of.the.ldap.server/"/> |
|---|
| 82 | <propertyset name="ldapUserProvider" value="ou=people,dc=jsmtpd,dc=org"/> |
|---|
| 83 | </filterInit> |
|---|
| 84 | |
|---|
| 85 | <!-- The filter to attach signs --> |
|---|
| 86 | <!-- A snippet is a template of sign --> |
|---|
| 87 | <filterInit name="ReplaceSnippet" class="org.jsmtpd.plugins.filters.snippets.ReplaceSnippetFilter"> |
|---|
| 88 | <propertyset name="path" value="path/to/snippets/"/> |
|---|
| 89 | <propertyset name="prefix" value="--"/> |
|---|
| 90 | <propertyset name="suffix" value=""/> |
|---|
| 91 | </filterInit> |
|---|
| 92 | </filterInit--> |
|---|
| 93 | |
|---|
| 94 | </filtersetup> |
|---|
| 95 | <inputIPFilterChain> |
|---|
| 96 | <ipFilter name="blacklist"/> |
|---|
| 97 | <ipFilter name="rtBlackList"/> |
|---|
| 98 | </inputIPFilterChain> |
|---|
| 99 | <!-- Filter the email contents folowing this tree, plugin names must be something loaded in filtersetup --> |
|---|
| 100 | <!-- My strategy is to drop mail containing viruses --> |
|---|
| 101 | <!-- Then recipients are rewritten --> |
|---|
| 102 | <!-- After the are filtered by spam assassin --> |
|---|
| 103 | <!-- Finnaly mails tagged spam and legitimate mails get snippet attached --> |
|---|
| 104 | <!-- I do not drop spam mails tagged by spam assassin, in case spamassin takes a wrong decision --> |
|---|
| 105 | <!-- I also read spam headers some times, it gives ideas of filter plugins ;) --> |
|---|
| 106 | <!-- Spam mails are rewritten by spamassin: it adds a X-SPAM-FLAG field. On my mail client, a simple rule to move suspected spam (mail containing this header) to a separate folder --> |
|---|
| 107 | <bodyFilterTree> |
|---|
| 108 | <filter name="antivirus"> |
|---|
| 109 | <true> |
|---|
| 110 | <filter name="ldap rewriter"> |
|---|
| 111 | <true> |
|---|
| 112 | <filter name="antispam"> |
|---|
| 113 | <true> |
|---|
| 114 | <filter name="ReplaceSnippet"> |
|---|
| 115 | <true/> |
|---|
| 116 | <false/> |
|---|
| 117 | </filter> |
|---|
| 118 | </true> |
|---|
| 119 | <false> |
|---|
| 120 | <filter name="ReplaceSnippet"> |
|---|
| 121 | <true/> |
|---|
| 122 | <false/> |
|---|
| 123 | </filter> |
|---|
| 124 | </false> |
|---|
| 125 | </filter> |
|---|
| 126 | </true> |
|---|
| 127 | <false/> |
|---|
| 128 | </filter> |
|---|
| 129 | </true> |
|---|
| 130 | <false/> |
|---|
| 131 | </filter> |
|---|
| 132 | </bodyFilterTree> |
|---|
| 133 | |
|---|
| 134 | </jsmtpdsetup> |
|---|