From: David Belohrad <david@belohrad.ch>
To: Keith Amidon <camalot@picnicpark.org>,notmuch@notmuchmail.org
Subject: Re: sending email using different server for different 'From:' field
Date: Wed, 03 Sep 2014 09:16:51 +0200 [thread overview]
Message-ID: <uaxbnqxdvh8.fsf@beesknees.cern.ch> (raw)
In-Reply-To: <1409668511.2507.32.camel@picnicpark.org>
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 <camalot@picnicpark.org> 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 "<kea@x.com>"
> (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)
next prev parent reply other threads:[~2014-09-03 7:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 12:26 sending email using different server for different 'From:' field David Belohrad
2014-09-02 14:35 ` Keith Amidon
2014-09-03 7:16 ` David Belohrad [this message]
2014-09-03 8:31 ` Mark Walters
2014-09-05 21:47 ` David Belohrad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=uaxbnqxdvh8.fsf@beesknees.cern.ch \
--to=david@belohrad.ch \
--cc=camalot@picnicpark.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).