How to tell "mail" program to use "Reply-To:" header?

How to tell "mail" program to use "Reply-To:" header?

Post by Marek Zawadzk » Fri, 09 Nov 2001 06:35:34



Hello All,

mail seems to only accept a "Subject" header (-s option), how do I tell it
to fill in a "Reply-To:" header (so people will use this instead of
"From:" to reply to me)?

I need to do it from the command line (a script).

Thanks for any help!!!

-marek

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by Alvin Sylva » Fri, 09 Nov 2001 16:36:57



> Hello All,

> mail seems to only accept a "Subject" header (-s option), how do I tell it
> to fill in a "Reply-To:" header (so people will use this instead of
> "From:" to reply to me)?

> I need to do it from the command line (a script).

> Thanks for any help!!!

> -marek

You might need to skip the "mail" program altogether, and go directly
to your sendmail process, depending on exactly what system you're on.

For example, many (if not most) UNIX systems have "/usr/lib/sendmail".
 You could set up a script to do the following:

Format a temporary file to contain the mail message ... say it's
called "/tmp/mail9999".

The format of the message should be something like (remove the "=="):




==Subject: Can we talk?
==
==This is the body of the message, separated from the header
==by a single empty line.  The body ends when the file ends.

Note that some systems will also require a "Message-ID:" header as a
way to detect spam, and there's a half dozen or more other interesting
headers you could stick in there, but the above should work in most
cases.

Also, in case it's not obvious, don't include the "==".  I only put
that in above to avoid getting ">From" in this particular message,
which many mail programs will stick in to avoid confusion with the
beginning of a new mail message.

Pass this file to "sendmail" with the command:

/usr/lib/sendmail -t < /tmp/mail9999

Your mileage may vary, depending on what program your system actually
uses (other than "sendmail"), the exact location of that program
(other than "/usr/lib"), etc.

Hope that helps!

:-)

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by Marek Zawadzk » Sun, 11 Nov 2001 00:45:31




> > Pass this file to "sendmail" with the command:

> > /usr/lib/sendmail -t < /tmp/mail9999

> > Your mileage may vary, depending on what program your system actually
> > uses (other than "sendmail"), the exact location of that program
> > (other than "/usr/lib"), etc.

> Typically on non sendmail systems, sendmail is a symbolic link to the
> actual MTA on your system. That MTA being sendmail syntax compatible,
> generally (I'd like to hear which major *nix MTAs are not?). So you
> should be alright.

>    lrwxrwxrwx    1 root     root            4 Jan 14  2001 /usr/sbin/sendmail -> exim

> My Debian GNU/Linux system uses Exim and that flag (-t) is understood by
> it:

> | exim(8)                                                  exim(8)
> |
> |
> | NAME
> |        exim - Mail Transfer Agent
> -snip-
> |        -t   When Exim is receiving  a    locally-generated,  non-
> |        SMTP  message  on the current input, the -t option
> |        causes the recipients of the message to be obtained
> |        from  the To:, Cc:, and Bcc: headers in the message
> |        instead  of  from the   command   arguments.   The
> |        addresses are extracted before any rewriting takes
> |        places.

>    John

> --
> John Bacalle  +++(updated: 2001/11/08)+++  f./vm. +1 212 894 3778 x1057 FN Gb
> FOR SALE: New OpenBSD 2.9 CDs.  New MCSE/WinNT 4-book set, new RHCE and DY Ol
> various new Linux books at a discount.  New aquaria protein skimmer, a  NP De
> word processor slash typewriter: <http://www.unixen.org/sale-main.html> YD ss

I don't think you've answered to *my* question (How to tell "mail" program
to use "Reply-To:" header). What a mess..

-marek

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by Marek Zawadzk » Sun, 11 Nov 2001 07:51:29




> > I don't think you've answered to *my* question (How to tell "mail"
> > program to use "Reply-To:" header). What a mess..

> Alvyn gave you one fine answer. Did that not work for you?

>    John

> --
> John Bacalle  +++(updated: 2001/11/08)+++  f./vm. +1 212 894 3778 x1057 FN Gb
> FOR SALE: New OpenBSD 2.9 CDs.  New MCSE/WinNT 4-book set, new RHCE and DY Ol
> various new Linux books at a discount.  New aquaria protein skimmer, a  NP De
> word processor slash typewriter: <http://www.unixen.org/sale-main.html> YD ss

I can't see any message from Alvyn at comp.mail.misc, except for the part
of it you quoted. Weird...:/ Maybe he sent a reply to a differnet group? I think my news-client is configured ok and have been working fine for months.

Could you please re-post it or send me a copy of Alvyn's article?

Thank You!!!

-marek

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by Jan Schauman » Sun, 11 Nov 2001 09:14:05



>  I can't see any message from Alvyn at comp.mail.misc, except for the
>  part of it you quoted. Weird...:/ Maybe he sent a reply to a differnet
>  group? I think my news-client is configured ok and have been working
>  fine for months.

>  Could you please re-post it or send me a copy of Alvyn's article?


It was psoted to comp.mail.misc and no other group and appeared as a
direct reply to your original message.  It explains in detail what to do
-- to summarize:  Alvin said (s)he wasn't aware of a way to add the
"Reply-To" header when using mail(1) and usggested creating the file by
hand and piping it to the sendmail command (or alike on
non-sendmail-systems).

As mail(1) reveals, there _is_ the "-a" switch, which allows you to add
custom-headers.  This does, however, NOT work with the Reply-To header.
On the other hand, mail(1), if read carefully tells you *also*, that
setting the environment variable REPLYTO will yield the result you wish to
achieve.

IOW:  RTFM. :)

