<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jamesoff.net &#187; Exim and email</title>
	<atom:link href="http://jamesoff.net/site/category/exim-and-email/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesoff.net/site</link>
	<description>you heard</description>
	<lastBuildDate>Wed, 16 Dec 2009 10:32:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using gvim to edit mail in Outlook</title>
		<link>http://jamesoff.net/site/2009/04/03/using-gvim-to-edit-mail-in-outlook/</link>
		<comments>http://jamesoff.net/site/2009/04/03/using-gvim-to-edit-mail-in-outlook/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 16:43:45 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Exim and email]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[outlook]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=375</guid>
		<description><![CDATA[Before you go any further, this isn&#8217;t about having gvim embedded in Outlook, or using it automatically as an external editor. This method lets you use one keystroke to edit a mail in gvim and when you close gvim, it&#8217;s put back into the Outlook compose mail window. You will need: AutoHotkey, a keystroke mapping/scripting [...]]]></description>
			<content:encoded><![CDATA[<p>Before you go any further, this isn&#8217;t about having gvim embedded in Outlook, or using it automatically as an external editor.</p>

<p>This method lets you use one keystroke to edit a mail in gvim and when you close gvim, it&#8217;s put back into the Outlook compose mail window.</p>

<p><span id="more-375"></span></p>

<p><strong>You will need:</strong></p>

<ul>
<li><a href="http://www.autohotkey.com/">AutoHotkey</a>, a keystroke mapping/scripting application</li>
<li>My script (below)</li>
<li>gvim for Windows</li>
</ul>

<p><strong>Method:</strong></p>

<ol>
<li>Install AutoHotKey</li>
<li>Install gvim</li>
<li>Install my script into AutoHotKey (it appears at the end of this post). Note that my script has the gvim path hard-coded in and you may well need to change it.</li>
<li>Configure your Outlook to use plain text for composing mail.</li>
<li>Press <strong>Win-V</strong> with an Outlook compose window open and when the cursor is in the message pane</li>
</ol>

<p><strong>Serving suggestion:</strong></p>

<ul>
<li>Goes really well with <a href="http://home.in.tum.de/~jain/software/outlook-quotefix/">Outlook QuoteFix</a></li>
<li>gvim will be opened with the contents of the message window</li>
<li>Edit your mail in gvim and when done, save and quit</li>
<li>Your edited message is put back into the Outlook message window.</li>
</ul>

<p><strong>Additional notes:</strong></p>

<ul>
<li>At the moment, this only works with one mail at a time, as the file for the mail is statically named. If you try Win-V in a mail while you have another already opened, Bad Things will Happen.</li>
<li>You may want to adjust your vimrc file so that it uses the &#8220;mail&#8221; filetype for editing; I also have a mail.vim file with macros and things in it which I tell it to load for this. I pinched it off the web, I&#8217;m sure you can find it. The required vimrc lines are below.</li>
<li>If the cursor isn&#8217;t in the message pane of the Outlook compose window when you press Win-V (or if it moves there before you close the gvim window), things will probably go wrong.</li>
<li>I&#8217;ve tested this with Outlook 2003, gvim 7.2 and AutoHotkey 1.0.47.06.</li>
</ul>

<p>Here&#8217;s the optional vimrc line:</p>


<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #668080;">autocmd</span> BufRead <span style="color: #000000;">*/</span>outlook<span style="color: #000000;">.</span>txt <span style="color: #000000;">:</span>source <span style="color: #000000;">$</span>HOME<span style="color: #000000;">/</span>vimfiles<span style="color: #000000;">/</span>mail<span style="color: #000000;">.</span>vim</pre></div></div>


<p>Here&#8217;s the script itself:</p>

<pre lang="">
#v::
SetTitleMatchMode, 2
IfWinActive, Message (Plain Text)
{
    WinGet, ActiveWindow, ID
    SendInput ^a
    Send ^c

    clipboard = %clipboard%

    FileDelete, %TEMP%\outlook.txt
    FileAppend, %Clipboard%, %TEMP%\outlook.txt

    RunWait, C:\Program Files\vim\vim72a\gvim.exe %TEMP%\outlook.txt

    FileRead, Clipboard, %TEMP%\outlook.txt

    WinActivate, ActiveWindow
    Send ^a^v^{HOME}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2009/04/03/using-gvim-to-edit-mail-in-outlook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting localparts in Exchange Recipient Policies</title>
		<link>http://jamesoff.net/site/2007/01/29/setting-localparts-in-exchange-recipient-policies/</link>
		<comments>http://jamesoff.net/site/2007/01/29/setting-localparts-in-exchange-recipient-policies/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 09:05:41 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Exim and email]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2007/01/29/setting-localparts-in-exchange-recipient-policies/</guid>
		<description><![CDATA[It&#8217;s taken me too long to find this. (For the uninitiated, Exchange Recipient Policies tell Active Directory how to automatically generate email addresses for your users.) If you want to tell a recipient policy in Exchange 2003 (and presumably 2007) how to generate the localpart other then just username, use these expanos: %s : Surname [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s taken me too long to find this.</p>

<p>(For the uninitiated, Exchange Recipient Policies tell Active Directory how to automatically generate email addresses for your users.)</p>

<p>If you want to tell a recipient policy in Exchange 2003 (and presumably 2007) how to generate the localpart other then just <code>username</code>, use these expanos:</p>

<blockquote>
  <p>%s : Surname (last name)</p>
  
  <p>%g : Given name (first name)</p>
  
  <p>%i : Middle initial</p>
  
  <p>%d : Display name</p>
  
  <p>%m : Exchange 2003 alias</p>
  
  <p>%rxy : Replace all subsequent characters x with character y in username. If x = y, the character will be deleted.</p>
</blockquote>

<p>There are other things you can do like chopping the string to a certain number of characters, see the full article for details.</p>

<p>No longer will I have to manually add <code>first.last@domain.com</code> to every user I create :D</p>

<p><a href="http://support.microsoft.com/Default.aspx?kbid=822447">http://support.microsoft.com/Default.aspx?kbid=822447</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2007/01/29/setting-localparts-in-exchange-recipient-policies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Email address failures</title>
		<link>http://jamesoff.net/site/2005/08/02/email-address-failures/</link>
		<comments>http://jamesoff.net/site/2005/08/02/email-address-failures/#comments</comments>
		<pubDate>Tue, 02 Aug 2005 12:56:01 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Exim and email]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2005/08/02/email-address-failures/</guid>
		<description><![CDATA[I wonder, do services like Hotmail have an address rewriting rule that rewrites www.somename@hotmail.com to somename@hotmail.com, given the number of people who don&#8217;t understand the difference between a URL and an email address?]]></description>
			<content:encoded><![CDATA[<p>I wonder, do services like Hotmail have an address rewriting rule that rewrites www.somename@hotmail.com to somename@hotmail.com, given the number of people who don&#8217;t understand the difference between a URL and an email address?</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2005/08/02/email-address-failures/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>BitDefender in Exim</title>
		<link>http://jamesoff.net/site/2005/07/22/bitdefender-in-exim/</link>
		<comments>http://jamesoff.net/site/2005/07/22/bitdefender-in-exim/#comments</comments>
		<pubDate>Fri, 22 Jul 2005 16:09:10 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Exim and email]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2005/07/22/bitdefender-in-exim/</guid>
		<description><![CDATA[After playing with BitDefender&#8217;s free &#8216;bdc&#8217; command-line scanner for FreeBSD, I&#8217;ve set up the mailserver at work to scan with clamav and then BitDefender. Since I couldn&#8217;t find any canned examples online for how to do this, other than Exim&#8217;s documentation for wiring up a generic command-line scanner, I thought I&#8217;d share it. drop message [...]]]></description>
			<content:encoded><![CDATA[<p>After playing with BitDefender&#8217;s free &#8216;bdc&#8217; command-line scanner for FreeBSD, I&#8217;ve set up the mailserver at work to scan with clamav and then BitDefender. Since I couldn&#8217;t find any canned examples online for how to do this, other than Exim&#8217;s documentation for wiring up a generic command-line scanner, I thought I&#8217;d share it.
<code>
    drop  message = This message contains malware ($malware_name) [scanner2]
      set acl_m0 = cmdline:\
        /usr/local/bdc/bdc --arc %s:\
        infected:\
        infected. (.+)
      malware = */defer_ok
</code>
[scanner2] is for indicating to me which scanner spotted the virus (for stats and debugging). The <code>set acl_m0</code> stuff is to do with using muliple virus scanners. In the first section of my Exim config I have <code>av_scanner = $acl_m0</code>. If you&#8217;re not using multiple scanners, then set <code>av_scanner</code> to
<code>
cmdline:\
        /usr/local/bdc/bdc --arc %s:\
        infected:\
        infected. (.+)
</code>
and delete the <code>set</code> line from the ACL block.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2005/07/22/bitdefender-in-exim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
