Solved

Setting up sendmail.

Posted on 2001-07-04
13
405 Views
Last Modified: 2013-12-15
I has been some years since I last run sendmail so I have forgot all things that I might want to change in the config-file.

I want to set up a mail server for my-domain.com

* I want the server to masquerade all mails that are sent as they are comming from mydomain.com (the servers domainname is mail.mydomain.com)

* How do I set up which domains to recive mail for?

* how do I set the limit of the size of the mail to say 700MB ( I know... it's a bad idea)

* How do I set up which host's that should be able to use the server. (allow relay)

What Have I forgot now? Any tip on what I need to change for the default config to get sendmain safer?

* Yes... Now I remember the most important thing.

I like all mail's coming to a non exsistent user to be sent to hulken@mydomain.com (no MAILERDEAMON message)



0
Comment
Question by:hulken
  • 5
  • 3
  • 3
  • +2
13 Comments
 
LVL 15

Accepted Solution

by:
samri earned 200 total points
ID: 6252744
hulken,

First of all, you need to download the Sendmail source from Sendmail's website.

http://www.sendmail.org

The latest is 8.11.4
http://www.sendmail.org/8.11.html

uncompress it and compile it.

More information: http://www.sendmail.org/compiling.html

and then install it.  By default the sendmail binary will go to /usr/lib

After that you need to generic the sendmail.cf (Sendmail's configuration file).

go to ./cf/cf directory
and create a working mc file.  You can start by copying from an existing mc.  For example, if your machine is solaris2, then start with generic-solaris2.mc (I'm not sure about the exact file name).  Copy it to some files like config.mc

---some portion of the file.
#  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-solaris2.mc,v 8.11 1999/02/07 07:26:03 gshapiro Exp $')
OSTYPE(solaris2)dnl
DOMAIN(generic)dnl
DEFINE(confMAX_MESSAGE_SIZE,`734003200')
MASQUERADE_AS(my-domain.com)
FEATURE(masquerade_envelope)
FEATURE(masquerade_entire_domain)
FEATURE(`use_cw_file')
FEATURE(access_db)
FEATURE(rbl)
MAILER(local)dnl
MAILER(smtp)dnl

------

more on Anti-Relaying: http://www.sendmail.org/tips/relaying.html

More information can be obtained from sendmail's website or www.sendmail.net.

On redirecting mail for MAILER-DAEMON, I guess you can create an alias entry that points back to you:

postmaster: hulken@my-domain.com

Give it a shot.  I guess this should gets you going.

good luck.
0
 
LVL 1

Expert Comment

by:auther_bin
ID: 6253006
1.
In /etc/sendmail.cf config all the Items like:
----------------
# who I masquerade as (null for no masquerading) (see also $=M)
DMmail.mydomain.com
----------------
2.
In file: /etc/mail/mailertable, add a line like:

.mail.domain.com relay
mail.domain.com relay

3.
In file: /etc/sendmail.cf change the count in nextline:)
# maximum message size
O MaxMessageSize=1000000

4.Just like answer 2 in file: /etc/mail/mailertable add the host in it.

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6975968
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if they are still open in 14 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20102072.html
http://www.experts-exchange.com/questions/Q.20103849.html
http://www.experts-exchange.com/questions/Q.20145561.html
http://www.experts-exchange.com/questions/Q.20169449.html
http://www.experts-exchange.com/questions/Q.20169478.html
http://www.experts-exchange.com/questions/Q.20172645.html
http://www.experts-exchange.com/questions/Q.20177672.html
http://www.experts-exchange.com/questions/Q.20180896.html
http://www.experts-exchange.com/questions/Q.20189306.html
http://www.experts-exchange.com/questions/Q.20192697.html
http://www.experts-exchange.com/questions/Q.20193626.html
http://www.experts-exchange.com/questions/Q.20195237.html
http://www.experts-exchange.com/questions/Q.20244812.html
http://www.experts-exchange.com/questions/Q.20246719.html
http://www.experts-exchange.com/questions/Q.20261121.html
http://www.experts-exchange.com/questions/Q.20261146.html
http://www.experts-exchange.com/questions/Q.20269349.html
http://www.experts-exchange.com/questions/Q.20274432.html
http://www.experts-exchange.com/questions/Q.20289956.html

To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20181754.html
http://www.experts-exchange.com/questions/Q.20245940.html
http://www.experts-exchange.com/questions/Q.20253492.html

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @14 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 15

Expert Comment

by:samri
ID: 6976115
7/4/2001 : This looks like another lost soul :)

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6979075
hulken -->  You logged in today again, and chose not to respond.  Sorry to see that, so I finalized this today.

Moondancer - EE Moderator
0
 

Author Comment

by:hulken
ID: 6986006
I still have not got an answer for my point 5 that I wrote was the MOST IMPORTANT THING! (se abowe)

I don't undeerstand you when You mark my question as answerd and accepted when I have not got a answer on the thing that I write is THE MOST IMPORTANT THING!

Btw. it seem like half of the mail about someone have comment/answered my questions never reach me. Do you have some tecnical problems with this? It's not so strange that I don't comment a question if I don't get any mail about it. (I don't mean this question because I don't think you are fair to me right now. I especialy wrote what I considered as most importent and not got any answer on that and you steel my points anyway.
 
I thought you guys was fair but It seems like I was wrong.
:-(


>* Yes... Now I remember the most important thing.

>I like all mail's coming to a non exsistent user to be >sent to hulken@mydomain.com (no MAILERDEAMON
>message)

0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

Author Comment

by:hulken
ID: 6986012
If I especially write that something is the most important thing I don't think that I have to adds any comments when I don't have got any answer for that.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6986217
We are always trying to be very fair here, hulken.

Since you obviously have bad feelings here, I have added 200 points to your available points, so the help given here and the points awarded were FREE to you.  Easy questions begin at a value of 50 points, you essentially asked 5 questions within this and the first 4 were given to you more than NINE MONTHS ago, with no feedback from you whatsoever.  This is not what this site is about.  Any question regardless of the context which is "inactive" for 21 days or longer is considered abandoned.

Feel free to post it again to get your "most important 5th question point answered", or not.  Your choice.

Click your member profile please and make sure you have only one and the correct Email address listed there, also verify your address information, etc. to ensure they are correct.  If all of that is correct and you still encounter problems, post a zero point question in the Community Support topic area so we can help you further.

Feel free to Email Administration at ComTech@experts-exchange.com if you continue to feel that this site is anything less than excellent!

Moondancer - EE Moderator
0
 
LVL 15

Expert Comment

by:samri
ID: 6986481
Hulken,

I do have to agree with moondancer, we are here to help, and I happens to know that most of us are doing this at no extra-charge (except the money WE pay to the ISP and telcos to be on-line).  So the thing that drives most of us at "satisfaction", a "thank you..." or "it worked!", is a actually a boost to our morale.

Awarding a 200 pts is very rare, and I would consider that as very thoughtful (can I get that too :)).

Anyway, I would be really happy to get to the original quation, each and every parts.  -- Since the original date of this Q is almost 1 year, and I learned a few tricks (from EE too) since then.

>>* I want the server to masquerade all mails that are sent as they are comming from mydomain.com (the servers domainname is mail.mydomain.com)

my using M4.
MASQUERADE_AS(my-domain.com)
FEATURE(masquerade_envelope)
FEATURE(masquerade_entire_domain)

Or straight hack to sendmail.cf, just add the line (or replace the existing, DM to
DMmy-domain.com


>> * How do I set up which domains to recive mail for?

M4:
FEATURE(`use_cw_file')
and create a file in /etc/mail/sendmail.cw, and add all the domain that has their MX entry in the DNS to point to you sendmail, one domain per line.

Alternately; you can add (modified the Cw option in sendmail.cf) to be
Cwmy-domain.com otherdomain.com abc.com xyz.com

* how do I set the limit of the size of the mail to say 700MB ( I know... it's a bad idea)
M4:
DEFINE(confMAX_MESSAGE_SIZE,`734003200')
in sendmail.cf
# maximum message size
O MaxMessageSize=734003200

And again, the figure is based on 1024*1024*7 (1024bytes* 1024 bytes=1M, 1M * 7 =7M).  Some would just put 7000000 (7 million bytes = 7M).  I do not want to argue (1M=100- bytes, etc. etc.) Hope you got the idea.



* How do I set up which host's that should be able to use the server. (allow relay)
M4:
FEATURE(access_db)
then you need to create a flat file the has two columns separated by tab, and name this file "access"

Assuming that you want to allow relayin for; 10.1.1.1, 1.2.3.4, then you need to add

10.1.1.1 <Tab>RELAY
1.2.3.4  <Tab>RELAY

and built the access.db with this.
makemap hash /etc/mail/access < /etc/mail/access

More "english-like" explanation can be found here.
http://www.sendmail.org/tips/relaying.html
-----straight cut-and-paste from the above link.
For example, a database might contain:

cyberpromo.com  REJECT
sendmail.org    RELAY
spam@buyme.com  550 Spammers shan't see sunlight here

to reject all mail from any host in the cyberpromo.com domain, allow any relaying to or from any host in the sendmail.org domain, and reject mail from spam@buyme.com with a
specific message.

Note that the access database is a map and just as with all maps, the database must be generated using makemap. For example:

makemap hash /etc/mail/access < /etc/mail/access
------------

sendmail.cf ( beats me... I'm not sure).


What Have I forgot now? Any tip on what I need to change for the default config to get sendmain safer?

* Yes... Now I remember the most important thing.

I like all mail's coming to a non exsistent user to be sent to hulken@mydomain.com (no MAILERDEAMON
message)

There is really a few ways to get it done, and it all depends on how your sendmail is configured

Take a look at VirtualHosting page at www.sendmail.org for more detailed (step-by-step, since most of the info I might be typing here would be thre) information.

http://www.sendmail.org/virtual-hosting.html

The fact that I advise to map POSTMASTER: to your own email eddress is that, every mail bounced, a copy will be sent to the Postmaster too.  That sure worked, but not as good as using Vhost.

If you prefer to stick with the Postmaster technique, make sure the following option in your sendmail.cf is enabled.
# who (if anyone) should get extra copies of error messages
O PostMasterCopy=Postmaster

I would personally would advise to work on Vhost, even though you have only one domain

----
I hope these should catch all the IMPORTANT parts that you are looking for (even though it get stuck for almost 1 year).

should your need more information, feel free to add.
take care.
0
 

Author Comment

by:hulken
ID: 6986765
Thanks. That was a wounderful Answer.

Now I can switch from Postfix to sendmail.

The strange thing here is that I for some of my questions I don't get any mail about that someone has added a comment. Usually I try to be fast with comments. About 8 months ago I moved out from my Student apartment and where only connected over modem which made that my economical situation didn't allowed me to sit here for some hours. (So when i did not recieved any mail about comments / answers to my questions I did not checked out old questions which I thought did not have new comments)

Now I just got a fast internet access home again so it feels wounderful to get help with this.
0
 

Author Comment

by:hulken
ID: 6986770

Moondancer. Could you remove the 200 points from my account since I've got a good ansver or should I award 200 points as a new question for samri?
0
 

Author Comment

by:hulken
ID: 6986771

Moondancer. Could you remove the 200 points from my account since I've got a good ansver or should I award 200 points as a new question for samri?
0
 

Expert Comment

by:ComTech
ID: 6988766
Hello hulken, I see you have been there for about 5 years now.

We have Users and Experts both abandon questions, most were answered and NOT awarded to the Expert who may have answered the questions.  We have so far cleaned up over 135,000 abanonded questions.

The rules here are simple as far as this part is pertinant to you.  21 DAYS without a Post on any question, it is deemed as abandoned.  It is your responsibility to keep up with your own questions whether or not you receive notifications in the email, is no excuse, as you can open your member profile, and every question you ahve asked or aswered.  If the status is anything other than PAQ beside the queston in your member profile, needs to be taken care of.

Regards,
ComTech
CS Admin @ EE
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now