#
# Check for missing or empty subjects:
#
ERRORS_TO="my.email@domain.com"
SUBJECT=`formail -xSubject: | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
:0 c:
* SUBJECT ?? ^^^^
| formail -I "Status: R" >>${MAILDIR}/noSubject
:0 A
|( formail -brkt -I"From: RT Ticket System <ticket-address@domain.com>" \
   -I"Bcc: $ERRORS_TO" \
   -I"Subject: RT email ticket rejected - NO SUBJECT."; \
   echo "-------- RT Message --------"; \
   echo "Your email ticket request will NOT be processed without a subject."; \
   echo "Please include a subject in your email message above and resend it." \
) | $SENDMAIL -oi -t
:0 c:
* SUBJECT ?? \(no subject\)
| formail -I "Status: R" >>${MAILDIR}/noSubject
:0 A
|( formail -brkt -I"From: RT Ticket System <ticket-address@domain.com>" \
   -I"Bcc: $ERRORS_TO" \
   -I"Subject: RT email ticket rejected - NO SUBJECT."; \
   echo "-------- RT Message --------"; \
   echo "Your email ticket request will NOT be processed without a subject."; \
   echo "Please include a subject in your email message above and resend it." \
) | $SENDMAIL -oi -t


