Admin/pmail
changeset 14036 fb6040d4bbf8
parent 14034 55ba81e3502b
child 14981 e73f8140af78
equal deleted inserted replaced
14035:c46ce87960fb 14036:fb6040d4bbf8
    37 {
    37 {
    38     local FILE=$1
    38     local FILE=$1
    39     local NAME=${FILE##*/}
    39     local NAME=${FILE##*/}
    40 
    40 
    41     cat <<EOF
    41     cat <<EOF
    42 $MIME_BOUNDARY
    42 --$MIME_BOUNDARY
    43 Content-Type: text/plain
    43 Content-Type: text/plain
    44 Content-Transfer-Encoding: 8bit
    44 Content-Transfer-Encoding: 8bit
    45 Content-Disposition: attachment; filename="$NAME"
    45 Content-Disposition: attachment; filename="$NAME"
    46 
    46 
    47 EOF
    47 EOF
    48     cat $FILE
    48     cat $FILE
       
    49     echo
    49 }
    50 }
    50 
    51 
    51 
    52 
    52 #
    53 #
    53 # print_body subject <message-file> [<attachments>]
    54 # print_body subject <message-file> [<attachments>]
    63     cat <<EOF
    64     cat <<EOF
    64 Subject: $SUBJECT
    65 Subject: $SUBJECT
    65 Mime-Version: 1.0
    66 Mime-Version: 1.0
    66 Content-Type: multipart/mixed; boundary="$MIME_BOUNDARY"
    67 Content-Type: multipart/mixed; boundary="$MIME_BOUNDARY"
    67 
    68 
    68 $MIME_BOUNDARY
    69 --$MIME_BOUNDARY
    69 Content-Type: text/plain
    70 Content-Type: text/plain
    70 Content-Transfer-Encoding: 8bit
    71 Content-Transfer-Encoding: 8bit
    71 
    72 
    72 EOF
    73 EOF
    73     cat $BODY
    74     cat $BODY
       
    75     echo
    74 
    76 
    75     for a in $@; do print_attachment $a; done
    77     for a in $@; do print_attachment $a; done
    76 
    78 
    77     echo "$MIME_BOUNDARY"
    79     echo "--$MIME_BOUNDARY--"
       
    80     echo 
    78 }
    81 }
    79 
    82 
    80 ## main
    83 ## main
    81 
    84 
    82 # argument checking
    85 # argument checking