Trying to configure sendmail in Debian

Discussion in 'General Linux' started by raphael75, Mar 8, 2013.

  1. raphael75

    raphael75 New Member

    Mar 8, 2013
    Likes Received:
    I'm trying to configure sendmail on our Debian Linux server to send mail, using our Exchange server as a relay. I'm a total noob at all of this.

    We can send mails to internal addresses (for example, if our domain name is, the server can send mail to with no problem.

    We can't send mail to external addresses like or Here's an example of what I get in /var/log/mail.log

    Mar 7 14:45:29 newton sm-mta[17159]: r27JjOw1017159: to=<>, ctladdr=<root@newton.forrest> (0/0), delay=00:00:05, xdelay=00:00:05, mailer=relay, pri=30455, [], dsn=5.7.1, stat=User unknown

    Also, I get this:

    root@newton:/etc/mail# sendmail -bv deliverable: mailer relay, host, user
    Does that mean the is unknown to newton, or unknown to Exchange?

    Is there something in Exchange we need to configure?

    I have no idea what to configure. Please help. Thanks!
  2. McCody

    McCody New Member

    Mar 6, 2013
    Likes Received:
    for that you need to configure the IMAP and SMTP in the send for that just follow this

    Sendmail is the default MTA on the RedHat Linux distribution. Do NOT use linuxconf to configure sendmail as it has NOT been updated to work with current versions of sendmail!!! (The tool linuxconf is no longer included with current versions of Red Hat Linux 7.3+)

    RPM packages required: sendmail, sendmail-cf and m4

    Ubuntu/Debian install: sudo apt-get sendmail sendmail-base sendmail-bin sendmail-cf mailutils

    Sendmail receives mail for local system user login accounts. Mail is held in a single file: /var/mail/userID

    Steps to run mail server using sendmail:

    Required for inbound mail: The mail server must be identified by the DNS as the mail server in order to receive mail. See the YoLinux web tutorial on configuring DNS.
    /etc/mail/local-host-names (Required) (Red Hat 7.1 - Fedora Core 3)
    /etc/ (Red Hat 6.x)
    This file contains all of the alternate host names of the server. (i.e. Sendmail will not accept mail for a domain unless it is permitted to do so by the contents of this file.

    File /etc/aliases (Optional) lists alternative names for email recipients.
    webmaster: john, dave
    postmaster: kim, garret
    larry.anderson: larry
    moe.anderson: moe
    curly.anderson: curly

    After creation or modification one must run the command newaliases which will generate a new version of the file /etc/aliases.db There is no need to restart the sendmail daemon. The changes are picked up automatically.
    File /etc/mail/virtusertable (Optional) Allows the separation of emails by domain. i.e. and go to two different users greg1 and greg2. dave john john error:nouser User unknown mathew

    The second column is the local user, a remote forwarding email address or a mailing list entry in /etc/aliases.
    The domain "" will only receive email for and while all other mail to this domain receives an error message.
    Convert /etc/mail/virtusertable to /etc/mail/virtusertable.db with the commands:
    cd /etc/mail
    Relaying and receiving mail is controlled by the file: /etc/mail/access. By default relaying is only allowed by localhost and sendmail will accept mail from all. (Red Hat 7.1 default is more strict but the restriction is not from the access file. More below.)
    Required for outbound email. Helpful for blocking some unwanted inbound email.
    localhost.localdomain RELAY
    localhost RELAY RELAY

    Generate database file:
    [root prompt]# makemap hash /etc/mail/access.db < /etc/mail/access

    The access file can be used to thwart spammers. List IP addresses or email address to deny in the file: /etc/access
    After adding entries to the access file, generate the database file with the command above.
    YYY.YYY.YYY.YYY ERROR:"550 We don't accept mail from spammers" REJECT " Spam not accepted"
    ZZZ.ZZZ.ZZZ.ZZZ OK - Override rules and allow
    ZZZ.ZZZ OK - Allow from ZZZ.ZZZ.*.* network

    See the /etc/mail/access file I am currently using. It changes daily. Feel free to cut and paste this Sendmail access file to your system.
    Other access lists:
    Iowa State University
    IP block list used by http: Exploited server list More info on cf-readme (See Anti-Spam section)
    Sendmail must be running

Share This Page