[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building a custom sendmail.cf



On Sunday 13 February 2005 13:09, Alvin Oga wrote:

Thanks, Alvin,
You replied to all my posts and gave me a considerable boost on this matter.
Though I may not be wise enough to follow.

And I think I need more of your advice.

> don't modify sendmail.cf unless you know what it does ..
> and simiarly with submit.cf
Well, this is what the producer of the antivirus actually does (I compared the 
submit.cf and the submit.cf.listen files with diff).
And adding those lines in it makes it work on Slackware (no compiling at all I 
am pretty sure now).

>
> use the  submit.mc and sendmai.mc instead ( 100x easier to understand )
>

This is what I have been trying to do lately.
> > /usr/sbin/sendmail -q10m -C /etc/mail/sendmail.cf
> > /usr/sbin/sendmail  q10m  C /etc/mail/submit.cf
>
> that (submit.cf line) should not happen
>
I tried without the submit.cf line too with the same result.

> > And on a Slackware Box that used to be our mail-server it really works.
>
> good ... see if you can find the *.m4 files to recreate it on the
> slackware box too .. if it works again , than do the same thing
> on debian
>
I cannot recreate it, for on the Slackware box again the .cf files are not 
compiled but edited by the antivirus installer.
(though I followed your advice and searched the files there)
> > I successfully appended to sendmail.mc the lines and it ended like this:
> > dnl # Default Mailer setup
> > MAILER_DEFINITIONS
> > MAILER(`local')dnl
> > MAILER(`smtp')dnl
> > Msmtpscanner,   P=/opt/kav/bin/smtpscanner, F=PSXmnz9,
> > S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=2040,
> >         T=SMTP,
> >         A=smtpscanner
>
> lots and lots of stuff is missing from the sendmail.mc file
>
I found out that the sendmail.mc is rather short and that a lot of things are 
included by the reference of OSTYPE ('debian') in it (I am attaching the 
sendmail.mc file, though it is the one that is installed by default with 
sendmail. I only appended the smtpscanner lines to it (in the section 
MAILER_DEFINITIONS) hoping this would help. I followed the guidelines of the 
cfREADME for ADDING NEW MAILERS AND RULESETS.
> > Updating /etc/mail/aliases...
> > /etc/mail/aliases: line 13: MAILER-DAEMON... cannot alias non-local names
> > /etc/mail/aliases: line 14: postmaster... cannot alias non-local names
>
> means that sendmail(newliases) cannot find  /etc/aliases or
> /etc/mail/aliases in whatever directories its lookng for
>
> either sendmail.cf or submit.cf is broken ( or its *.mc files )
>

This happens when I add the line in /usr/share/sendmail/cf/m4/proto.m4 at this 
point defining ruleset 98:
###################################################################
###  Ruleset 98 -- local part of ruleset zero (can be null)     ###
###################################################################

SParseLocal=98

undivert(3)dnl LOCAL_RULE_0


The line I add 
R$*     $#smtpscanner $@$1 $:$1
seems to break everything or is misplaced. I tried to search for the undivert 
command and what it does but it was too much for me. I guess at this point 
something is added that does not like my line and the aliases break.

> > What is happening? And how can I solve this?
>
> get the virgin *.m4  and add your antispam/antivirus filters with *.mc
> files

That is the above mentioned proto.m4 file if I am not wrong for nowhere else 
ruleset 98 is mentioned in the m4 or mc files. I am afraid it will not work 
as a filter. From what I read I figured out smtpscanner should be a mailer.

Of course I will have a look at the link you pointed in the end of your mail, 
but anyway, do you have the time to give me a hand on this matter now.

Regards

Chavdar Videff
divert(-1)dnl
#-----------------------------------------------------------------------------
# $Sendmail: debproto.mc,v 8.13.3 2005-02-07 17:11:45 cowboy Exp $
#
# Copyright (c) 1998-2005 Richard Nelson.  All Rights Reserved.
#
# cf/debian/sendmail.mc.  Generated from sendmail.mc.in by configure.
#
# sendmail.mc prototype config file for building Sendmail 8.13.3
#
# Note: the .in file supports 8.7.6 - 9.0.0, but the generated
#	file is customized to the version noted above.
#
# This file is used to configure Sendmail for use with Debian systems.
#
# If you modify this file, you will have to regenerate /etc/mail/sendmail.cf
# by running this file through the m4 preprocessor via one of the following:
#	* `sendmailconfig` 
#	* `make`
#	* `m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf`
# The first two options are preferred as they will also update other files
# that depend upon the contents of this file.
#
# The best documentation for this .mc file is:
# /usr/share/doc/sendmail-doc/cf.README.gz
#
#-----------------------------------------------------------------------------
divert(0)dnl
#
#   Copyright (c) 1998-2005 Richard Nelson.  All Rights Reserved.
#
#  This file is used to configure Sendmail for use with Debian systems.
#
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.13.3-6 2005-02-07 17:11:45 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
undefine(`confHOST_STATUS_DIRECTORY')dnl        #DAEMON_HOSTSTATS=
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
dnl #
dnl # General defines
dnl #
dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()
dnl #	into this directory before writing files.
dnl #	If *all* your user accounts are under /home then use that
dnl #	instead - it will prevent any writes outside of /home !
dnl #   define(`confSAFE_FILE_ENV',             `')dnl
dnl #
dnl # Daemon options - restrict to servicing LOCALHOST ONLY !!!
dnl # Remove `, Addr=' clauses to receive from any interface
dnl # If you want to support IPv6, switch the commented/uncommentd lines
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission')dnl
dnl #
dnl # Be somewhat anal in what we allow
define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl
dnl #
dnl # Define connection throttling and window length
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
dnl #
dnl # Features
dnl #
dnl # The access db is the basis for most of sendmail's checking
FEATURE(`access_db', , `skip')dnl
dnl #
dnl # The greet_pause feature stops some automail bots - but check the
dnl # provided access db for details on excluding localhosts...
FEATURE(`greet_pause', `1000')dnl 1 seconds
dnl #
dnl # Delay_checks allows sender<->recipient checking
FEATURE(`delay_checks', `friend', `n')dnl
dnl #
dnl # If we get too many bad recipients, slow things down...
define(`confBAD_RCPT_THROTTLE',`3')dnl
dnl #
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
dnl #

dnl # Masquerading options
FEATURE(`always_add_domain')dnl
MASQUERADE_AS(`mail1.mr-bricolage.bg')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl

dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
Msmtpscanner,	P=/opt/kav/bin/smtpscanner, F=PSXmnz9, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=2040, 
	T=SMTP, 
	A=smtpscanner


Reply to: