Question

Help configuring Sendmail for an ISP environment (inbound MX routers)

Asked by: Frog357

Hello,
I need help getting sendmail configured for an ISP environment.  I need to accept inbound mail for multiple domains (no outbound, no local), I wasn't sure how to accumplish this so I recently tried RELAY_DOMAINS but I am thinking there might be a better way?  I'm setting up an inbound mail relay to forward all mail to our internal mail hub.  I purchased the o'riley black bat book for sendmail and after reading through it, I'm having information overload ;)

Here's my sendmail.mc file:
divert(0)dnl
VERSIONID(`1.0.1')
OSTYPE(freebsd4)
DEFINE(`confEBINDIR', `/usr/local/libexec')
DEFINE(`confLOG_LEVEL', `15')dnl Increase the logging level to help diagnose troubles..
DEFINE(`confPRIVACY_FLAGS', `authwarnings,needmailhelo,goaway')dnl
DEFINE(`MAIL_HUB', `mailhub.domain.com')
DEFINE(`confDONT_PROBE_INTERFACES',true)
DEFINE(`confSMTP_LOGIN_MSG', `')
RELAY_DOMAIN_FILE(`/etc/mail/relay-domains')
dnl FEATURE(`use_cw_file')
dnl FEATURE(`nullclient', `mailhub.mydomain.com')
dnl First make sendmail work, then play with filters... MAIL_FILTER(`mimedefang', `S=local:/var/spool/MIMEDefang/mimedefang.sock, T=C:15m;S:4m;R:4m;E:10m')
dnl DEFINE(`confINPUT_MAIL_FILTERS', `mimedefang')
dnl MAILER(`local')
MAILER(`smtp')


At first I tried using use_cw_file but found this was an error in my thinking, this is only for accepting local mail?


Question is:
What should I change to configure this for our requirements?
Inbound relay -> internal mail hub
No outbound mail on inbound relay
No local mail on inbound relay

OS is FreeBSD 4.9

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-03-02 at 06:02:57ID20903963
Tags

sendmail

,

nullclient

Topic

SendMail Email Server

Participating Experts
2
Points
500
Comments
19

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Sendmail won't send or relay SMTP traffic
    I've got what I believe are three different problems with Sendmail 8.12.6 under FreeBSD 4.7 but it's possible that resolving one fixes all of them. I'm sure this is something simple but I'm a newbie with Sendmail(64hrs total exposure) and FreeBSD. 1) I cannot send email ini...
  2. Sendmail Relay
    I am new to very new to sendmail. Right now, I am just trying to get the mail relayed to the exchange server, later I may start using spamassasin and some other possible filtering. Here is the layout: internet--> linux.sendmail --> exchange server I thought I had if ...
  3. Sendmail
    Hi Experts, I had to rebuild a Linux server after hacking so is FC4, the problem is that I would like remote users being able to send mail through my server after being authenticated. They are able to send mail through webMail, but I would like to enable to send mail through...
  4. FreeBSD sendmail web application
    Hello I'm running web applications on a FreeBSD 6.1 server (which I just upgraded to 6.2). Some of these applications send mail to local users. For 2 weeks now, that doesn't work anymore. That was before the upgrade and the upgrade doesn't help. I can't remember I changed an...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: Frog357Posted on 2004-03-02 at 06:20:10ID: 10495057

How about accept mail only for a given set of users?

 

by: Frog357Posted on 2004-03-02 at 06:44:56ID: 10495362

P.S. When I try to use my current setup, the following happens:

I send mail from client to test sendmail server for internal server.
my sendmail server is finding the MX records for the internal domain and using the address it finds to send the mail.
I thought MAIL_HUB would cause the mail to be sent to the server I specified?

 

by: jleviePosted on 2004-03-02 at 06:55:13ID: 10495453

There are several ways this can be done. My preference would be to user virtusertable to forward email only for valid accounts and to reject mail for unknown users. In that case you'd set the mail server up as if it was the mail server for each of your domains and use a virtusertable that looked similar to:

user@virt1.tld      user1@internal.domain.tld
...
@virt1.tld              error: nouser No such user
user@virt2.tld      user2#internal.domain.tld
..
@virt1.tld              error: nouser No such user
...

Of course this means that the MX for all domains must point to the Sendmail relay server and the real mail server must accept mail addressed to user@internal.domain.tld.

Since I don't know what OS you are running sendmail on I can't suggest a reasonable sendmail.mc file, could you elaborate?

 

by: Frog357Posted on 2004-03-02 at 07:07:59ID: 10495599

I posted it in the first comment, OS is FreeBSD 4.9
Does virtusertable allow the format like:
user@domain     user@domain

My dumb internal server does not allow:
user@host.domain

I can generate the entire user listing, I was planning to do this to prevent mail to unknown users.

I've upgraded sendmail to 8.12.11 using the Ports package.

 

by: Frog357Posted on 2004-03-02 at 09:36:09ID: 10497050

> Of course this means that the MX for all domains must point to the
> Sendmail relay server

This is already implemented, we are replacing an existing box with the new sendmail relay.  One serious problem with the existing box is it does not know who it's allowed to accept mail for, it thinks anything@mydomain is ok, that is one reason I'm moving over to using sendmail..

I've been reading about this for weeks now, I'm starting to think I should move towards using accessdb?

 

by: jleviePosted on 2004-03-02 at 10:45:07ID: 10497694

> Does virtusertable allow the format like:
> user@domain     user@domain

A qualified yes. Assuming that sendmail is configured to be the MX for domain1.tld and was configured to accept mail for said domain (the domain is listed in local-host-names) you could have a virtusertable record like:

addr@domain1.tld     real-addr@other-dom.tld

where other-dom.tld is not one of the domains that sendmail is relaying mail for. An attempt to relay mail to a domain on the sendmail server would be a loop.

What mail server do you have that won't accept mail addressed to user@machine.domain.tld? Even Exchange, as brain dead as it is w/respect to the RFC's, can do that with a bit of work. And if it reaslly can't be made to do that you've got a serious problem in trying to make this work. For sendmail to discriminate between valid users and other it must use either alias forwards or virtusertable records with explicit forwards to user@machine.domain.tld. Using relay-domains or mailertable ignores the user check because you've effectively told sendmail that it isn't going to have user information.

 

by: Frog357Posted on 2004-03-02 at 11:16:04ID: 10498023

I'm using an old version of Vircom Vopmail 4.2.181, we have 3,000 e-mail accounts on it, and I'm worried that any changes on that box would lead to phone calls from our customers.

Would the access_db feature of sendmail work in this situation?

I'm thinking I would need to specify:
user1@domain.tld     Accept
user2@domain.tld     Accept
...
user3000@domain.tld     Accept
@domain.tld        Deny


I've seen this format someplace before..

 

by: jleviePosted on 2004-03-02 at 12:39:02ID: 10498903

Oh wow! Vpopmail... I'll bet it is running on NT, given the version.  I assume that you plan to move that to a FreeBSD or Linux system and that would be a pretty easy move. If you used Cyrus IMAP you could have true virtual user support in the mail system if desired.

My suspicion is that user checks are deferred until after "all relay" checks are done. But, I'm not sure and I haven't had time to look at a sendmail.cf to see if the access map is checked before relay-domains or mailtable are evaluated.

 

by: Frog357Posted on 2004-03-02 at 14:19:42ID: 10499852

Not moving it yet but we want to get better filtering for it, I'm setting up Mimedefang + clamav + spamassassin.  I'm getting 3 servers for inbound mail relays for our customers.  We have issues with joe-jobs and other spam related troubles.  The problem is, our current (dumb) mail relay does not know which users are legit, it accepts for *@domain.tld without knowing if the user is valid on our internal mail server.  We want a sendmail box for a mail gateway that knows which users to accept for.  Save us a ton of bounced mail traffic.  Then the 3 mail relays will send the mail to our internal mail server.

My main question is how to accomplish setting up sendmail to know which users to accept mail for and then relay that mail to the internal server.

 

by: Frog357Posted on 2004-03-02 at 14:19:42ID: 10499853

Not moving it yet but we want to get better filtering for it, I'm setting up Mimedefang + clamav + spamassassin.  I'm getting 3 servers for inbound mail relays for our customers.  We have issues with joe-jobs and other spam related troubles.  The problem is, our current (dumb) mail relay does not know which users are legit, it accepts for *@domain.tld without knowing if the user is valid on our internal mail server.  We want a sendmail box for a mail gateway that knows which users to accept for.  Save us a ton of bounced mail traffic.  Then the 3 mail relays will send the mail to our internal mail server.

My main question is how to accomplish setting up sendmail to know which users to accept mail for and then relay that mail to the internal server.

 

by: jleviePosted on 2004-03-02 at 14:56:08ID: 10500101

I question whether you need three fast boxes for the relay with only 3000 accounts if you use something more efficient than MimeDefang. My personal preference would be MailScanner (http://www.sng.ecs.soton.ac.uk/mailscanner/index.html) on RHEL 3.0 AS running on a pair of dual 2.xMhz Xeons. Unless you have an extreme mail volume you could easily handle the load with one box, but two provides a measure of redundancy. I've set up a two box solution for an ISP with 40K accounts on a pair of 2.0Mhz dual Pentium systems running RedHat 9 and had no problem handing in excess of 2GB of mail per box, per day and the Xenon's with RHEL 3.0 are going to outperform those by a good margin. I would defintely recommend that your relay servers be SCSI instead of IDE, if you want max performance. Mail filtering places a high disk I/O load on the system and the disconnect/reconnect and command tagged queueing of SCSI makes a difference.

As mentioned I'd use RHEL 3.0 over FreeBSD. The head to head comparisons that I've done show RHEL to be a clear winner in this application.

And when it is time to convert from Vpopmail I'd go with a Cyrus Aggreator (aka Murder) so that I'd have scalability and more resilence.

 

by: Frog357Posted on 2004-03-02 at 20:04:18ID: 10501791

We see it like this, having 3 boxes for inbound mail will allow us to grow without needing to add new hardware for mail.  We also need 1 of those boxes for testing to ensure upgrades go smoothly, if we break one, we will still have enough power to keep on operating at normal speeds.  We will also have extra horsepower sitting around in case we need to utilize one of these servers for something else.

So it's looking like I can not get sendmail to do what I need to accomplish?  Without changing anything on my internal server?

I can program in VB so I am able to manipulate the data however it's needed for sendmail, I intend on everything being automatic, I just need to learn how to do it the first time ;)

I appreciate all the advice, but I am stuck to use what's been selected.  I just need help getting sendmail to accept for my users and relay mail to our internal server.

I'm stuck from all ends, our internal mail server uses an ODBC connection to get it's users, our billing system controls all aspects of e-mail account creation, delete, etc.  It doesn't provide an easy way to give everyone aliases to accept for user@host.domain.tld so I am forced to not re-write the mail.  If I manually add aliases to our mail server it will not be controlled by our billing system and I don't like manual work.

 

by: jozatanPosted on 2004-03-02 at 22:57:57ID: 10502368

If you need just it inbound (jlevie, don't smile) for several domains why don't you put

MASQUERADE_DOMAIN(domain1.tlda)dnl
MASQUERADE_DOMAIN(domain2.tlda)dnl
MASQUERADE_DOMAIN(domain3.tlda)dnl
MASQUERADE_DOMAIN(domain4.tlda)dnl
...
MASQUERADE_DOMAIN(domain99.tlda)dnl

in your sendmail.mc? Put these domains in relay-domains as well. If you have more than one inbound MX box, just put the same configuration for each box.

 

by: Frog357Posted on 2004-03-03 at 06:02:51ID: 10504527

jozatan,
I've got this working mostly, I've added my domains to relay-domains, specified blacklist_recp... and now I have my access db setup like:

To:user1@domain.tld     RELAY
To:user2@domain.tld     RELAY
...
To:user3k@domain.tld     RELAY
To:domain.tld     REJECT
To:.domain.tld     REJECT

This works as I am wanting, when a user is matched with RELAY they are allowed to receive mail, when it's not found, it rejects the message.  Is this going to give me adverse effects?

One problem I can't figure out is why sendmail is not using my specified mail_hub.  In my testing, I found that sendmail is doing a MX lookup for the domain and using that box to send the mail.  What feature do I need to force it to use a specified server?

It's an open relay in it's current form, I can't have that ;)

I tried using masquerade_domain but it didn't seem to have any impact?

 

by: Frog357Posted on 2004-03-03 at 16:46:46ID: 10510214

I am checking out MailScanner now, it seems like it does all the other does and much easier, thanks for the recommendations.  Do you know if this program allows to block during the smtp session?  I have not have much time to read over the FAQ yet.
Thanks,

 

by: jozatanPosted on 2004-03-03 at 21:50:04ID: 10511535

It does with dnsbl.

 

by: Frog357Posted on 2004-03-04 at 21:26:17ID: 10520266

Just in case anyone finds this article looking for help, the learning curve needed to install Mimedefang is well worth the time required.  The ability to reject viruses & spam during the smtp session is well worth it.

 

by: jleviePosted on 2004-03-05 at 06:20:27ID: 10522763

MailScanner doesn't block during the SMTP session, which is an advantage and a disadvantage. The disadvantage is that a reject won't be in-line and as a part of the SMTP session. The adantage is one of reliability in that the message will have already been received and sitting in the input queue. So if something fails during scanning you don't loose the message. And it a trivial exercise to bypass scanning completely if the scanner isn't behaving properly by simply moving messages from the input queue to the delivery queue w/o any reconfigurations of anything.

While it has been about 5 months since I last compared MIMEdefang with MailScanner (I do that periodically since apps do change with time), MailScanner was still the hands down winner in terms of reliability and throughput.

 

by: Frog357Posted on 2004-03-08 at 21:54:40ID: 10547611

From our perspective (mid-size regional ISP) we prefer to reject during SMTP session due to the fact that spam / viruses are spoofed and we choose to block this mail, if the mail is accepted then it must be bounced, and with a forged return-path, the messages gets jammed in the queue until it times out.
I got my setup working properly except one minor exception..  It's allowing anyone to relay through it, what did I mess up to cause this?
I'll most likely start a new question on this in the morning.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...