org.paneris.messageboard.receivemail
Class SMTPServer

java.lang.Object
  extended by org.paneris.messageboard.receivemail.SMTPServer

public class SMTPServer
extends java.lang.Object

An SMTP server to handle mail coming in to messageboards. It is intended to be invoked from init scripts approximately thus:

   java org.paneris.messageboard.receivemail.SMTPServer --port 1615 &
 
A single server can handle mail for messageboards in several separate databases; the name of the database to which it should connect is determined from the recipient address given when the mail arrives. The program looks for a `properties' resource under the name smtpServer.properties which specifies the mappings from domain to database name, in the form
   org.paneris.messageboard.receivemail.database.DOMAIN=DATABASE
 
for example
   org.paneris.messageboard.receivemail.database.messageboards.x.com=x
 
(see also smtpServer.properties.example). Mail can be funelled into the server either by having it listen on port 25 in place of sendmail, or by configuring the locally running MTA to forward appropriately addressed email to the server on a different port. Snedmail configuration Edit sendmail.cf to define a new mailer. Where it says
   Msmtp,             P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n, L=990,
                      T=DNS/RFC822/SMTP,
                      A=IPC $h
 
insert also
   Msmtp1615,         P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n, L=990,
                      T=DNS/RFC822/SMTP,
                      A=IPC $h 1615
 
Then use the standard mailertable feature to direct, for example, all mail to messageboards.x.com on to smtp1615:x.com. You can do this very easily with linuxconf's Special (domain) routing menu: make an entry with Destination set to messageboards.x.com, Forwarder set to x.com, and Mailer set to smtp1615. But make sure to hack /usr/lib/linuxconf/mailconf/smtpmailer.std.cf first, as described above, to get it to define the special mailer in the sendmail.cf it generates. And of course for every mail domain which sendmail is configured to forward to the messageboards server, there should be an entry in smtpServer.properties telling the latter which database to use. Qmail configuration In ...qmail/control/smtproutes add
 messageboards.paneris.org:127.0.0.1:1615
 
Postfix configuration See http://www.postfix.org/transport.5.html In /etc/postfix/main.cf add
 transport_maps = hash:/etc/postfix/transport
 
In /etc/postfix/transport add
 messageboards.paneris.org :127.0.0.1:1615
 
(I found localhost went to a pipex server) you could equally use
 messageboards.paneris.org smtp:127.0.0.1:1615
 
then run
 postmap /etc/postfix/transport
 postfix reload
 
The program takes the following command line arguments:
--port number the port on which to listen, if not 1615
--properties filename the name of a file in CLASSPATH containing the domain-to-database mappings, if not smtpServer.properties
--log filename the name of the log file (defaults to /usr/local/apache/log/messageboard-receivemail.log


Constructor Summary
SMTPServer()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMTPServer

public SMTPServer()
Method Detail

main

public static void main(java.lang.String[] args)


Copyright © 2000-2008 PanEris. All Rights Reserved.