FetchExc is java utility which retrieves mail from your MS Exchange (2000/2003) inbox and forwards it to SMTP server of your choice or mbox type file. FetchExc uses webDAV to retrieve mail either over http or https. webDAV is used also by Outlook Webaccees (OWA). This is also means that you administrator must have left OWA available in Exchange in order to get this utility to work.
I consider this program usable in production environment. There are still many places that should be polished and improved but atleast there haven't been major problems in over a year. Before you install read installation instructions from below carefully. Check list at the bottom of the page to see what has changed in each version.
You'll need following:
Or if you want to pick-up all pieces yourself:
From HttpClient you'll need commons-httpclient-3.0.1.jar (or later). From Logging you'll need commons-logging-api-1.1.jar and commons-logging-1.1.jar. And finally from Codec you'll need commons-codec-1.3.jar. Put all jars in same directory.
You also need Java Runtime Environment (1.5.0 or later) Java 2 Platform, Standard Edition
So far this only covers *nix systems (windows instructions may follow if they are needed)
Extract fetchExc-*.tar.gz or make directory for fetchExc.jar. If you are downloading Jakarta components yourself put them in the same directory as fetchExc.jar.
Create fetchExc.properties file in your home directory. Remember to protect it with chmod 700 (it contains your password). If you took .tar.gz package there should be example included.
ExchangeServer=xxx.dddddd.com ExchangePath=exchange MailServer=yyy.dddddd.com DestinationAddressemail@example.com Username=domainuser Password=domainpassword Domain=DOMAIN Delete=false All=false Secure=true FBApath=/exchweb/bin/auth/owaauth.dll
ExchangeServer - Name of your MS Exchange server.
ExchangePath - Exchange path for MS Exchange OutLook WebAccess.
You can test first two properties by making URL out of them: http://ExchangeServer/ExchangePath/. This should give you a Outlook Webaccess Page.
ExchangeUser - Name of you MS Exchange User. This is not needed if version is v1.50 or later
MboxFile - Path and name of mbox-type mail box. This disables MailServer- and DestinationAddress-properties. Be careful with this because I'm not 100% sure that file locking works (YMMV). If there are problems let me know. Also success reports would be nice.
MailServer - Name of your SMTP Server which receives forwarded messages. If there is MboxFile defined this property won't be used.
DestinationAddress - Address of recipient of forwarded messages. If there is MboxFile defined this property won't be used. If ProcMail is true this is program which is used to send mail for example /usr/bin/procmail.
Username - Username for your windows domain user. It may be same as ExchangeUser but necessarily.
Password - Password for domain user.
Domain - Domain for above user.
Delete - Whether program should delete mail from Inbox or just mark them as read. If Delete is true mail will be deleted after succesful forwarding. Any other value will just mark message as read. While you are configuring other properties I strongly recommend that you use value false for this property.
All - Whether program should real all mail from Inbox or just which are not read yet. If All is true every mail will be read. Any other value will read only unread mail. While you are configuring other properties I strongly recommend that you use value false for this property.
WARNING!!! Don't combine Delete=false and All=true if you are not testing. That will fetch every mail from your Inbox everytime you start the program.
Secure - If value is true program will use https. Any other value will use http. Https should be user whenever possible. NOTE!!! Check this if you get sun.security.validator.ValidatorException-Exception
FBApath - Path to form based authentication. If not set defaults to /exchweb/bin/auth/owaauth.dll. This can be found on FBA login page source (hint: search for "destination")
ForceFrom - If this is set to true forwarded mail will be forwarded with address from ForceFromAddr parameter. This only happens when sender address is not valid. For example if there is two From: fields in mail header Exchange can join addresses. NOTE!!!: This may help spam to get through so use carefully.
ForceFromAddr - E-mail address that forwarding server will accept. Only used if ForceFrom is true
NoEightBitMime - If this is true SMTP forwarding doesn't use BODY=8BITMIME. Default is false.
ProcMail - If this is true program in DestinationAddress is used to send mail. Default is false.
Destination - Use this if use use FBA with ISA. Value for this property can be found from login page source. Search for hidden field "destination" for value.
ProxyHost - If you have to use proxy put proxy hostname here. NOTE!!! So far I haven't been able to connect through proxy when Secure=true. If this works for you with Secure=true send me a message.
ProxyPort - If ProxyHost is set you can define port for it here. Default is port 80.
Now you just need to include JRE in you path. If it is in you path you can run program:
java -jar /install/fetchExc/fetchExc.jar
You can now (>0.80) use -p switch to change properties file. For example:
java -jar /install/fetchExc/fetchExc.jar -p test.properties
would run program using properties from test.properties
I use fetchExc with following little shell script and crontab entry so that it keeps fetching mail every two minutes.
#!/bin/bash export PATH=$PATH:/usr/local/jre/bin java -jar /install/fetchExc/fetchExc.jar $* >> fetchExc.log 2>> fetchExc.err
If you use this script replace /usr/local/jre/bin with path to your java runtime environment. Same applies to location of your installation on next line.
*/2 * * * * ~jrauti/bin/fetchExc
For compilation you need Java development environment (>1.4.2) and apache ant.
v0.50 First public release
Thanks for Jakarta Project for excellent components.
Thanks for Novell for Evolution Connector which I used to get traffic dumps that I needed for webDAV(OWA) conversation
Thanks for Eric S. Raymond for excellent fetchmail which I still use whenever I can.
You can reach me with email: jrauti(at)iki.fi. You should know what to do with (at) ;-). Any comments and improvements are welcome.
FetchExc - fetches mail with webDAV from MS Exchange 2000/2003 servers.
Copyright (C) 2004-2007 Juhani Rautiainen
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Outlook is a registered trademark of Microsoft Corporation and Exchange is a trademark of Microsoft Corporation. All other brands and product names are trademarks and registered trademarks of their respective holders.