-Jan

--
Jan Schaumann <http://www.netmeister.org>

Time is an illusion, lunchtime doubly so.

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by Jan Schauman » Mon, 12 Nov 2001 03:50:17



>  IOW:  RTFM. :)

Let the record show that TFM differs among platforms.  mail(1) ond Linux
is a bit more exhaustive than mail(1) on NetBSD.

Dammn, just when I thought I could actually use the good 'ole "RTFM" on
someone...

-Jan

--
Jan Schaumann <http://www.netmeister.org>

http://www.ncadp.org

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by Alvin Sylva » Tue, 13 Nov 2001 15:12:07





> > > Pass this file to "sendmail" with the command:

> > > /usr/lib/sendmail -t < /tmp/mail9999

> > > Your mileage may vary, depending on what program your system actually
> > > uses (other than "sendmail"), the exact location of that program
> > > (other than "/usr/lib"), etc.

> > Typically on non sendmail systems, sendmail is a symbolic link to the
> > actual MTA on your system. That MTA being sendmail syntax compatible,
> > generally (I'd like to hear which major *nix MTAs are not?). So you
> > should be alright.

> >    lrwxrwxrwx    1 root     root            4 Jan 14  2001 /usr/sbin/sendmail -> exim

[snip]

> I don't think you've answered to *my* question (How to tell "mail" program
> to use "Reply-To:" header). What a mess..

> -marek

I checked the "man" page on our Solaris system, and couldn't see any
way it could do it.  So, I figured maybe you'd like to have at least
*ONE* solution, if perhaps not the solution you were looking for.

I.e., I didn't think your problem was "getting 'mail' to do
something", but rather you wanted to "do something", and you thought
you could do it using "mail", and wanted to know how.  Seeing as how
(at least on Solaris) it *CAN'T* be done with "mail", I told you how
it can be done.

Let me know if you still need the exact text of my posting.  If you
can't find it using a search mechanism, I'll be happy to get it and
post it again!

As to it being a "mess", well, it's really not all that bad.  You
could easily write a shell script, call it "mymail", and have it
more-or-less emulate the essential features of "mail".  I.e., capture
the "From:" line, the "Reply-To:" line, the list of recipients, the
"Subject:" line, and the body of the message, format it, then pass it
to sendmail.  Take an experienced shell programmer maybe an hour,
including testing.  If you want *all* the features of the original
mail, then probably rather longer.

If you're trying to get users to use "mail" as an actual end-user
mail-tool, you're probably better off downloading "elm", "mutt",
"pine", etc., which are actually designed a little bit more with "real
people" in mind instead of programmers.  They tend to be
fully-featured, including dummying up whatever headers you happen to
need.

Plus they usually come with a "command line" mode that emulates the
syntax for "mail".  I.e., you can have a shell script command that
says,


and it will work just like "mail", including the "Reply-To:" if so
configured.

:-)

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by Mike O'Conno » Sun, 18 Nov 2001 22:34:49


