This tutorial describes another way to set up your email on a Linux machine, Debian Etch in this case. Email Perfect SetupToday I am going to reveal to you the secret of how to make a mini mail server for your domestic needs. It is very powerful and extremely fast. It runs automatically without user interaction. All you have to do is to check your mail folder from time to time because your emails are already there, waiting to be read. And GUI, of course, we won't get rid of it. Instead, we will use it efficiently and clever.
I chose exim because it is the default MTA for Debian Etch. Mutt is an excellent console MUA and the default one. Emacs is an excellent text editor and MUA as well. Evolution is the most complete set for a business person providing integrated mail, addressbook and calendar in Gnome, default Debian desktop. Nmh is the tool to connect and handle everything mentioned above. Evolution is a good program. But, if you want to have a real MH GUI MUA, I would recommend Claws Mail. Claws Mail was specially designed to manage MH mails and is very fast. It has appearance and interface of Evolution. apt-get install sylpheed-claws-gtk2 apt-get update Run these commands but first check out your distributions. Maybe you already have some of these programs installed. Setting up eximWe need exim in order to be able to send our mails. Bugzilla-like programs use it too for sending their bug reports. I saw a post at some forum that it took two days for someone to configure exim. Is it so difficult? Run as root: I took a Russian Yahoo-like public email service domain. I have an account there. You can try it, too, if you like, or choose a different one. It doesn't matter. Exim asks nether your login, nor your password. Was it long? It took two minutes, no more. Now we need to create your real email address so that your correspondents could reply to you hitting a "Reply" button in their mail programs. Navigate to /etc/exim4/@email-addresses and put the email address you want other people to see when they get an email from you like: user: alias@domain. There should be an example included. That's all, folks. Exim is pretty configured now. You can test it right away, if you know how. If not, let's proceed. Setting up nmhNmh is a variant of MH - Mail Handling System. It is a command line tool to manage emails. You don't need to know much about it except the directory where it will make your mailbox. If you are planning to use other email format like maildir or mbox, skip this step. Your mailbox already exists and is located at the /var/spool/mail directory. Make sure it is writable for a user. Run in the
terminal: This will create .mh_profile setup file and ask you two questions; answer y (for "yes") to both questions: $
folder +inbox Now you have your MH mailbox. Let's send an email to ourselves. Setting up MuttMutt is highly customizable. It allows you to use your favourite editor. I think it is sweet because you don't need to study an alien interface, if you don't want to. Just make a directory ~/.mutt and put muttrc file into it. Put files mutt_mailcap and aliases into your mailbox /HOME/Mail. Actually you can put them into any directory you like, but in this case you will have to change paths to these files in your muttrc file. I prefer to keep them in the mailbox because it is easier to do backup, when all the files are gathered in one place. Put the .muttprintrc file into your home directory. This will enable pretty printing in Mutt. Note: If you are going to use both Mutt and other email clients, create folders only in Mutt. Other programs are indifferent, but Mutt doesn't accept the folders which it didn't compile by itself. Setting up gnupgIt is not strictly necessary, but some people like to send decrypted messages. So we will have gnupg just for our convenience. Run as root: This will generate a security key and everything you need to have for now. Follow the instructions during the installation. It is not difficult. Done! Now we can test both Exim and Mutt. Type in the
console: Start your emacs. OK. We can send emails now. But how to receive them? Setting up getmailCreate a data/configuration directory. The default is $HOME/.getmail.Create a configuration file in the configuration/data directory. The default name is getmailrc. I have two remote accounts. You can have more. If you plan to fetch mail from all the remote accounts you have, you need to create a separate getmailrc file for each account like getmailrc-account1, getmailrc-account2, getmailrc-moreaccounts and so on. This is an example of a getmailrc-smth file. There's a nice automatic launcher for multiple getmailrc-smth files and a emails fetcher from multiple accounts. You will find it at the bottom of this page. This script works OK, but since we are building an MH system we will need some more programs. When MH deletes files, it actually doesn't delete them but renames them by adding a "," character in the beginning of the file name. For example, if you had the file named "1", it became ",1". You can't read this file in MH until you rename it back. It's OK, but the problem is that, if you change your mind and want to undelete such a file, you won't be able to do that because some files will be overwritten. For example if you had already a file ",1" and deleted the messaged from the file "1", the previous ",1" will be overwritten by the newer ",1" file. That's the problem. And besides it is not convenient to handle such renamed files. Wouldn't it be much nicer to have such an automatic program that will collect (as if) deleted files, rename them back so that they become readable again and put them to a special folder like "trash", which you will have to create (do it in Mutt, if you plan to use it)? And two very brilliant programmers, dri and Grifter whom you can meet at the Debian Users Forum, each made a separate program. You can use one or both of them too, but as usual - no warranty. Dri's script produces the following output:
The script can handle both characters and digits. It renames any files beginning with a "," character into the valid MH files and send them to the "trash" folder which you need to make in your mailbox. Put this script into your /HOME/Mail folder and run it as usual: cd /home/user/Mailbox Grifter's scrips is silent and operates only digits. It ignores invalid files for MH, the ones containing characters or combinations of digits and characters. But, if it encounters a valid MH file beginning with a digit that has an invalid ending like a "~" character, that is the common sign for backup files left by various editors. If you were unlucky enough to accidentally edit a MH file with some of them, it generates errors and refuses to work. Be aware of it. But on the other hand it doesn't need to have any folders in your mailbox to be specified separately. I am not a programmer and most likely somebody can do it better. I took the autofetcher script from wiki, added some cleaning commands just to make sure to avoid the potential problem mentioned above and incorporated Grifter's and dri's scripts so that they could run automatically too. Grifter's script collects all the "deleted" MH files from all the folders and put them into the trash folder. Dri's script, slightly modified, renames the files renamed by Grifter's script into valid MH ones so that they could be read from Sylpheed-Claws too. Mutt and Emacs mh-e are both indifferent to leading zeros and don't need dri's renaming. You can find this file here. Make it executable, if it is not yet, and put it into the /bin directory. The instruction how to launch it while starting your desktop environment is in the file. Mo matter whose, dri's or Grifter's, program you will use, or maybe none, this command will permanently delete unwanted files in your "trash" or, being slightly modified, anywhere on your computer: find /home/user/Mail/trash -name "*" -exec rm {} \; Spamassassin ConfigurationOpen /etc/default/spamassassin file, make sure ENABLED=1 Don't delete spam messages. Save them into the spam folder instead. You can teach spamassassin with the command: sa-learn --showdots --spam ~/Mail/spam Setting up slocalSpamassassin labels spam messages. Slocal filters these messages. Make a folder "spam" in your mailbox. Use Mutt for that. Put .maildelivery file into your home directory. That's all, folks. Let's check now how getmail fetchs messages. Restart your computer and wait for 30 seconds. In the console type: Start Emacs. Hit: OK! The last thing we need to do is to set up Evolution, if you really want it. That will put into your new and clean Mail folder a whole bunch of files, and your neat mailbox will resemble a dump. Setting up EvolutionStart Evolution Account Assistant: Make sure all accounts are enabled. Setting up Sylpheed-ClawsSylpheed-Claws cannot use exim4 as a mail transfer agent, but on the other hand we are not running a mail server either. Mutt accepts folders created in Sylpheed-Claws. If due to some reason Sylpheed-Claws won't see the folders you made in Mutt, make them in Sylpheed-Claws. That's all. Enjoy! |
|||||||||||||||||||||||||