-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup-postfix.sh
47 lines (30 loc) · 1004 Bytes
/
setup-postfix.sh
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
#!/bin/sh
#
# This script will configure postfix for email to fax
# Only run once
#
. email2fax.txt
# INSTALL REQUIRED APPS IF NOT ALREADY INSTALLED
echo "Installing required packages"
yum -y install postfix || yast --install postfix || apt-get install postfix
# CONFIGURE POSTFIX
/sbin/service postfix stop
echo "Configuring Email to FAX for domain ${FAXDOMAIN}"
cat >> /etc/postfix/master.cf << EOF
fax unix - n n - 1 pipe
flags= user=$FAXMAILUSER argv=/usr/bin/faxmail -d -n -NT \${user}
EOF
echo -e "${FAXDOMAIN}\tfax:localhost" >> /etc/postfix/transport
echo -e "transport_maps = hash:/etc/postfix/transport\nfax_destination_recipient_limit = 1" >> /etc/postfix/main.cf
postmap /etc/postfix/transport
# CONFIGURE FAXMAIL
cat > /etc/hylafax/faxmail.conf << EOF
AutoCoverPage: false
TextPointSize: 12pt
Headers: Message-id Date Subject From
MailUser: $FAXMAILUSER
EOF
/sbin/chkconfig postfix on
/sbin/service postfix start
echo "Done"
# DONE #