[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11. Using Mutt with Anubis

At the time of this writing mutt(6)is not able to send mail via SMTP channell, instead it invokes local mailer program to transmit the message. There are at least three possible ways to overcome this difficulty:

  1. Using mail.remote from GNU mailutils
  2. Using msg2smtp.pl script provided with Anubis
  3. Using a patch by Steven Engelhardt (patch-version.sde.libesmtp.3) that enables mutt to use SMTP.

The following sections discuss each method in detail.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1 Using GNU mailutils as an interface to mutt

GNU Mailutils is a collection of utilities for handling electronic mail. It includes lots of programs necessary for dealing with e-mail messages. One of them is mail.remote, which is designed as a drop-in replacement for sendmail to forward all mail directly to an SMTP gateway. Its interface is compatible with sendmail which makes the program especially useful as an interface between mutt and anubis. The package can be downloaded from ftp://ftp.gnu.org/gnu/mailutils or any of the mirrors (See http://www.gnu.org/order/ftp.html for a complete list of these. Please, select the mirror closest too you). The complete information about the package is available from its home page at http://www.gnu.org/software/mailutils/

To use mail.remote, first download and install GNU mailutils (as usual the package is shipped with files ‘README’ and ‘INSTALL’ which provide the necessary guidelines). Then add to your ‘.muttrc’ file the following line:

 
set sendmail="mail.remote smtp://hostname[:port]"

where mail.remote stands for the full file name of mail.remote utility, hostname and optional port specify the host name (or IP address) of the machine running anubis and the port it listens on. Notice, that default port value for mail.remote is 25, which means that in most cases you will have to specify it explicitely.

For example, suppose you run anubis on machine ‘anubis.domain.org’ and that it listens on port 24. Let's also assume you have installed mailutils in the default location, so that full file name of mail.remote is ‘/usr/local/libexec/mail.remote’. Then, your ‘.muttrc’ will contain:

 
set sendmail="/usr/local/libexec/mail.remote \
              smtp://anubis.domain.org:24"

(the line being split for readability).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.2 Using msg2smtp.pl as an interface to mutt

GNU Anubis is shipped with msg2smtp.pl — a perl script designed as an interface between it and mutt. The script is kindly contributed by Michael de Beer.

The script is located in the subdirectory ‘contrib’ of GNU Anubis distribution. To use it:

  1. Make sure its first line correctly refers to the full file name of the perl interpreter on your system. By default the first line reads
     
    #!/usr/bin/perl
    

    If the file name after ‘!’ differs from the actual file name of the perl interpreter, update it. For example, if perl is installed in ‘/usr/local/bin/perl’, the first line of msg2smtp.pl should read

     
    #!/usr/local/bin/perl
    
  2. Copy the script to any convenient location. Simply running cp will do, e.g.
     
    cp anubis-4.1.1/contrib/msg2smtp.pl /usr/local/libexec
    
  3. Add to your ‘.muttrc’ the following line:
     
    set sendmail="/usr/local/libexec/msg2smtp.pl -h hostname -p port"
    

    where hostname and port specify the host name (or IP address) of the machine running anubis and the port it listens on, respectively.

Complete description of msg2smtp.pl and a discussion of its command line switches can be found in file ‘contrib/msg2smtp.txt’.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.3 Patching mutt

Steven Engelhardt modified mutt so that it is able to use SMTP to transfer messages. For the time being the patch is not accepted by the mainline mutt distribution, but one of the authors of GNU Anubis(7), has tested it extensively and has found it to be quite adequate for interfacing between anubis and mutt. The patch is described in detail at http://www.deez.info/sengelha/projects/mutt/libesmtp/ and is available for mutt versions 1.4.x and 1.5.3.

To use it, follow the instructions on the page mentioned above. Once you compile the patched mutt you will be able to use the following new keywords in its configuration file:

set smtp_host = hostname

Sets the hostname or IP address of the remote SMTP host.

set smtp_port = port

Sets the port number to use.

set smtp_auth_username = user-name

Sets the username to use with SMTP AUTH command (optional).

So, assuming you run anubis on machine ‘anubis.domain.org’ and it is listening on port 24, you will add to your ‘.muttrc’ the following two lines:

 
set smtp_host = anubis.domain.org
set smtp_port = 24

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.4 Comparison of the Three Interface Methods

The following short discussion summarizes the advantages and deficiencies of the three interface methods described in the previous sections. It could serve you as a guideline on which interface method to choose.

Using mail.remote

Advanatages:

  1. Does not require modifying mutt.
  2. Is compatible with any version of mutt.
  3. Runs faster than msg2smtp.pl

Deficiences:

  1. Running an external program to transmit the message is not the best idea. However, it is mutt default, anyway...
  2. Runs slower than directly connecting to anubis using SMTP

Using msg2smtp.pl

Advantages:

  1. Does not require modifying mutt.
  2. Is compatible with any version of mutt.

Deficiences:

  1. See extprog.
  2. Runs slower than the other two methods (sending each message requires loading perl interpreter, which is rather expensive).

Using patch.sde.libesmtp.3

Advantages:

  1. Is the fastest of the three methods.
  2. Does not require any intermediate programs.

Deficiences:

  1. Requires patching mutt, which is not always possible or acceptable.
  2. May not work for versions of mutt newer than 1.5.3 (but then, again, not necessarily so).

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Sergey Poznyakoff on December, 20 2008 using texi2html 1.78.