nmh-workers
[Top] [All Lists]

[Nmh-workers] contrib to select mail server based on From: in draft

2016-05-29 08:46:46
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:
 *
 *       sendfrom-gmail_address(_at_)example(_dot_)com: -saslmech xoauth2 
-authservice gmail -tls -server smtp.gmail.com -user 
gmail_login(_at_)example(_dot_)com
 *
 *    Example profile entries that use an nmh credentials file:
 *
 *       credentials: file:nmhcreds
 *       sendfrom-sendgrid_address(_at_)example(_dot_)com: -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 sendgrid_login(_at_)example(_dot_)com
 *           password ********
 *       machine outbound.att.net
 *           login att_login(_at_)example(_dot_)com
 *           password ********
 *       machine smtps-proxy.messagingengine.com
 *           login fastmail_login(_at_)example(_dot_)com
 *           password ********
 *
 * 2) To enable, add a line like this to your profile:
 *
 *        postproc: <docdir>/contrib/sendfrom
 *
 *    with <docdir> expanded.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>