LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-25-2003, 06:06 PM   #1
ew0kian
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Rep: Reputation: 0
sendmail


running redhat9, trying to get sendmail to use joe@domain.com instead of joe@machine.domain.com as the from address.

any ideas on how to modify my mc file?

divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl # make -C /etc/mail
dnl #
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
dnl #
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
dnl define(`SMART_HOST',`smtp.your.provider')
dnl #
define(`confDEF_USER_ID',``8:12'')dnl
define(`confTRUSTED_USER', `smmsp')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl #
dnl # The following allows relaying if the user authenticates, and disallows
dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
dnl #
dnl define(`confAUTH_OPTIONS', `A p')dnl
dnl #
dnl # PLAIN is the preferred plaintext authentication method and used by
dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
dnl # use LOGIN. Other mechanisms should be used if the connection is not
dnl # guaranteed secure.
dnl #
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl #
dnl # Rudimentary information on creating certificates for sendmail TLS:
dnl # make -C /usr/share/ssl/certs usage
dnl #
dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
dnl #
dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
dnl # slapd, which requires the file to be readble by group ldap
dnl #
dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekeyfile')dnl
dnl #
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
dnl #
dnl # The -t option will retry delivery if e.g. the user runs over his quota.
dnl #
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 465, but
dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
dnl #
dnl # For this to work your OpenSSL certificates must be configured.
dnl #
dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl #
dnl # The following causes sendmail to additionally listen on the IPv6 loopback
dnl # device. Remove the loopback address restriction listen to the network.
dnl #
dnl # NOTE: binding both IPv4 and IPv6 daemon to the same port requires
dnl # a kernel patch
dnl #
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl #
dnl # We strongly recommend not accepting unresolvable domains if you want to
dnl # protect yourself from spam. However, the laptop and users on computers
dnl # that do not have 24x7 DNS do need this.
dnl #
FEATURE(`accept_unresolvable_domains')dnl
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl #
dnl # Also accept email sent to "localhost.localdomain" as local email.
dnl #
LOCAL_DOMAIN(`localhost.localdomain')dnl
dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #

FEATURE(`genericstable',`hash - /etc/mail/genericstable.db')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE('masquerade_entire_domain')dnl
GENERICS_DOMAIN(`computername')dnl
GENERICS_DOMAIN(`computername.domain.com')dnl
GENERICS_DOMAIN(`localhost')dnl
GENERICS_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(`domain.com')dnl
MASQUERADE_DOMAIN(`domain.com')dnl









dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
dnl FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
 
Old 07-25-2003, 10:07 PM   #2
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Did you even bother to read what it says in the configuration file?

What does it say in the file?

dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #


Since you will not be using it, comment out with dnl # at the beginning of the line

FEATURE(`genericstable',`hash - /etc/mail/genericstable.db')dnl

comment out the lines

FEATURE('masquerade_entire_domain')dnl
GENERICS_DOMAIN(`computername')dnl
GENERICS_DOMAIN(`computername.domain.com')dnl
GENERICS_DOMAIN(`localhost')dnl
GENERICS_DOMAIN(`localhost.localdomain')dnl

change

MASQUERADE_AS(`domain.com')dnl

to

MASQUERADE_AS(`your_actual_real_domain_name.com')dnl

where you_actual_real_domain_name is changed to
whatever your actual real domain name really is

change

MASQUERADE_DOMAIN(`domain.com')dnl

to

MASQUERAGE_DOMAIN(`name_of_your_machine.your_actual_real_domain_name.com')dnl

where name_of_your_machine and your_actual_real_domain_name
are changed to whatever is your real machine name and your actual
reall domain name.

And to get the hostname removed from the envelope as well,
you remove the comment marker dnl from the beginning of the line with

FEATURE(masquerade_envelope)dnl

And that is it.

For a proper understanding of the functionality of the macros
try reading

/usr/share/doc/sendmail/README.cf


I hope this helps you on your way to configuring sendmail.

Last edited by Corin; 07-25-2003 at 10:12 PM.
 
Old 07-26-2003, 01:08 PM   #3
ew0kian
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Original Poster
Rep: Reputation: 0
hi corin,

i made the changes you suggested (just so you know im not a complete idiot, domain.com was my actual domain i just changed it for the purposes of the post) and restarted sendmail. unfortunately it didn't solve the problem... its still showing up as joe@machinename.domain.com when i send a message using the "mail toaddress" command.

if you have any further ideas i would greatly appreciate it. have a nice day
 
Old 07-26-2003, 01:14 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Did you regenerate it? Sendmail doesn;t read the mc file it reads the cf file.
 
Old 07-26-2003, 01:24 PM   #5
ew0kian
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Original Poster
Rep: Reputation: 0
i ran the command at the top of the config file:


[root@computer mail]# make -C /etc/mail
make: Entering directory `/etc/mail'
make: Leaving directory `/etc/mail'


and then i restarted sendmail.. is that wrong?
 
Old 07-26-2003, 01:30 PM   #6
ew0kian
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Original Poster
Rep: Reputation: 0
hmm i just realized that /usr/share/sendmail-cf doesn't even exist on my box. i guess i need to install sendmail-cf
 
Old 07-26-2003, 01:32 PM   #7
ew0kian
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Original Poster
Rep: Reputation: 0
where should i download the correct rpm for sendmail-cf if im using redhat9?
 
Old 07-26-2003, 01:34 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
ftp://fr.rpmfind.net/linux/redhat/9/...2.8-4.i386.rpm
 
Old 07-26-2003, 01:54 PM   #9
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
To regenerate teh sendmail.cf you're editing /etc/mail/sendmail.mc yah?

then

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Never used the sendmail.mc way of doing things although I know I should, I just edit manually....changing to Dj then whatever your domain is.



# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
Djmydomain.com
 
Old 07-26-2003, 06:50 PM   #10
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
BTW in the original question you only asked about modifying the sendmail.mc, not about how to generate a new sendmail.cf :+)

And assuming that you do finally get the sendmail.cf correctly generated (and you should stick to the sendmail.mc method for the sake of safety), try sending a message with

sendmail -v $USER
this is a test of the sendmail mailer
.

^ just a period at beginning of the line followed by <CarriageReturn>

You should see some verbose messages about how the mail headers are being processed.
 
Old 07-29-2003, 04:06 PM   #11
ew0kian
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Thank you so much everyone, got it working
 
Old 07-30-2003, 04:37 AM   #12
Skute
Member
 
Registered: Jul 2003
Distribution: SUSE 9.0 Pro
Posts: 45

Rep: Reputation: 15
Im having a similar problem, ive downloaded the necessary files (sendmail + sendmail-cf) from the redhat site but when i try to run the build command i get the following errors at the end:

make[2]: cc: Command not found
make[2]: *** [assert.o] Error 127
make[2]: Leaving directory `/usr/src/redhat/SOURCES/sendmail-8.12.8/obj.Linux.2.4.20-19.9.i686/libsm'
make[1]: *** [/usr/src/redhat/SOURCES/sendmail-8.12.8/obj.Linux.2.4.20-19.9.i686/libsm/libsm.a] Error 2
make[1]: Leaving directory `/usr/src/redhat/SOURCES/sendmail-8.12.8/obj.Linux.2.4.20-19.9.i686/vacation'
make: *** [all] Error 2



I cant work out why it wont build properly. Im just trying to change the domain name, but i cant even do the direct method of m4 /etc... > /etc.... because i dont have sendmail-cf installed.
 
Old 07-30-2003, 10:04 AM   #13
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Quote:
Originally posted by Skute
Im having a similar problem, ive downloaded the necessary files (sendmail + sendmail-cf) from the redhat site but when i try to run the build command
The build command? Which command is that?

Can you please tell us the exact command you entered?

Quote:
because i dont have sendmail-cf installed.
So why do you not just download the sendmail-cf rpm package from RedHat, run rpm -Uvh sendmail-cf-whatever.rpm to install it?

Then, once it is installed, edit the sendmail.mc file as per instructions above.

cd /etc/mail

make clean

make

and the Makefile there will invoke the m4 pre-processor on the sendmail.mc file to create a new sendmail.cf file for you.
 
Old 07-30-2003, 10:07 AM   #14
Skute
Member
 
Registered: Jul 2003
Distribution: SUSE 9.0 Pro
Posts: 45

Rep: Reputation: 15
i dont know why but i got the redhat rpm and one compilation there were some errors. but i got the source package from sendmail.org and it worked fine.

i can make all the changes i need now.


----


the only problem i still have is that sendmail is extremely slow when sending mail now. i have a feeling its the DNS lookups. is there feature i can enable to stop this delay? before emails where instant, now it takes 20seconds per email to send!

thanks
 
Old 07-30-2003, 02:25 PM   #15
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Yup delays with things like sendmail, telnet or whatever are due to DNS errors waiting for a timeout on a reply to a query which never arrives.

It is not a question of trying to enable or disable something in sendmail
but a question of fixing the DNS.

Are you the administator for your domain?

First of all you need to check what you have in your /etc/resolv.conf and also /etc/nnswitch.conf. Then it is a question of checking your /etc/named.conf
file and your zone files.

A very useful thing to have for this sort of job is the O'Reilly book
"DNS & Bind".

A usual scenario of DNS timeouts is when the DNS queries are being sent
to a remote server rather than the local one.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail ignores my sendmail smarthost entry Paul_assheton Linux - General 1 03-17-2009 07:55 AM
FC4 and Sendmail - Cannot create sendmail.pem Balderayne Linux - Security 2 11-09-2005 02:55 PM
php+ sendmail no good - python + sendmail ok nephish Linux - Networking 1 10-07-2005 01:19 PM
Sendmail - RunAsUser=sendmail:mail/What files to i have to change ForumKid Linux - Security 45 01-18-2002 11:47 AM
sendmail (dont just ignore it 'cause its got sendmail in the subject :P) GnomeKing Linux - Networking 1 11-12-2001 09:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration