1.

Solve : subject in sendmail?

Answer»

Does anyone know how to pass a "subject" through sendmail?

Thanks,
Michelle.
How do you mean?  Are you trying to pipe a message through the sendmail command?  Why not try "mail" instead.  It has a much easier command line switches:

Code: [Select]MAIL(1)                  BSD General Commands Manual                  MAIL(1)

NAME
     mail - send and receive mail

SYNOPSIS
     mail [-iInv] [-s subject] [-c cc-addr] [-B bcc-addr] to-addr...
     mail [-iInNv] -f [name]
     mail [-iInNv] [-u user]

INTRODUCTION
     Mail is an intelligent mail processing system, which has a command syn-
     tax reminiscent of ed(1) with lines replaced by MESSAGES.

     -v    Verbose mode.  The details of delivery are displayed on the userâs
           terminal.

     -i    Ignore tty interrupt signals.  This is particularly useful when
           using mail on noisy phone lines.

     -I    Forces mail to run in interactive mode even when input isnât a
           terminal.  In particular, the â~â special character when SENDING
           mail is only active in interactive mode.

     -n    Inhibits reading /etc/mail.rc upon startup.

     -N    Inhibits the initial display of message headers when reading mail
           or editing a mail folder.

     -s    Specify subject on command line (only the first argument after the
           -s flag is used as a subject; be careful to quote subjects con-
           taining spaces.)

     -c    Send carbon copies to list of users.

     -b    Send blind carbon copies to list.  List should be a comma-sepa-
           rated list of names.

     -f    Read in the contents of your mbox (or the SPECIFIED file) for pro-
           cessing; when you quit, mail writes undeleted messages back to
           this file.

     -u    Is equivalent to:

                 mail -f /var/spool/mail/user

Etc.Hi,
Thanks for that, but I was using sendmail as I run it within a shell script to send a file through our MS Exchange server to Outlook users as a scheduled job.  Unfortunately our so called "Intelligent Message Filter" on the Exchange server was treating the unix MAILS as spam, but if I specify a subject I can use a custom weighting xml file to change the weighting of the unix emails based on the specified subject.

We found that you can create a header file containing the fields -

To:
Date:
From: and
Subject:

within unix, so I've created one containing the addresses of my recipients and the subject containing a word that's allowed through my content filter list, and I basically cat this header file onto the start of the file I'm sending the users each time, and run it using /usr/lib/sendmail -t < joinedfile

Thanks for looking into if for me though,
Michelle.No problem - that was going to be my next suggestion if you felt you had to use sendmail.



Discussion

No Comment Found