From: Georg Wagner
Subject: Конфигурация sendmail'а с помощью m4 макросов (eng)
Configuring sendmail 8.9 with m4-macros
Georg Wagner
http://www.free-x.ch/pub/sendmail-m4.html
29. November 1999
Abstract
There exist two possibilities to configure sendmail: the first is to
edit the sendmail.cf file directly, the second to use a m4-macro file.
Most people - including me - are using both methods depending on the
their know how. Recently I took the effort to get a single point for
applying my changes to the configuration of sendmail: the m4-macro
file.
1 Introduction
I am using a dialup-account to connect to my ISP. My provider's domain
is datacomm.ch whereas my domain at home is internal.ch with a
192.168.x.x-network; the machine has the name mymachine. I will refer
to my local username as login. My username at the ISP is g.wagner.
This means my internal address is login@mymachine.internal.ch and my
external address is g.wagner@datacomm.ch.
2 Configuring sendmail
First change to the directory ../cf/cf and create a copy of
generic.bsd4.4.mc:
# cp generic.bsd4.4.mc mymachine.mc
Before you start editing your newly created file, some possible
pitfalls with the macro language m4 should be mentioned:
* m4 uses forward- and backward-quotes
* The #-character does not have a special meaning to m4. If you are
writing a comment you should do it in the following way:
# `your comment here'
to prevent the possible interpretation of some words in your
comment as a macro.
2.1 Structure of the mc-file
The mc-file has the following structure:
VERSIONID
OSTYPE
DOMAIN
FEATURE
Local Macros
MAILER
LOCAL_RULESETS
2.2 Basic entries in mymachine.mc
After the header you should have the entries below the line with
divert(0):
Since version 8.9 of sendmail the default is not to (ab)use your
machine as mail relay. This is also the reason for the
relay_entire_domain entry in Section 2.2.
To allow your mail to be relayed at your provider's mailserver add a
line like:
define(`SMART_HOST', 'smtp.datacomm.ch')dnl
Rejecting spam
Using the acess database
If you want to maintain a spammer database of your own you can use the
feature:
As alternative, if you don't want to maintain your own access
database, you can use the Realtime Blackhole list. If you don't know
what the Realtime Blackhole list is, have a look at
http://maps.vix.com/rbl. This is the simplest mechanism for
blocking spam. Just add the line:
FEATURE(rbl)dnl
to your mymachine.mc file.
Setting the privacy flags
Don't allow remote user to ask for any informations on your smtp port:
define(`confPRIVACY_FLAGS', `goaway')dnl
3 Generating and Installing the sendmail.cf-file
You should now have a mymachine.mc file containing the lines:
I am not responsible if you spoil your configuration in applying the
described actions to your sendmail configuration. Make backups of
every file before you start. The mc-file was tested on my private
machine and seams to be working so far.
If you have any remarks, corrections or additions please send them to
me.
_________________________________________________________________
562 Прочтений • [Конфигурация sendmail'а с помощью m4 макросов (eng) (mail sendmail m4)] [08.05.2012] [Комментариев: 0]