Tuesday, January 16, 2007

Testing Thunderbird as a Standalone

I do not want to mess up my e-mail account, but I do want to help test Thunderbird. I was able to install a James server from Apache on my machine. This is a mail server written in java. It was not very complicated to set up.

At this point, I have the James server configured. I have sent mail to one of my users using telnet to talk to the SMTP port. I have received that mail in Thunderbird. I have used these TB instances to send mail to each other. And I now have a script that can send messages to the clients.

The tasks for setting this up are:

1) download and configure James.
2) create profiles in Thunderbird and launch a different instance for each.
3) use the clients to e-mail each other.
4) use a script to send e-mails.

Configuring James

I am using James 2.3.0 from Apache. I have only made a few changes to a file, apps/james/SAR-INF/config.xml.

1) I commented out a "mailet":

<!--
<mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
<processor> relay-denied </processor>
<notice>550 - Requested action not taken: relaying denied</notice>
</mailet>
-->


This mailet was causing the mailer to think I was treating it like an open relay.

2) I changed an item inside the <servernames> bit:

<servername>10.0.1.6</servername>


This is the IP of the machine I am using when I am inside my house's firewall.

3) Inside the <remotemanager> bit, I changed the admin username and password. You do not have to, if you do not want to do so.

<account login="root" password="root"/>


4) Start the server.

% cd james-2.3.0 ; sudo bin/run.sh




5) Add some users.
One does this by using telnet to connect to the "remoteadmin" port, which defaults to 4555. Here is an example of adding usersm, with the stuff I typed in bold:

% telnet localhost 4555
Trying ::1...
Connected to localhost.
Escape character is '^]'.
JAMES Remote Administration Tool 2.3.0
Please enter your login and password
Login id:
ray
Password:
<mypassword>
Welcome ray. HELP for a list of commands
help

Currently implemented commands:

help - display this help
listusers - display existing accounts
countusers - display the number of existing accounts
adduser [username] [password] - add a new user
verify [username] - verify if specified user exist
deluser [username] - delete existing user
setpassword [username] [password] - sets a user's password
setalias [user] [alias] - locally forwards all email for 'user' to 'alias'
showalias [username] - shows a user's current email alias
unsetalias [user] - unsets an alias for 'user'
setforwarding [username] [emailaddress] - forwards a user's email to another email address
showforwarding [username] - shows a user's current email forwarding
unsetforwarding [username] - removes a forward
user [repositoryname] - change to another user repository
shutdown - kills the current JVM (convenient when James is run as a daemon)
quit - close connection
quit
Bye

Connection closed by foreign host.

%



Creating Profiles

Moz-people know how to do this already. Just set up a profile for each user in the list you added in the step above.


Creating Profiles

Moz-people know how to do this already. Just set up a profile for each user in the list you added in the step above.


Sending E-Mails From Clients

Just set the mail host and sender to the IP address of your machine and enter e-mail addresses as, for example: adam@[10.0.1.6], with the brackets. I am trying to find a way to set a preference to change the title of the main window. For instance, it would be useful to have the window title be the same as the e-mail of that profile. I have not found how to do this yet.


Scripted E-Mails

Download the following two files:


I still need to put in parameters for some things. Right now, you say:

% ./muchMail.sh -h 10.0.1.6 -i inMail.txt


There are keywords in the file that get replaced dynamically, such as __DATE__. Some are structural keywords, such as __TO__, __FROM__, __SUBJ__, __END__.

Let me know how much this needs to be documented. Lines starting with a # are ignored. E-mails start with a __TO__ and end with a __END__.