Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendmail configuration (getting rid of localhost)

Status
Not open for further replies.

patrick99e99

Technical User
Apr 1, 2006
17
US
Hi,

I was just curious, can anyone help me configure my sendmail so that when I send mail from the commandline it does not show up from localhost? ISPs like aol automatically block all of my mail...

I am using mac os x 10.4, and I currently have my computer online accessable as a subdomain to my regular domain.

-patrick
 
Edit your sendmail.mc and add
Code:
MASQUERADE_AS(`[b]qualifieddomain.com[/b]')dnl
FEATURE(`masquerade_envelope')dnl
Then use m4 to rebuild the sendmail.cf
Code:
% m4 /path/to/sendmail.mc > /path/to/sendmail.cf

M. Brooks
 
Hmm.. I have searched my entire computer and I somehow do not have a .mc or .cf file...

rufus[patrick] /> sudo find /. -name sendmail*
/./Applications/Macromedia Dreamweaver MX/Configuration/TagLibraries/JRun/sendmail.htm
/./Applications/Macromedia Dreamweaver MX/Configuration/TagLibraries/JRun/sendmail.vtm
/./System/Library/Perl/Extras/5.8.6/Mail/Mailer/sendmail.pm
/./usr/lib/php/Mail/sendmail.php
/./usr/sbin/sendmail
/./usr/share/emacs/21.2/lisp/mail/sendmail.el
/./usr/share/emacs/21.2/lisp/mail/sendmail.elc
/./usr/share/man/man1/sendmail.1
rufus[patrick] />

any suggestions?

-patrick
 
Have you looked in the /etc/mail directory? Keep looking, it has to be somewhere. Sendmail needs at least the sendmail.cf file.
 
I actually have no mail directory in /etc...

is this a problem?

-patrick
 
On the command line do
Code:
% whereis sendmail
If this fails to find anything then you are not using Sendmail as an MTA.

M. Brooks
 
rufus[patrick] ~> whereis sendmail
/usr/sbin/sendmail

but I looked there are no directories there.. only executable programs and symbolic links.

-p
 
What flavor of linux are you running. A lot of times you can go to the distributor's website and find what you need in their FAQs or forums. Another thing you might try is look in /usr/share/sendmail-cf and see if you can find a README file. This file usually has all the file locations sendmail uses. However, if you are running somw whacked out version, they may have changed that directories location also.
 
can't I just download a new version of sendmail and reinstall it to my ~/bin and use that instead of the one in usr/bin?
 
Hmm.. Ok, I downloaded sendmail, and read through all the readme files..

1. I went into the sendmail directory and did sh Build.

2. I went into the cf/cf directory and copied the generic-bsd4.4.mc as sendmail.mc-- Then I added these two lines to this file:

MASQUERADE_AS(`rufus.collinatorstudios.com')dnl
FEATURE(`masquerade_envelope')dnl

3. I did "m4 sendmail.mc > sendmail.cf"

4. I then went into the sendmail directory and did make, and then sudo make install.

I then had an /etc/mail folder, however, only a submit.cf file was there.. I did I test email, it worked, but my headers still showed localhost.. So I tried making another sendmail.cf again with:

MASQUERADE_AS(`rufus.collinatorstudios.com')dnl
FEATURE(`masquerade_envelope')dnl

I ran m4 and put the new sendmail.cf in the /etc/mail folder.

ran sendmail did another test.. same thing..

My headers show:

Received: from rufus (localhost [127.0.0.1])
by rufus.localhost (Postfix) with ESMTP id 95840921600

and

Received: (from patrick@localhost)
by rufus (8.13.8/8.13.8/Submit) id kB82RGv2018276

did I do something wrong?

-patrick
 
divert(-1)
#
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#

#
# This is a generic configuration file for 4.4 BSD-based systems,
# including 4.4-Lite, BSDi, NetBSD, and FreeBSD.
# It has support for local and SMTP mail only. If you want to
# customize it, copy it to a name appropriate for your environment
# and do the modifications there.
#

divert(0)dnl
VERSIONID(`$Id: generic-bsd4.4.mc,v 8.10 1999/02/07 07:26:02 gshapiro Exp $')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
MAILER(smtp)dnl
MASQUERADE_AS(`qualifieddomain.com')dnl
FEATURE(`masquerade_envelope')dnl
 
sorry that was obviously wrong.. should read at the end:

MASQUERADE_AS(`rufus.collinatorstudios.com')dnl
FEATURE(`masquerade_envelope')dnl

-patrick
 
Do you have postfix running? Call me crazy but it is acting like you have postfix emulating sendmail. That is why none of the sendmail files existed.
 
Hmm I checked into that..

rufus[patrick] /System/Library/LaunchDaemons> sudo service smtp stop
postfix/postfix-script: stopping the Postfix mail system


But then I sent myself another sendmail test and I received it.. The headers still say "postfix" and show:

Received: from rufus (localhost [127.0.0.1])
by rufus.localhost (Postfix) with ESMTP id C49BA922181
Received: (from patrick@localhost)
by rufus (8.13.8/8.13.8/Submit) id kB8JC3Lg019611
 
Well there's nothing in the world you can do to sendmail to make postfix work. ;-)

 
I'm sorry, I dont quite understand what you mean. I don't know a whole lot about postfix or sendmail...

So, are you saying that my headers should not be saying postfix?

It could be that my mailserver is receiving them with postfix?

because my header shows this:
Received: from spawn.easydns.com (smtp.easydns.com [205.210.42.52])
by star.collinatorstudios.com (Postfix) with ESMTP id 5CC96FF064

and star is my mailserver (a gentoo linux box).. I am really not sure how all this works. But I know for certain I ran the command to stop postfix, and I checked my activity monitor (top) and I saw nothing having to do with postfix running...

but the second received heading my email says:

Received: from rufus.localhost (pool-71-106-138-34.lsanca.dsl-w.verizon.net
[71.106.138.34])
by spawn.easydns.com (Postfix) with ESMTP id 2A1EC4E930


and there are two other 'received headers'.. which leads me to ask this question-- why are there four "received:" headers?

-patrucj
 
Postfix is a mail server just like sendmail. You are running postfix. Most 'other' mail servers emulate sendmail so that they can be used by existing scripts without having to be changed. What I was saying is that you should be asking this in the postfix forum, not sendmail. If you prefer sendmail, you will need to keep postfix from starting at bootup and have sendmail start in it's place. In my opinion, that would be a lot of work just to get 'localhost' out of your header.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top