Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 628
  • Last Modified:

altering sendmail From field

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
linas
Asked:
linas
  • 2
1 Solution
 
ahoffmannCommented:
have you tried the  Cw  and  Dw  settings?
0
 
ahoffmannCommented:
use the  Dl  macro, for example:

DlFrom $g  $d

(assumed that $g is set up to your desires)
0
 
linasAuthor Commented:
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
 
adsoCommented:
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now