--- /dev/null
+Return-Path: <david@belohrad.ch>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id AB0BE431FB6\r
+ for <notmuch@notmuchmail.org>; Wed, 3 Sep 2014 00:41:55 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id C4JYOheutxuc for <notmuch@notmuchmail.org>;\r
+ Wed, 3 Sep 2014 00:41:48 -0700 (PDT)\r
+X-Greylist: delayed 1493 seconds by postgrey-1.32 at olra;\r
+ Wed, 03 Sep 2014 00:41:48 PDT\r
+Received: from beesknees.cern.ch (beesknees.cern.ch [137.138.197.99])\r
+ (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 7936C431FAF\r
+ for <notmuch@notmuchmail.org>; Wed, 3 Sep 2014 00:41:48 -0700 (PDT)\r
+Received: from belohrad by beesknees.cern.ch with local (Exim 4.84)\r
+ (envelope-from <david@belohrad.ch>)\r
+ id 1XP4oF-0005o0-JL; Wed, 03 Sep 2014 09:16:51 +0200\r
+From: David Belohrad <david@belohrad.ch>\r
+To: Keith Amidon <camalot@picnicpark.org>,notmuch@notmuchmail.org\r
+Subject: Re: sending email using different server for different 'From:' field\r
+In-Reply-To: <1409668511.2507.32.camel@picnicpark.org>\r
+References: <uaxzjei1a4j.fsf@beesknees.cern.ch>\r
+ <1409668511.2507.32.camel@picnicpark.org>\r
+User-Agent: Notmuch/0.18~rc0+2~gbc64cdc (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Wed, 03 Sep 2014 09:16:51 +0200\r
+Message-ID: <uaxbnqxdvh8.fsf@beesknees.cern.ch>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 03 Sep 2014 07:41:55 -0000\r
+\r
+oukej. this seems to be exactly what I'm looking for. Is there a way how\r
+to 'cycle' in notmuch different From: fields? I'd need to setup like 3\r
+addresses, each of them with different signatures and be able to easily\r
+switch between them....\r
+\r
+thanks\r
+.d.\r
+\r
+\r
+Keith Amidon <camalot@picnicpark.org> writes:\r
+\r
+> On Tue, 2014-09-02 at 14:26 +0200, David Belohrad wrote:\r
+>> could that scenario be somehow fitted automatically, so when I overwrite\r
+>> the default 'From:' address (by hand. is it possible to do some\r
+>> automatic cycling?) to work address, so that message sender in emacs\r
+>> would automatically use work exchange server to deliver the mail?\r
+>\r
+> I think this is more of a message-mode question than a notmuch question.\r
+> I use something very similar to code attached below, which is rather\r
+> brute-force, but does the job for me.\r
+>\r
+> --- Keith\r
+>\r
+> -----\r
+>\r
+> (defun kea/send-mail-with-x ()\r
+> (interactive)\r
+> (setq smtpmail-smtp-server "smtp.x.com"\r
+> smtpmail-smtp-service 587\r
+> smtpmail-local-domain "x.com"\r
+> smtpmail-auth-user nil\r
+> smtpmail-stream-type 'starttls))\r
+>\r
+> (defun kea/send-mail-with-y ()\r
+> (interactive)\r
+> (setq smtpmail-smtp-server "email.y.com"\r
+> smtpmail-smtp-service 587\r
+> smtpmail-local-domain "y.com"\r
+> smtpmail-auth-user nil\r
+> smtpmail-stream-type 'starttls))\r
+>\r
+> (defun kea/message-select-mail-dest ()\r
+> (cond ((string-match "<kea@x.com>"\r
+> (message-field-value "From"))\r
+> (kea/send-mail-with-x))\r
+> (t\r
+> (kea/send-mail-with-y))))\r
+>\r
+> (kea/send-mail-with-y)\r
+> (add-hook 'message-send-hook 'kea/message-select-mail-dest)\r