Solved

altering sendmail From field

Posted on 1997-07-11
4
600 Views
Last Modified: 2013-12-26
I would like to alter the value of the From field that
sendmail uses.  Note that this is NOT the From: field (with the colon), it is the one without the colon, the one that is supplied with the SMTP MAIL FROM command.

I am running sendmail v 8.8.5-4 (the latest) and have tried
all sorts of things in /etc/sendmail.cf: setting
DM (masquerading)
CM  (some class)
O UnixFromLine=From bilbo@bogus.com $d
O SmtpGreetingMessage=blag@blorg.com Sendmail $v/$Z; $b
Dj$w.Foo.COM

none of these seem to make the smallest difference; in all cases, sendmail identifies the actual host, instead of using the masqueraded name.  What can I do?

0
Comment
Question by:linas
  • 2
4 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1293952
have you tried the  Cw  and  Dw  settings?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1293953
use the  Dl  macro, for example:

DlFrom $g  $d

(assumed that $g is set up to your desires)
0
 
LVL 1

Author Comment

by:linas
ID: 1293954
In the V7/Berkeley format for sendmail.cf (version 8.8.5) the
$l macros are replaced by the
O UnixFromLine=From $g $d
line.  

I tried the old-style format suggested above; neither DlFrom
nor the new O UnixFromLine seem to make any difference ...

0
 

Accepted Solution

by:
adso earned 200 total points
ID: 1293955
I would advise you to generate the .cf using m4 from templates
supplied with sendmail distribution (in the cf subdirectory).
Here is what you should do:

1) Create a domain file (e.g. foo.m4) in cf/domain containing lines
FEATURE(masquerade_envelope)dnl # This is the main point
MASQUERADE_AS(foo_bar_baz)dnl
(you may want other features, have a look at files in cf/domain)

2) create a file foo-system.mc in the cf/cf directory saying
divert(0)dnl
OSTYPE(solaris2)dnl
DOMAIN(mimuw.hidden)dnl
MAILER(local)dnl
MAILER(smtp)dnl
(substituting your system for solaris2)

3) generate the .cf according to docs, i.e. by
m4 ../m4/cf.m4 foo-system.mc > foo.cf
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 94
repeateFront java challenge 31 94
ORA-01403: no data found 43 105
iSeries DB2 Query 2 97
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question