Novell Home

Setting Up Local LAN Email Using XMH

Novell Cool Solutions: Feature
By Stomfi

Rate This Page

Reader Rating  stars  from 2 ratings

Digg This - Slashdot This

Posted: 25 Oct 2005
 

MR wrote: I had set up several accounts on the same PC for the family. Is there a way which I can send a mail (or message, without going through the internet) to another user such that the other user will receive and be able to reply when she logins later? Also, how do I change the machine name? (which is accidentally/default set to be called linux)

Answer: For SUSE

I have found a relatively easy way to send local mail from one user to another on the same machine, or even over a LAN, which doesn't interfere with Internet email.

The front end uses a GUI based interface and is called "xmh". This is an X windows front end to the "mh" command line mail handler program.

You will have to install the "mh" program which you can obtain in RPM format. You can see how to do this in another one of my dumb question answers on Cool Solutions.

I used an updated version of "mh" called "nmh" which was for Fedora Core 3, which installed OK. Here is the link:
http://centos.karan.org/el4/extras/stable/i386/RPMS/nmh-1.1-7.fc3.i386.rpm

Once you have installed this program, run the command:

install-mh

in each of your users home folders, as each user, so the permissions are setup OK. Use Mail as the folder name when it asks you.

Next run the command

inc

which will set up the sub folders.

You shouldn't have to download the xmh program as it's part of the standard X windows suite. Here is a picture of "yours truly" creating some mail.

Notice that I sent it to "stomfi@localhost". Localhost is the name of the current machine. I also could have sent it to "stomfi@linux.site" or whatever my hostname is set to. If there were more machines connected to my LAN, I could send a copy to say "mary@windoze.site".

When this mail is sent, it goes to the system mail drop folder, which by default is "/var/spool/mail/$USER".

The "inc" command will retrieve it and place it in the users Mail/inbox folder where "xmh" can see it.

To make things nice and easy for you, I have created a simple shell script which you can, as the root user, put into a common folder like "/usr/local/bin", and run it on startup for each user login.

#!/bin/bash

#LocalMail.sh

#Get any local mail and put it into the mh system

#Exit if no new mail

if [ `inc 2>&1 | grep -c "no mail"` -gt 0 ]

then

exit

fi

#Start the x windows mh mail utility

xmh -path $HOME/Mail &

Don't forget to change the mode to executable with the command:

chmod +x /usr/local/bin/LocalMail.sh

Here is the results of running the command:

If you wish to run the "xmh" command as a user, create an icon with the command:

xmh -path $HOME/Mail

For your last question, you can set the hostname from YaST ? Network Services ? Host Names, or you can use the shell command line like this:

hostname yabbadabbadoo

Or, use whatever name you wish. :)

This Newbie answer has covered:

How to setup the mh system on SUSE 9.2
How to use xmh to send and read mh mail on SUSE 9.2
How to change your hostname

Reader Comments

  • nmh is on the SUSE install DVD/CD's . For SUSE 10.0 and, I assume previous versions. Open YAST then click on, Software Management/Add Remove Software, select 'Package Groups' from the drop down 'Filter' menu, under 'Productivity' click on the '+' symbol next to 'Networking', then the '+' next to 'email' and click on 'Utilities'. nmh should be in this list.
  • Why donīt you use just pine? With it you could also send mail to local users via mailadress@localhost...

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2008 Novell, Inc. All Rights Reserved.