.\" Copyright (c) 2003-2012 .\" Distributed Systems Software. All rights reserved. .\" See the file LICENSE for redistribution information. .\" $Id: copyright-nr 2564 2012-03-02 00:17:08Z brachman $ '\" t .\" Title: dacsemail .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 02/19/2019 .\" Manual: DACS Commands Manual .\" Source: DACS 1.4.40 .\" Language: English .\" .TH "DACSEMAIL" "1" "02/19/2019" "DACS 1.4.40" "DACS Commands Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dacsemail \- Simple outgoing email agent .SH "SYNOPSIS" .HP \w'\fBdacsemail\fR\ 'u \fBdacsemail\fR [\fB\-bcc\fR\ \fIaddr\fR] [{\fB\-bf\fR\ |\ \fB\-\-bodyfile\fR}\ \fIpath\fR] [{\fB\-bs\fR\ |\ \fB\-\-bodystring\fR}\ \fIstring\fR] [\fB\-cc\fR\ \fIaddr\fR] .br [\fB\-ct\fR\ \fIvalue\fR] [{\fB\-f\fR\ |\ \fB\-\-from\fR}\ \fIfrom\fR] [\fB\-h\fR | \fB\-\-help\fR] [\fB\-header\fR\ \fIname\fR\ \fIvalue\fR] .br [{\fB\-mailer\fR\ |\ \fB\-mta\fR}\ \fIpath\fR] [{\fB\-mailer\-flags\fR\ |\ \fB\-mta\-flags\fR}\ \fIstring\fR] [\fB\-p\fR | \fB\-\-prompt\fR] [\fB\-save\fR\ \fIpath\fR] [{\fB\-s\fR\ |\ \fB\-\-subject\fR}\ \fIsubject\fR] [\fB\-sender\fR\ \fIsender\fR] [{\fB\-t\fR\ |\ \fB\-\-to\fR}\ \fIaddr\fR] [\fB\-transform\fR] [\fB\-v\fR | \fB\-\-verbose\fR] [\fB\-var\fR\ \fIname\fR\ \fIvalue\fR] .HP \w'\fBdacsemail\fR\ 'u \fBdacsemail\fR \fB\-\-version\fR .SH "DESCRIPTION" .PP This program is part of the \fBDACS\fR suite\&. .PP The \fBdacsemail\fR utility is a simple agent for sending email messages\&. It is a stand\-alone program that neither accepts the usual \fBDACS\fR command line options (\m[blue]\fBdacsoptions\fR\m[]\&\s-2\u[1]\d\s+2) nor accesses any \fBDACS\fR configuration files\&. .PP \fBdacsemail\fR constructs an \m[blue]\fBRFC 822\fR\m[]\&\s-2\u[2]\d\s+2 format message but does not transmit it\&. It requires an external mailer, such as \m[blue]\fBsendmail(8)\fR\m[]\&\s-2\u[3]\d\s+2, to transfer the message\&. The mailer command and its arguments can be specified on the \fBdacsemail\fR command line (see \fB\-mailer\fR) or at build time (see \m[blue]\fBdacs\&.install(7)\fR\m[]\&\s-2\u[4]\d\s+2)\&. .SH "OPTIONS" .PP If the source for the message body is not specified on the command line, it will be read from the standard input\&. At least one recipient must be specified using \fB\-t\fR, \fB\-cc\fR, or \fB\-bcc\fR\&. .PP \fB\-bcc\fR \fIaddr\fR .RS 4 Send the message to the undisclosed recipient address \fIaddr\fR\&. It is the responsibility of the mailer to delete these recipient addresses before transmitting the message\&. This flag may be repeated\&. .RE .PP \fB\-bf\fR \fIpath\fR .br \fB\-\-bodyfile\fR \fIpath\fR .RS 4 Read the message body from \fIpath\fR\&. If \fIpath\fR is \-, the standard input is read\&. .RE .PP \fB\-bs\fR \fIstring\fR .br \fB\-\-bodystring\fR \fIstring\fR .RS 4 Use \fIstring\fR as the message body\&. .RE .PP \fB\-cc\fR \fIaddr\fR .RS 4 Send the message to recipient \fIaddr\fR as a carbon copy\&. This flag may be repeated\&. .RE .PP \fB\-ct\fR \fIvalue\fR .RS 4 Add a Content\-type header of MIME type \fIvalue\fR to the message\&. If \fIvalue\fR is multipart/alternative, an appropriate \fIboundary\fR variable will be created, unless one has already been specified on the command line with the \fB\-var\fR flag\&. It is assumed that the message body has already been correctly formatted for this MIME type, or will be after it has been transformed (see \fB\-transform\fR)\&. .RE .PP \fB\-f\fR \fIfrom\fR .br \fB\-\-from\fR \fIfrom\fR .RS 4 Use \fIfrom\fR as the value of the message\*(Aqs From header\&. .RE .PP \fB\-h\fR .br \fB\-\-help\fR .RS 4 Print usage information and then exit\&. .RE .PP \fB\-header\fR \fIname\fR \fIvalue\fR .RS 4 Add a message header named \fIname\fR with value \fIvalue\fR\&. This flag should only be used for headers that do not have specific flags (\fB\-t\fR, \fB\-ct\fR, \fB\-f\fR, and so on)\&. .RE .PP \fB\-mailer\fR \fIpath\fR .br \fB\-mta\fR \fIpath\fR .RS 4 Use the message transfer agent command \fIpath\fR (a full pathname) instead of the configured program\&. This program must read the message from its standard input and extract the list of recipients from the message\*(Aqs To, Cc, and Bcc headers\&. (If such a mailer is unavailable, it will be necessary to write a small program to wrap a mailer and provide the required interface to \fBdacsemail\fR\&.) The default is to run \m[blue]\fBsendmail(8)\fR\m[]\&\s-2\u[3]\d\s+2 with its \fB\-t\fR flag\&. .RE .PP \fB\-mailer\-flags\fR \fIstring\fR .br \fB\-mta\-flags\fR \fIstring\fR .RS 4 Regardless of the mailer, use \fIstring\fR for its command line flags\&. .RE .PP \fB\-p\fR .br \fB\-\-prompt\fR .RS 4 Just before the message is to be sent, display it (to stderr) and wait for the user to respond to a prompt\&. At the prompt, the user may abort the message or allow it to be sent\&. .RE .PP \fB\-save\fR \fIpath\fR .RS 4 Just before sending (or prompting), write a copy of the outgoing message to \fIpath\fR, replacing any previous contents of the file\&. .RE .PP \fB\-s\fR \fIsubject\fR .br \fB\-\-subject\fR \fIsubject\fR .RS 4 Set the message\*(Aqs Subject header to \fIsubject\fR\&. .RE .PP \fB\-sender\fR \fIsender\fR .RS 4 Set the message\*(Aqs Sender header to \fIsender\fR\&. .RE .PP \fB\-t\fR \fIaddr\fR .br \fB\-\-to\fR \fIaddr\fR .RS 4 Add \fIaddr\fR as a "To" recipient\&. This flag may be repeated\&. .RE .PP \fB\-transform\fR .RS 4 The message body, regardless of how it is specified, is filtered through the \fBDACS\fR transformation function\&. Please refer to \m[blue]\fBdacs_transform(8)\fR\m[]\&\s-2\u[5]\d\s+2 for details\&. No access control rules may be associated with any transformation; i\&.e\&., they are all unconditional\&. A similar effect can be obtained by piping the output of \m[blue]\fBdacstransform(1)\fR\m[]\&\s-2\u[6]\d\s+2 into \fBdacsemail\fR\&. .RE .PP \fB\-v\fR .br \fB\-\-verbose\fR .RS 4 Enable verbose output for debugging\&. .RE .PP \fB\-\-version\fR .RS 4 Display the program\*(Aqs version information and then exit\&. .RE .PP \fB\-var\fR \fIname\fR \fIvalue\fR .RS 4 Create \m[blue]\fBa variable\fR\m[]\&\s-2\u[7]\d\s+2 named \fIname\fR set to \fIvalue\fR for the transform function\&. The variable\*(Aqs value can be referenced within the message body in the \fIDACS\fR namespace as \fI${DACS::\fR\fI\fIname\fR\fR\fI}\fR\&. The variable must not already be defined\&. .RE .SH "EXAMPLES" .PP Suppose myfile contains the following text: .sp .if n \{\ .RS 4 .\} .nf This is a multi\-part message in MIME format\&. \-\-${DACS::boundary} Content\-Type: text/plain; charset=us\-ascii Content\-Disposition: inline Content\-Transfer\-Encoding: 7bit Hello, ${DACS::user}! \-\-${DACS::boundary} Content\-Type: text/html; charset=us\-ascii Content\-Disposition: inline Content\-Transfer\-Encoding: 7bit

Hello, ${DACS::user}!

\-\-${DACS::boundary}\-\- .fi .if n \{\ .RE .\} .sp The following command might be used to send a message with a multipart/alternative structured body: .sp .if n \{\ .RS 4 .\} .nf % dacsemail \-ct multipart/alternative \-f auggie@example\&.com \e \-t harley@example\&.com \-s "Hello" \-transform \-var user Auggie \-bf myfile .fi .if n \{\ .RE .\} .PP The resulting message will look something like the following: .sp .if n \{\ .RS 4 .\} .nf To: harley@example\&.com From: auggie@example\&.com Subject: Hello Content\-type: multipart/alternative; boundary="_\-\-\-\-\-\-\-\-\-\-=_03885942562898683484" Date: Wed, 07 Apr 2010 16:48:41 \-0700 (PDT) Content\-transfer\-encoding: 7bit X\-mailer: DACS 1\&.4\&.24a This is a multi\-part message in MIME format\&. \-\-_\-\-\-\-\-\-\-\-\-\-=_03885942562898683484 Content\-Type: text/plain; charset=us\-ascii Content\-Disposition: inline Content\-Transfer\-Encoding: 7bit Hello, Auggie! \-\-_\-\-\-\-\-\-\-\-\-\-=_03885942562898683484 Content\-Type: text/html; charset=us\-ascii Content\-Disposition: inline Content\-Transfer\-Encoding: 7bit

Hello, Auggie!

\-\-_\-\-\-\-\-\-\-\-\-\-=_03885942562898683484\-\- .fi .if n \{\ .RE .\} .sp .SH "FILES" .PP None\&. .SH "DIAGNOSTICS" .PP The program exits 0 if everything was fine, 1 if an error occurred\&. Error messages are printed to stderr\&. Errors and routine messages from the mailer are recorded wherever they are normally logged, outside of \fBDACS\fR .SH "BUGS" .PP This program\*(Aqs primary purpose is for testing \fBDACS\fR functionality that is needed for internal purposes\&. No significant improvements are envisioned\&. You could throw a rock and hit a better email agent\&. .SH "SEE ALSO" .PP \m[blue]\fBdacs\&.exprs(5)\fR\m[]\&\s-2\u[8]\d\s+2, \m[blue]\fBdacs\&.install(7)\fR\m[]\&\s-2\u[4]\d\s+2, \m[blue]\fBdacs_transform(8)\fR\m[]\&\s-2\u[5]\d\s+2, \m[blue]\fBsendmail(8)\fR\m[]\&\s-2\u[3]\d\s+2 .SH "AUTHOR" .PP Distributed Systems Software (\m[blue]\fBwww\&.dss\&.ca\fR\m[]\&\s-2\u[9]\d\s+2) .SH "COPYING" .PP Copyright \(co 2003\-2018 Distributed Systems Software\&. See the \m[blue]\fBLICENSE\fR\m[]\&\s-2\u[10]\d\s+2 file that accompanies the distribution for licensing information\&. .SH "NOTES" .IP " 1." 4 dacsoptions .RS 4 \%http://dacs.dss.ca/man/dacs.1.html#dacsoptions .RE .IP " 2." 4 RFC 822 .RS 4 \%http://www.rfc-editor.org/rfc/rfc822.txt .RE .IP " 3." 4 sendmail(8) .RS 4 \%https://www.freebsd.org/cgi/man.cgi?query=sendmail&apropos=0&sektion=8&manpath=FreeBSD+10.3-RELEASE&format=html .RE .IP " 4." 4 dacs.install(7) .RS 4 \%http://dacs.dss.ca/man/dacs.install.7.html#configure_options .RE .IP " 5." 4 dacs_transform(8) .RS 4 \%http://dacs.dss.ca/man/dacs_transform.8.html .RE .IP " 6." 4 dacstransform(1) .RS 4 \%http://dacs.dss.ca/man/dacstransform.1.html .RE .IP " 7." 4 a variable .RS 4 \%http://dacs.dss.ca/man/dacs.exprs.5.html#variable_syntax .RE .IP " 8." 4 dacs.exprs(5) .RS 4 \%http://dacs.dss.ca/man/dacs.exprs.5.html#transform .RE .IP " 9." 4 www.dss.ca .RS 4 \%http://www.dss.ca .RE .IP "10." 4 LICENSE .RS 4 \%http://dacs.dss.ca/man/../misc/LICENSE .RE