mail_file

Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 11 August 2009
Index Return to Main Contents

 

NAME

mail_file - mail file(s) as attachments

 

SYNOPSIS

edrc/bin/mail_file [ -h ]

echo message | mail_file -s "subject" -t to [ -c carbon_copy ] [ -b blind_carbon_copy ] [ [ -d ] -a attachments ]

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

with mail_file a mail with a message content and file attachments can be sent with a single command.

The message content is received from stdin what enables easy script integration of the command.

In the configuration file mail_file.cfg can be configured if the mail should be sent locally, or if the mail should be sent from a remote (hub) system. It is possible to define a list of hosts that can be used as a hub. If the local host name is part of the list, the mail is sent locally; else the mail is sent from the first host in the hub list that is up.

 

OPTIONS

-h
usage message.

"subject"
subject of the mail to be sent.

-t to
comma separated list of mail recipients.

-c cc
comma separated list of carbon copy mail recipients.

-b bcc
comma separated list of blind carbon copy mail recipients.

-d
convert attachment file(s) to DOS.

-f from
sender address of the mail. The default sender address can be configured in the mail_file.cfg configuration file in the DEFAULT_SENDER setting.

-a attachments
space separated list of files to be attached to the mail.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

2
operating system is not supported yet. See osid(3) if you get this error.

3
specified attachment file does not exist.

4
usage printed.

5
command aborted pressing Ctrl+C.

6
configfile mail_file.cfg does not exist.

7
cannot connect to mail hub with remote_shell.

11
temporary directory could not be claimed or created in /tmp. Check the system temporary directory /tmp if you get this error, it is an indicator of system intrusion.

 

FILES

etc/mail_file.cfg
configuration file of mail_file, see mail_file.cfg(4) for more information.

 

EXAMPLES

1) send a file with a single line message:

echo "See logfile in attachment" | mail_file \
  -s "myApplication Logfile"   \
  -t "fred.flintstone@acme.com \
  -a quarry_moves.log

2) send a file with a multiple line message:

cat <<EOM | mail_file ...
  Hi Fred

  Please open the quarry move log in the attachment

  Regards
  Barney Boulder
EOM

 

SEE ALSO

edrcintro(1), mail_file.cfg(4), remote_shell(3), sendmail(8)

 

NOTES

mail_file uses the sendmail command internally to send the mail.

 

BUGS

-

 

AUTHOR

mail_file was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2009 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 00:14:12 GMT, March 08, 2025