Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: subject in sendmail  (Read 5063 times)

0 Members and 1 Guest are viewing this topic.

mstiles

  • Guest
subject in sendmail
« on: January 08, 2007, 03:14:07 AM »
Does anyone know how to pass a "subject" through sendmail?

Thanks,
Michelle.

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: subject in sendmail
« Reply #1 on: January 10, 2007, 01:37:27 AM »
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.
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

mstiles

  • Guest
Re: subject in sendmail
« Reply #2 on: January 10, 2007, 02:18:18 AM »
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.

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: subject in sendmail
« Reply #3 on: January 10, 2007, 02:20:19 AM »
No problem - that was going to be my next suggestion if you felt you had to use sendmail.  ;D
« Last Edit: January 10, 2007, 02:20:34 AM by robpomeroy »
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos