Pither.com / Simonhttps://www.pither.com/simon/blog/2013-11-19T14:08:44+00:00Development, systems administration, parenting and businessgrails-mail patch for envelopeFrom (VERP)2011-03-13T00:00:00+00:002013-11-19T14:08:44+00:00Simon Pitherhttps://www.pither.com/simon/blog/2011/03/13/grails-mail-patch-for-envelopefrom-verp<article>
<h1>grails-mail patch for envelopeFrom (VERP)</h1>
<div class="article-meta">
Posted
by <span>Simon Pither</span>
on <time datetime="2011-03-13T00:00:00+00:00">Sun 13th Mar 2011</time>
(updated <time datetime="2013-11-19T14:08:44+00:00">Tue 19th Nov 2013</time>)
</div>
<div>
<p>I have previously written about <a href="/articles/2010/06/22/envelope-senders-for-grails-mail-plugin-spring-java-mail">setting envelope senders when sending email in grails</a> and following comments made on that post I did actually get around to submitting a patch to the plugin.</p>
<p>However a change to that patch was suggested and before I managed to implement it, the mail plugin underwent a fairly large refactoring which meant I needed to completely rework my patch.</p>
<p>The refactoring did actually make my updated patch much simpler though and I have now got it all written, complete with test coverage (my first go at using <a href="http://www.icegreen.com/greenmail/">GreenMail</a> - which I quite like).</p>
<p>This time around my patch adds an envelopeFrom method to the sendMail closure...</p>
<pre><code>sendMail {
envelopeFrom 'verp-fred=smith.com@example.com'
from 'abc@example.com'
to 'fred@smith.com'
subject 'Important email'
body ...
}
</code></pre>
<p>You can find <a href="https://github.com/spither/grails-mail">my version of the grails mail plugin</a> forked on github and hopefully it will be <a href="https://github.com/gpc/grails-mail/pull/3">pulled</a> into the main plugin soon.</p>
<p>It's already in production and working well at <a href="http://www.supajam.com/">SupaJam</a> (sending about 50,000 emails per week).</p>
</div>
<div class="tags-panel panel panel-default">
<div class="panel-body">
Tags:
<a rel="tag" href="/simon/blog/?tag=grails">grails</a>
<a rel="tag" href="/simon/blog/?tag=email">email</a>
<a rel="tag" href="/simon/blog/?tag=smtp">smtp</a>
<a rel="tag" href="/simon/blog/?tag=envelope-sender">envelope sender</a>
<a rel="tag" href="/simon/blog/?tag=verp">verp</a>
<a rel="tag" href="/simon/blog/?tag=technology">technology</a>
</div>
</div>
</article>