[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nmh-workers] contrib to select mail server based on From: in draft
From: |
David Levine |
Subject: |
[Nmh-workers] contrib to select mail server based on From: in draft |
Date: |
Sun, 29 May 2016 09:46:24 -0400 |
I added a program, docs/contrib/sendfrom.c, that selects the SMTP server based
on the draft's From: address.
The source code can be viewed at
http://git.savannah.gnu.org/cgit/nmh.git/tree/docs/contrib/sendfrom.c
An excerpt from the usage notes is below.
It can take full advantage of nmh's OAuth support, but that support is
currently only available on the xoauth branch.
It'd be nice if send read the draft and added the switches for post. It'd be
easy to merge that code from sendfrom into send, and I'd be glad to do it if
there's interest.
David
* This program fits between send(1) and post(1), as a postproc. It makes up
for the facts that send doesn't parse the message draft and post doesn't load
the profile.
*
* To use:
*
* 1) Add profile entries of the form:
*
* sendfrom-<email address or domain name>: <post(1) switches>
*
* The email address is extracted from the From: header line of the message
draft. Multiple profile entries, with different email addresses or domain
names, are supported. This allows different switches to post(1), such as
-user, to be associated with different email addresses. If a domain name is
used, it matches all users in that domain.
*
* Example profile entry using OAuth for account hosted by gmail:
*
* address@hidden: -saslmech xoauth2 -authservice gmail -tls -server
smtp.gmail.com -user address@hidden
*
* Example profile entries that use an nmh credentials file:
*
* credentials: file:nmhcreds
* address@hidden: -sasl -tls -server smtp.sendgrid.net
* sendfrom-outbound.att.net: -sasl -initialtls -server outbound.att.net
-port 465
* sendfrom-fastmail.com: -initialtls -sasl -saslmech LOGIN -server
smtps-proxy.messagingengine.com -port 80
*
* where nmhcreds is in the user's nmh directory (from the Path profile
component) and contains:
*
* machine smtp.sendgrid.net
* login address@hidden
* password ********
* machine outbound.att.net
* login address@hidden
* password ********
* machine smtps-proxy.messagingengine.com
* login address@hidden
* password ********
*
* 2) To enable, add a line like this to your profile:
*
* postproc: <docdir>/contrib/sendfrom
*
* with <docdir> expanded.