From: Mark Walters Date: Wed, 3 Sep 2014 08:31:55 +0000 (+0100) Subject: Re: sending email using different server for different 'From:' field X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=213c79c56ce29dd07a75b9798cc27578cc6c294a;p=notmuch-archives.git Re: sending email using different server for different 'From:' field --- diff --git a/86/134169d50187b15dc207df86f1321329644d9f b/86/134169d50187b15dc207df86f1321329644d9f new file mode 100644 index 000000000..4bda652b3 --- /dev/null +++ b/86/134169d50187b15dc207df86f1321329644d9f @@ -0,0 +1,111 @@ +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 0EA2F431FB6 + for ; Wed, 3 Sep 2014 01:32:34 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.502 +X-Spam-Level: +X-Spam-Status: No, score=0.502 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_LOW=-0.7] 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 hbNKHn2wV1pf for ; + Wed, 3 Sep 2014 01:32:26 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id CA4EF431FAF + for ; Wed, 3 Sep 2014 01:32:25 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1XP5yv-0000J0-L9; Wed, 03 Sep 2014 09:32:17 +0100 +Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1XP5yv-0004bu-9c; Wed, 03 Sep 2014 09:31:57 +0100 +From: Mark Walters +To: David Belohrad , Keith Amidon , + notmuch@notmuchmail.org +Subject: Re: sending email using different server for different 'From:' field +In-Reply-To: +References: + <1409668511.2507.32.camel@picnicpark.org> + +User-Agent: Notmuch/0.15.2+803~ge083086 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Wed, 03 Sep 2014 09:31:55 +0100 +Message-ID: <87egvtds04.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 87.81.223.162 +X-QM-Geographic: According to ripencc, + this message was delivered by a machine in Britain (UK) (GB). +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 73216c59c36b5ced87234fe02178ff3d (of first 20000 bytes) +X-SpamAssassin-Score: -0.1 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -0.1 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.1 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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 08:32:34 -0000 + + +Hi + +On Wed, 03 Sep 2014, David Belohrad wrote: +> 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.... + +You might finding setting notmuch-always-prompt-for-sender to 't is +what you want (you can set if in customise or directly) + +This prompts you for the sender address and takes options from your +notmuch config file (that is from user.primary_email and +user.other_email from .notmuch-config) so will quite possibly just work. + + +>> +>> (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) + +I will also mention an alternative approach to using hooks here. You +could customise message-send-mail-function to be your own function which +let binds the appropriate send-mail settings and have that call the +actual send-mail function (eg message-send-mail-with-sendmail) + +Best wishes + +Mark +