Can users with appropriate email clients running on Unix/Linux access their Domino–hosted mail? Of course they can, if the Domino administrator enables IMAP access and ideally also SMTP and LDAP access. Lotus Notes mail files have to be IMAP–enabled by running a load convert –e _mail/file.nsf_ for each of the Notes users that should have IMAP access. This utility adds additional references to the mail file which allow the IMAP task to access it. As soon as the conversion process terminates, I can check access as long as I know what my user name and password are. The user name by which Internet protocols authenticate a user depend on the Internet Authentication setting on the Security tab of the Server’s document in the Domino Directory. As soon as I have all my details, I telnet into the Domino IMAP server, as long as nobody is looking over my shoulder (password visible):

    $ telnet 143
    Connected to (
    Escape character is '^]'.
    * OK Domino IMAP4 Server Release 6.5.4 ready Thu, 5 Jul 2007 21:13:09 +0200
    . login password
    . OK LOGIN completed
    . logout
    * BYE logging out
    . OK LOGOUT completed
    Connection closed by foreign host.

That looks good. Will SMTP also work?

    $ telnet 25
    Connected to (
    Escape character is '^]'.
    220 ESMTP Service (Lotus Domino Release 6.5.4) ready at Thu, 5 Jul 2007 21:16:14 +0200
    221 SMTP Service closing transmission channel
    Connection closed by foreign host.

That looks equally good. Now I can get started. I’ll be using Mutt in these samples, but almost any standards–compliant client be it graphical or text–based will work. Some examples are Thunderbird, or the always popular Pine, or even Net::IMAP, if I am so inclined. :-) Oh, and before I forget, most of these programs are available for Cygwin, so if I want to use them on Windows, I can go right ahead. Suppose I have a Lotus Domino shop with a number of Linux clients and I want to use Mutt as a mailer on one of these, I can set up Mutt to access my Lotus Notes mail via IMAP thusly in my .muttrc:

    set my_serv =
    set spoolfile=imap://$USER@$my_serv/INBOX
    set folder=imap://$USER@$my_serv/
    set mail_check=10
    fcc-hook .*  "imap://$USER@$my_serv/Sent"

(Note that the user–defined variables set my__ are a newer feature of Mutt; if you have an older version, either replace the text in your _.muttrc or ensure your environment contains the variable; Mutt imports them.) Mutt’s fcc-hook is very powerful and is fully documented. What I’m doing above is telling Mutt to store all sent messages into the Sent folder of my IMAP server. Read my lips: I said: “Sent folder”. I didn’t say: “Sent View”. This means, that if I access my mail file with a Notes client and search my Sent view, I won’t find the messages I sent off though Unix, because they’ve been ferreted away in the Sent folder. IMAP Sent Apart from this detail, my IMAP client can access any shared folders I have in my Notes client, and it can create new ones as well. Mutt has typically required a sendmail–compatible interface on the machine in order to deliver mail, but since version 1.5.15, mutt has SMTP support built right into it. On systems which don’t have Exim or a different mailer on them, Mutt can be configured to deliver messages through a smart host providing it is willing to accept messages. (E)SMTP support must be enabled when Mutt is built with the ––enable–smtp switch to configure, and I recommend adding ––enable–imap and ––with–ssl ––enable–hcache at the same time. Adding outgoing SMTP is easy: the variable $smtp_url contains the scheme, an optional user and password and the server name of the SMTP server in the form smtp[s]://[user[:pass]@host[:port]/. So if the SMTP server doesn’t require authentication, a simple

    set smtp_url = "smtp://$my_server"

will suffice. To enable SMTP AUTH add the user to the variable:

    set smtp_url = "smtp://$USER@$my_server"

As soon as the first outgoing SMTP connection is attempted, Mutt will prompt for the password. In order to avoid the prompting, I could add my password in the .muttrc, but I don’t want my password stored in clear text somewhere on the file system. Adding support for querying an LDAP directory (on Domino: the Domino Directory) is a bit more complex. It entails utilizing Mutt’s query_command to enable an external program to query the LDAP directory and return results which Mutt then displays to the user. The query command is invoked when I type a Q in one of the address fields, or when I type a partial name followed by CTL-T to have the name expanded.

    set query_command = "/home/jpm/bin/lquery '%s'"

The %s in above command is replaced by the string I’m searching for. I’ve quoted it to protect it from being expanded by the shell, when Mutt invokes the command. The program itself can do most anything, including of course querying an LDAP server. The output of the program is simple: the first line is read but ignored by Mutt and the resulting lines should contain a TAB delimited list of email address, name and optionally a comment (perhaps a telephone number or department number, etc.). A numer of online resources explain this topic very well: the QueryCommand page in the Mutt Wiki and a Perl program.

LDAP, Mail, DomiNotes, Exim, Linux, IMAP, and MacOSX :: 03 Aug 2007 :: e-mail