Solved

altering sendmail From field

Posted on 1997-07-11
4
611 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

726 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