File: mailfax.sh-sendmail

package info (click to toggle)
hylafax 2%3A6.0.5-4.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 8,776 kB
  • ctags: 7,663
  • sloc: sh: 15,158; ansic: 13,231; makefile: 1,543; cpp: 781; awk: 529
file content (60 lines) | stat: -rwxr-xr-x 2,918 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/bash
#
# mailfax - email to fax gateway for sendmail
#
# This file should be installed as /usr/local/lib/fax/mailfax
# (or whatever is specified in the sendmail.cf file).
#
# Edit your sendmail configuration.  Include the following
# mailer definition (or similar):
# 
# Mfax,	P=/usr/local/lib/fax/mailfax, F=DFMShu, M=100000,
# 	A=mailfax $u $h $f
# 
# add the following address rewriting rule to rule set 0:
# 
# # forward FAX messages to HylaFAX software
# R$+<@$+.FAX>		$#fax $@ $2 $: $1		user@host.FAX
#
# and arrange things so that rule set 3 will not attempt a host map lookup
# on FAX addresses.  If you are using the .cf file generated by the
# m4 macros as your starting point (as implemented in sendmail 8.8.8),
# this can be done by adding these lines:
# 
# # Make FAX a pseudo domain, to avoid failed DNS lookups
# CPFAX
#
# Things to note:
#
# 1. The above mailer definition includes the S flag which causes
#    sendmail to invoke this script with the UID of the sender when
#    mail is local.  This causes the submitted facsimile job to be
#    owned by the sender which means they can remove it, alter its
#    parameters, etc.  Mail received from another system will be
#    owned by the user who's UID is specified in the sendmail config
#    file as the default UID to use for doing delivery.  Typically
#    this is daemon or similar.  Whatever user it is, they must be
#    permitted to submit facsimile jobs w/o a password from the host
#    where this script is run.
# 2. The default setup below disables automatic cover page generation.
#    If you enable it, faxmail will extract the name of the receipient
#    from the To: header.  This is preferable to passing in the "user"
#    information in the mail address (readily available from sendmail)
#    since ``more friendly'' information may be available in the To:
#    line in the form of a comment; e.g. To: joe@15551212.fax (Joe Schmo)
#    would result in ``Joe Schmo'' being displayed on the cover page.
# 3. If automatic cover page generation is to be used it is probably
#    a good idea to create a special-purpose cover page template for
#    facsimile generated though this gateway.  By default faxmail will
#    use the default system cover page template.  An X-FAX-Cover-Template
#    header line may also be inserted to select a cover page template file.
# 4. Enabling a gateway facility with the scheme described here permits
#    anyone to submit a facsimile if non-local submissions are accepted.
#    Read the faxmail(1) manual page for some comments on extending
#    the software to safely restrict off-machine submissions.
# 5. The most effective use of this software involves inserting special
#    headers that indicate how faxmail and the rest of the HylaFAX
#    software should process the submitted facsimile.  Consult the
#    faxmail documentation for details.
#
/usr/local/bin/faxmail -n -d "$1" "$2"