Trying to configure sendmail in Debian



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 [email protected]) with no problem.

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

Mar 7 14:45:29 newton sm-mta[17159]: r27JjOw1017159: to=<[email protected]>, ctladdr=<[email protected]> (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:

[email protected]:/etc/mail# sendmail -bv [email protected]

[email protected] deliverable: mailer relay, host, user [email protected]

Does that mean the [email protected] 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!



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. [email protected] and [email protected] go to two different users greg1 and greg2.
[email protected] dave
[email protected] john
[email protected] 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 [email protected] and [email protected] 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"
[email protected] 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
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit:

Staff online

Members online