You can configure the .mailrc to point sendmail to a script -- you
"set sendmail=/path/to/some/script".  Then you have the script be
something like:

#!/bin/sh
cat /file/with/your/headers/in/it - | /usr/sbin/sendmail $*

Make sure /file/with/your/headers/in/it contains your Reply-To:.

--

 Royal Oak, Michigan | (has my PGP & Geek Code info) | Phone: +1 248-427-4481
 =--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--=
"It seems like once people grow up, they have no idea what's cool."   -Calvin

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by David W. Tamk » Sun, 18 Nov 2001 23:41:30


[Yes, I know that this deals with a different question from the one that
 started the thread.]


| You can configure the .mailrc to point sendmail to a script -- you
| "set sendmail=/path/to/some/script" ...  something like:

| #!/bin/sh
| cat /file/with/your/headers/in/it - | /usr/sbin/sendmail $*

| Make sure /file/with/your/headers/in/it contains your Reply-To:.

One small tweak:

#!/bin/sh

There might be hard whitespace in one or more of the positional parameters.
Note the trailing hyphen in the cat command to pass the script's stdin
through to the pipe after the contents of the file; this is not a UUCA
situation.

 
 
 

How to tell "mail" program to use "Reply-To:" header?

Post by David W. Tamk » Sun, 18 Nov 2001 23:42:20



 [Yes, I know that this deals with a different question from the one that
  started the thread.]

Oops, what do you know; it was the same question.  I'd remembered wrong.
Sorry.

 
 
 

1. how to insert "Reply-to" header using UCB "mail"

    I use UCB mail (usually /usr/ucb/mail on Unix systems), and
am happy enough with it that I don't want to learn a new user
mail interface/program.

    However, when I send E-mail, I would like to have an appropriate
"reply-to" header line added, giving a more generic address than
whatever machine I happen to be on when I send the mail.

    I have figured out how to bludgeon the mailer into adding
header lines, by using the "sendmail" variable to use a script
that adds the desired header lines and pipes the modified message
into standard "sendmail".

However, this seems pretty kludgey to me,
    (not to mention that it requires explicit absolute paths,
    which have to be changed each time  my SAs decide that I
    should be on a different filesystem)
and so I wonder  if there is a better way.  Any ideas?

    Please send me E-mail; if enough people express an interest
(and I get a good answer), I will summarize for the net.

--

Courant Institute,NYU,USA     ...!cmcl2!cims.nyu.edu!mckenney   (UUCP)
Ob.Disclaimer: Even *I* don't take responsibility for what I post.
   NYU *definitely* doesn't, and, if challenged, would probably deny I wrote it.
--

Courant Institute,NYU,USA     ...!cmcl2!cims.nyu.edu!mckenney   (UUCP)
Ob.Disclaimer: Even *I* don't take responsibility for what I post.
   NYU *definitely* doesn't, and, if challenged, would probably deny I wrote it.

2. HP4M Dump Mode Escape Code

3. Pine 4.31, "Setup", "Config", ..., "?" gives "Illegal instruction"

4. Fonts in command prompt , can't see Hebrew

5. sendmail modifying "From" and "Reply-to" headers

6. Typer Speed

7. Reply To "From" Instead Of "Reply-To"???

8. ADT Question

9. extracting the "from" or "reply-to" field?

10. Changing "from" or "reply-to"?

11. Set "From" and "Reply-To" fields: how to?

12. "Reply-To" and "From" fields in Sendmail 8.8.8

13. rewriting "From:" and/or inserting "Reply-To:"