Solved

Having a hard time to make Sendmail work on Ubuntu 11.04

Posted on 2011-09-10
5
1,234 Views
Last Modified: 2013-12-16
I used to run a Sendmail server on an old Red Hat Box

For that box, the server was able to receive emails by different domains as set on the DNS MX records which pointed to that box.

Seems that the newest version of sendmail disables RELAY which is good, but that is providing it to receive emails as well.

With my new configuration, I do not have RELAY 550 errors from the messages I send anymore, BUT the emails are not being received and saved under /var/spool/mail/  They are getting lost. So I am including my 2 MC files, the old one that worked fine on the old system and the new one.

My old server configuration is as follows:

dnl divert(-1) apaga o crud no arquivo .cf resultante
dnl
divert(-1)
dnl
dnl You will need to have the sendmail-cf package installed for this to
dnl work
dnl.
include(`/usr/share/sendmail-cf/m4/cf.m4')
dnl
dnl
VERSIONID(`linux setup for Red Hat Linux')dnl
dnl
dnl
OSTYPE(`linux')dnl
dnl
dnl DefaultUser [1:1] Default user id.
dnl
define(`confDEF_USER_ID',``8:12'')dnl
dnldnl
undefine(`UUCP_RELAY')dnl
dnl
undefine(`BITNET_RELAY')dnl
dnl
dnl Auto Rebuild Aliases
dnl
dnl define(`confAUTO_REBUILD')dnl
dnl
define(`confTO_CONNECT', `1m')dnl
dnl
define(`confTRY_NULL_MX_LIST',true)dnl
dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
dnl
define('ALIAS_FILE','/etc/aliases')dnl
dnl
define(`STATUS_FILE', `/var/log/sendmail.st')dnl
dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn')dnl
dnl
define(`confTO_QUEUEWARN', `4h')dnl
dnl
define(`confTO_QUEUERETURN', `2d')dnl
dnl
define(`LOCAL_MAILER_FLAGS',`ShPfn')dnl
dnl
define(`LOCAL_MAILER_ARGS', `procmail -a $h -d $u')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
dnl
define(`confCW_FILE',`/etc/mail/sendmail.cw')dnl
dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
dnl
FEATURE(`genericstable',`hash -o /etc/mail/genericstable')dnl
dnl
GENERICS_DOMAIN_FILE(/etc/mail/generic_domain)dnl
dnl
FEATURE(redirect)dnl
dnl
FEATURE(always_add_domain)dnl
dnl
FEATURE(use_cw_file)dnl
dnl
MASQUERADE_DOMAIN_FILE(/etc/mail/domains)dnl
dnl
FEATURE(local_procmail)dnl
dnl
FEATURE(`access_db')dnl
dnl
FEATURE(`blacklist_recipients')dnl
dnl
FEATURE(masquerade_entire_domain)dnl
dnl
FEATURE(masquerade_envelope)dnl
dnl
FEATURE(allmasquerade)dnl
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not hav 24x7 DNS do need this.
dnl FEATURE(`accept_unresolvable_domains')dnl
dnl FEATURE(`relay_based_on_MX')dnl
dnl
MAILER(smtp)dnl
dnl
MAILER(procmail)dnl

Here is my new .mc file based on changes I did on the Ubunbtu 11.04 sendmail.mc file:

divert(-1)dnl
#-----------------------------------------------------------------------------
# $Sendmail: debproto.mc,v 8.14.4 2011-01-10 21:47:09 cowboy Exp $
#
# Copyright (c) 1998-2010 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.14.4
#
# 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:
#      * make   (or make -C /etc/mail)
#      * sendmailconfig
#      * 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.14.4-2ubuntu1 2011-01-10 21:47:09 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
dnl #
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
dnl DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl
dnl DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')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 # use /etc/mail/local-host-names
FEATURE(`use_cw_file')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 # The access db is the basis for most of sendmail's checking
dnl # Took this off
dnl #FEATURE(`access_db', , `skip')dnl
FEATURE(`access_db')dnl
dnl #
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 old system
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
dnl FEATURE(`access_db',`hash -o /etc/mail/access.db')dnl
dnl FEATURE(`access_db',`hash -T /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
dnl os flags usados pelo local mailer
dnl
define(`LOCAL_MAILER_FLAGS',`ShPfn')dnl
dnl
dnl argumentos passados para entregar local mail
dnl
define(`LOCAL_MAILER_ARGS', `procmail -a $h -d $u')dnl
dnl localizacao do arquivo cw para dominios
dnl
define(`confCW_FILE',`/etc/mail/sendmail.cw')dnl
dnl mailer table para rooting a dominios particulares que nao estao na class w
dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
dnl
dnl para aliases a multiplos dominios ender global para endereco local
dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
dnl
dnl reverso, end local para global
dnl
FEATURE(`genericstable',`hash -o /etc/mail/genericstable')dnl
dnl
dnl especifica os dominios usados em genericstable
dnl
GENERICS_DOMAIN_FILE(/etc/mail/generic_domain)dnl
dnl sempre incluir dominio mesmo para entrega local host
dnl
FEATURE(always_add_domain)dnl
dnl
dnl usar o arquivo cw para nomes alternados para esse host
dnl
FEATURE(use_cw_file)dnl
dnl
dnl mascarado de acordo com dominios, mascara e-mails com esses dominios
dnl
MASQUERADE_DOMAIN_FILE(/etc/mail/domains)dnl
dnl
dnl usar procmail como MDA para e-mails locais
dnl
FEATURE(local_procmail)dnl
dnl masquerade todos os hosts dentro de um dominio
dnl
FEATURE(masquerade_entire_domain)dnl
dnl
dnl masquerade no envelope
dnl
FEATURE(masquerade_envelope)dnl
dnl
dnl mascara o sender tambem
dnl
FEATURE(allmasquerade)dnl
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not hav 24x7 DNS do need this.
dnl FEATURE(`accept_unresolvable_domains')dnl
dnl FEATURE(`relay_based_on_MX')dnl
dnl coloquei isso aqui
FEATURE(relay_hosts_only)dnl
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not have 24x7 DNS do need this.
dnl FEATURE(`acceptunresolvable_domains')dnl
dnl old system
dnl #
dnl # If you're on a dialup link, you should enable this - so sendmail
dnl # will not bring up the link (it will queue mail for later)
dnl define(`confCON_EXPENSIVE',`True')dnl
dnl #
dnl # Dialup/LAN connection overrides
dnl #
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
MAILER(procmail)dnl

Thanks.
0
Comment
Question by:CarlosScheidecker
  • 3
5 Comments
 
LVL 21

Expert Comment

by:Papertrip
Comment Utility
I realize this is not what you asked but, why use sendmail?  Have you looked at postfix?
0
 
LVL 1

Author Comment

by:CarlosScheidecker
Comment Utility
Requirements are Sendmail.
0
 
LVL 1

Accepted Solution

by:
CarlosScheidecker earned 0 total points
Comment Utility
0
 
LVL 1

Author Closing Comment

by:CarlosScheidecker
Comment Utility
Had another question that fixed it: http://www.experts-exchange.com/OS/Linux/Q_27301922.html
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

6 Experts available now in Live!

Get 1:1 Help Now