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