KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    Linux42.org    OpenSkillz.com   

- News . 
click to vote up

Bryce Harrington: Setting up Mutt and IMAP for email through Exchange EWS

Published Jul 18 2013 via RSS

One of the nice things about working for Canonical these past many years was having an entirely Linux-based infrastructure. For the most part I never needed to worry about the existance of Windows.

Yet, having now joined a company, that – like most of the modern world – is fundamentally Microsoft infrastructured, I find myself needing to interface with Exchange to get and send my email.

At first I took the easy route of using Outlook webmail in firefox. This wasn’t total frustration, I actually kinda liked the conversation grouping feature. But inevitably the frustrations eventually hit a breaking point!

I assumed setting up mutt with Exchange would be a well trod path on the Internet and I could just paint-by-numbers my way through. No such luck. So, in hopes of saving others some work of piecing things together from man pages, random forum posts, and plain trial and error, here’s my guide for getting this all set up.

Certain Linux-based mail clients like Thunderbird and Evolution are able to speak directly with Exchange using EWS. However, there are many other Linux email and calendaring clients available that you may want to use, but that don’t support Exchange EWS. For instance, you may wish to use a console-based mail client such as mutt.

Fortunately, you can set up DavMail as an intermediary gateway. DavMail interfaces with the Exchange server, presenting it as a standards-compliant POP/IMAP/SMTP/Caldav/Carddav/LDAP service. In other words, you use IMAP or POP to browse or retrieve emails, SMTP to send email, LDAP to look up addresses, Caldav for calendaring, and Carddav for personal contacts.

Setting up the DavMail server

The DavMail package can be downloaded from http://davmail.sourceforge.net/download.html. At the time of this writing it appears to not exist in the Ubuntu archive, however a .deb file suitable for Debian and Ubuntu is available from the above link. For other Linux distributions you’ll need to use the standard tarball package and manually install Java.

  # Install on Ubuntu
  sudo apt-get install libswt-gtk-3-java   # Or other java as desired
  sudo dpkg -i davmail_4.3.3-2146-1_all.deb

You can then launch DavMail via the Applications/Internet menu.

DavMail does not store any credentials, it merely needs to know the name and path of the Exchange server to use. The first time you launch DavMail, a configuration dialog will appear. Only one parameter needs changed:

  URL OWA (Exchange):  https://webmail.your.company.com/EWS/Exchange.asmx

The rest of the settings can be left at defaults. See the DavMail Tutorial for info about the rest of the settings or if you run into problems. Note that logging information is written to ~/davmail.log.

Finally, set up DavMail to start up on session login. For example:

  echo "davmail &" >> ~/.gnomerc

I’d never heard of DavMail before, but it’s been quite solid so far.

Setting up msmtp SMTP client

Sendmail is the de facto standard for SMTP, but is a bit overkill if you’re just setting up a single user local email environment. msmtp is simpler
to configure and adequate for single user email needs.

  sudo apt-get install msmtp
  touch ~/.msmtprc ~/.msmtp.log
  chmod 600 ~/.msmtprc ~/.msmtp.log

Since the IMAP server is on localhost, the msmtp configuration is quite basic:

  # ~/.msmtprc
  logfile ~/.msmtp.log

  account default
  host localhost
  port 1025
  protocol smtp
  from f.lastname@company.com
  auth AUTH
  user DOMAIN\f.lastname
  password  PASSWORD

Here, PASSWORD is your own password, DOMAIN is going to be something specific to your company, and for AUTH it’ll depend on how you want to have things set up. See msmtp authentication for options.

Setting up mutt for email

If you’ve used mutt before, you’ll already be familiar with its myriad configuration options. If you haven’t, then this section isn’t for you!

So, skipping over installation and basic mutt configuration, here’s how to configure mutt to use IMAP. This keeps the emails and folders on the remote server and uses the local DavMail service for sending and receiving emails.

  # ~/.muttrc
  set spoolfile="imap://f.lastname:PASSWORD@"
  set folder="imap://f.lastname:PASSWORD@"
  set from="f.lastname@company.com"
  set realname='Firstname Lastname'
  set trash="imap://f.lastname:PASSWORD@"
  set imap_user="f.lastname@company.com"
  set imap_pass="PASSWORD"
  set imap_keepalive=900   # Set lower if connection times out
  set header_cache=~/.mutt/cache/headers
  set message_cachedir=~/.mutt/cache/bodies

  set sendmail="/usr/bin/msmtp"
  my_hdr From: "Firstname Lastname"

Setting up git

You can direct git to send patches through SMTP via the DavMail server.

  # ~/.gitconfig
        name = Firstname Lastname
        email = f.lastname@company.com

        smtpserver = localhost
        supresscc = self
        from = Firstname Lastname 
        smtppass = PASSWORD
        smtpserverport = 1025
        smtpuser = f.lastname
        confirm = auto
	chainreplyto = true

BackRead original postSend to a friend

Add comment

Add comment
Show all posts

 Who we are
More about us
Frequently Asked Questions
Updates on identi.ca
Updates on Twitter
Content RSS   
Events RSS   

Add Artwork
Public API
About GNOME-Look.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Sponsor us
Report Abuse

Copyright 2003-2016 GNOME-Look.org Team  
All rights reserved. GNOME-Look.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
GNOME and the foot logo are trademarks of the GNOME Foundation.