Sendmail Configuration

Nik Clayton nik at
Fri Mar 17 21:13:56 GMT 2000

On Fri, Mar 17, 2000 at 10:23:16AM -0000, Norman Buskell wrote:
> I often test CGI mail scripts by sending messages to a local account on my 
> FreeBSD web server. This has always worked fine, until I re-configured the 
> machine for IP forwarding via a PPP dial-up connection. Now, when the CGI 
> script runs sendmail, it appears to be trying to connect to the remote DNS 
> server to check the mail account name. Luckily, my IP filters do not allow 
> sendmail to initiate a dialup connection. What configuration changes do I 
> need to make, so that sendmail understands how to send messages direct to 
> local accounts? A few pointers would be greatly appreciated.

2 things:

  1.  Sendmail needs to resolve all the addresses on all the interfaces
      it can see when it starts up.  Make sure there is an entry for
      every IP address you have (including your PPP IP address) in 
      /etc/hosts, or run a local nameserver with the same information.

  2.  Add the following two lines to, and rebuild

        define(`SMTP_MAILER_FLAGS', `e')dnl
        define(`confCON_EXPENSIVE', `true')dnl

      This tells sendmail that all the messages it has to send by SMTP
      (as opposed to all the messages it has to deliver to local users)
      are "expensive").

      If you then run sendmail as "sendmail -bd" then it will listen for
      incoming messages as normal.  All "local" messages (such as those
      generated by your CGI scripts, the nightly cron runs, and so on)
      will be delivered immediately.  Anything else (i.e., anything that
      has to go off the machine) will be queued, and won't be sent until
      you force a queue run with "sendmail -q".  You can create a PPP
      linkup script that does this automatically every time you dial in.

Internet connection, $19.95 a month.  Computer, $799.95.  Modem, $149.95.
Telephone line, $24.95 a month.  Software, free.  USENET transmission,
hundreds if not thousands of dollars.  Thinking before posting, priceless.
Somethings in life you can't buy.  For everything else, there's MasterCard.
  -- Graham Reed, in the Scary Devil Monastery

More information about the Ukfreebsd mailing list