You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Robert Buick <rb...@btclick.com> on 2004/01/14 14:31:41 UTC

email archive

Hi,
I've built James from the CVS repository (it runs up as 3.0a1) and use 
postgreSQL 7.3.4 on RH9.
I would lke to be able to archive incoming email messages so that I can 
subsequently run tests/queries/campaigns etc.
My question is, what would you suggest is the most appropriate method of 
archiving? using database triggers on the inbox table or could it be 
to develop matcher/mailet to archive to the database?
 
Thanks for your time and help,
 
Rob Buick 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: email archive

Posted by Robert Buick <rb...@btclick.com>.
Danny,
Thanks for your help.
I tried as suggested to the config.xml file - see extract below - but 
the emails aren't being stored in the database table inboxarchive (or 
the outboxarchive).

I checked the mailet log and it says:  ... INFO James.Mailet: 
ToRepository: Storing mail Mail1****** in db:/maildb/inboxarchive.
(Interestingly in environment.xml I have set  James.Mailet 
log-level="DEBUG" and yet it records only INFO whereas other categories 
I've set to DEBUG and they record as DEBUG. Any thoughts?)

     <!-- Processor CONFIGURATION SAMPLE: transport is a sample custom 
processor for local or -->
     <!-- remote delivery -->
     <processor name="transport">

        <!-- Archive incoming emails -->
        <mailet match="RecipientIsLocal" class="ToRepository">
                         <!--
            <repositoryPath> file://var/mail/inboxarchive/</repositoryPath>
            -->
            <!-- An alternative database repository example follows. -->
                       <repositoryPath> db://maildb/inboxarchive/ 
</repositoryPath>
                        <repository>LocalUsers </repository>
                        <passThrough> true </passThrough>
       </mailet>



        <!-- Is the recipient is for a local account, deliver it locally 
-->
        <mailet match="RecipientIsLocal" class="LocalDelivery">
            <!-- EXPERIMETAL -->
            <!-- (currently POP3 does not also support this)     -->
                        <!-- For supporting virtual hosts you can use 
the    -->
            <!-- the settings below to support several           -->
            <!-- LocalDelivery mailets delivering mail to several-->
            <!-- both inboxURI and users MUST be specified       -->
            <!-- otherwise ALL of these settings will be ignored -->
                         <inboxURI>db://maildb/inbox/</inboxURI>
            <users>LocalUsers</users>
            <ignoreCase>true</ignoreCase>
            <enableAliases>true</enableAliases>
            <enableForwarding>true</enableForwarding>
                    </mailet>


        <!-- If the host is handled by this server and it did not get -->
        <!-- locally delivered, this is an invalid recipient -->
        <mailet match="HostIsLocal" class="ToProcessor">
           <processor>error</processor>
        </mailet>

<!-- CHECKME! -->
        <!-- This is an anti-relay matcher/mailet combination -->
        <!-- -->
        <!-- Emails sent from servers not in the network list are  -->
        <!-- rejected as spam.  This is one method of preventing your -->
        <!-- server from being used as an open relay.  Make sure you 
understand -->
        <!-- how to prevent your server from becoming an open relay 
before -->
        <!-- changing this configuration. -->
        <!-- -->
        <!-- This matcher/mailet combination must come after local 
delivery has -->
        <!-- been performed.  Otherwise local users will not be able to 
receive -->
        <!-- email from senders not in this remote address list. -->
        <!-- -->
        <!-- If you are using this matcher/mailet you will probably want 
to -->
        <!-- update the configuration to include your own 
network/addresses.  The -->
        <!-- matcher can be configured with a comma separated list of IP 
addresses  -->
        <!-- wildcarded IP subnets, and wildcarded hostname subnets. -->
        <!-- e.g. "RemoteAddrNotInNetwork=127.0.0.1, abc.de.*, 
192.168.0.*" -->
        <!-- -->
        <!-- If you are using SMTP authentication then you can (and 
generally -->
        <!-- should) disable this matcher/mailet pair. -->
        <!--
        <mailet match="RemoteAddrNotInNetwork=127.0.0.1" 
class="ToProcessor">
           <processor> spam </processor>
        </mailet>
         -->

        <!-- Archive outgoing emails, -->
        <mailet match="All" class="ToRepository">
           <!--
           <repositoryPath> file://var/mail/spoolarchive/ </repositoryPath>
           -->
           <!-- alternative database repository example below -->
                      <repositoryPath> db://maildb/spoolarchive/ 
</repositoryPath>
           <repository> LocalUsers </repository>

           <passThrough> true </passThrough>
        </mailet>

        <!-- Attempt remote delivery using the specified repository for 
the spool, -->
        <!-- using delay time to retry delivery and the maximum number 
of retries -->
        <mailet match="All" class="RemoteDelivery">
           <!--
           <outgoing> file://var/mail/outgoing/ </outgoing>
           -->
           <!-- alternative database repository example below -->
                      <outgoing> db://maildb/spool/outgoing/ </outgoing>
                      <debug>true</debug>
           <!-- Number of milliseconds between delivery attempts -->
           <delayTime> 21600000 </delayTime>

           <!-- Number of failed attempts before returning to the sender 
-->
           <maxRetries> 5 </maxRetries>

           <!-- The number of threads that should be trying to deliver 
outgoing messages -->
           <deliveryThreads> 1 </deliveryThreads>

           <!-- If false the message will not be sent to given server if 
any recipients fail -->
           <sendpartial>false</sendpartial>

           <!-- A single mail server to deliver all outgoing messages. -->
           <!-- This is useful if this server is a backup or failover 
machine, -->
           <!-- or if you want all messages to be routed through a 
particular mail server, -->
           <!-- regardless of the email addresses specified in the 
message -->
           <!-- -->
           <!-- The gateway element specifies the gateway SMTP server 
name. -->
           <!-- If your gateway mail server is listening on a port other 
than 25, -->
           <!-- you can set James to connect to it on that port using 
the gatewayPort -->
           <!-- element. -->
           <!--
           <gateway> otherserver.mydomain.com </gateway>
           <gatewayPort>25</gatewayPort>
           -->
        </mailet>

     </processor>

>Robert.. this is realtively straight forward.. install a ToRepository
>mailet and a matcher to filter *in* those mails you want archived.
>
>Use PassThrough=true (check the correct syntax, this is *not* right!) if
>you want your mail to be "tapped" (or copied into the archive)
>The default (pass through=false)  will store the mail and stop further
>processing.
>
>Place this mailet in a sensible place, at the start of "Transport" means
>that all outgoing and incoming mail will be seen, but not errors or spam,
>between local and remote delivery will only see outgoing.
>
>Put local delivery into a new processor (use ToProcessor to direct the mail
>to it) and add the archiving mailet there to only see incoming mail.
>
>Or mess with the matcher you use.
>
>You can use any of the repository formats, database, dbfile file or mdir
>depending upon what suits you best.
>
>Bear in mind that whilst James will religiously archive all matching mail
>there is no provision for getting the mail out again, you need to use an
>external tool.
>
>Also bear in mind that mail is stored as received including all headers and
>might not be readable without de-serialising/decoding/unencrypting or some
>such.
>
>A third alternative is to write your own mailet which will store mail in
>the format of your choice.
>
>If your format may be of interest to others, or useful for other repository
>tasks you might want to consider writing a whole new repository. James is
>modular like that, you can write your own "plug-ins" for more than just the
>Mailet API should you have the inclination, up to and including adding
>whole new protocols. So there should be little need to go outside James to
>acomplish this.
>
>d.
>
>>-----Original Message-----
>>From: Robert Buick [mailto:rbuick@btclick.com] 
>>Sent: 14 January 2004 13:32
>>To: server-user@james.apache.org
>>Subject: email archive
>>
>>
>>Hi,
>>I've built James from the CVS repository (it runs up as 
>>3.0a1) and use 
>>postgreSQL 7.3.4 on RH9.
>>I would lke to be able to archive incoming email messages so 
>>that I can 
>>subsequently run tests/queries/campaigns etc.
>>My question is, what would you suggest is the most 
>>appropriate method of 
>>archiving? using database triggers on the inbox table or could it be 
>>to develop matcher/mailet to archive to the database?
>> 
>>Thanks for your time and help,
>> 
>>Rob Buick 
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>>    
>>
>
>
>
>  
>




---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: email archive

Posted by Jason Webb <jw...@inovem.com>.
Personally, what we did (I wrote a commerical list manager using James)
is to use the matcher/mailet combo and use the mailet to write the mail
into a table of your own choosing. At least then you will have full
control over what get's written where (an how). If you use this method
you will not need to set up an inbox for each email address you want to
store.

-- Jason

> -----Original Message-----
> From: Robert Buick [mailto:rbuick@btclick.com] 
> Sent: 14 January 2004 13:32
> To: server-user@james.apache.org
> Subject: email archive
> 
> 
> Hi,
> I've built James from the CVS repository (it runs up as 
> 3.0a1) and use 
> postgreSQL 7.3.4 on RH9.
> I would lke to be able to archive incoming email messages so 
> that I can 
> subsequently run tests/queries/campaigns etc.
> My question is, what would you suggest is the most 
> appropriate method of 
> archiving? using database triggers on the inbox table or could it be 
> to develop matcher/mailet to archive to the database?
>  
> Thanks for your time and help,
>  
> Rob Buick 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org