Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have www server called say mywebsite.com and mail serwer mymail.com. Mail for mywebsite.com is handled by mymail.com (mx record for mywebsite.com is mymail.com). Problem is that I want to send mails from my www server mywebsite.com to adress in domain mywebsite.com.

So I configured sendmail on mywebsite.com to relay all mails via mymail.com. i change sendmail config on mywebsite.com: dnl # define('SMART_HOST', 'mymail.com')dnl

Problem is that sendmail complains when im sending to for example rafal@mywebsite.com that user is unkown (but that mailbox exist on mymail.com). All maibloxes are on mymail.com not on mywebsite.com.

this is log from telnet to localhost on mywebsite.com

root@mywebsite.com# telnet localhost 25
Connected to localhost.localdomain (
Escape character is '^]'.
220 familie.pl ESMTP Sendmail 8.13.8/8.13.8; Sun, 6 Nov 2011 18:21:04 +0100
helo domain.pl
250 domain.pl Hello localhost.localdomain [], pleased to meet you
mail from: me@mywebsite.com
250 2.1.0 me@mywebsite.com... Sender ok
rcpt to: rafal@mywebsite.com
550 5.1.1 rafal@website.com ... User unknown
503 5.0.0 Need RCPT (recipient)

Is there a way to disable checking rcpt for local domain??

share|improve this question

1 Answer 1

up vote 4 down vote accepted

This is cited from http://www.tipstrs.com/tip/13296/Setting-up-sendmail-with-a-catch-all-for-unknown-email-addresses

If you're running sendmail on a Linux server, it's quite easy to configure sendmail so that any email sent to an unknown email address in your domain is forwarded to a known address. Doing this results in getting a bunch more spam, but I like this cause I can then use email addresses that don't exist for specific purposes (such as when a forum requires a valid email address as part of the sign-up confirmation process).

Here's how to set up an catch-all for all unknown email addresses in Fedora (your disto may be slightly different), all of these commands need to be run under the root user:

  1. Edit the /etc/mail/sendmail.mc file and look for the line that contains virtusertable in it and make sure it is not commented out. If it is commented out, remove the comment. In my case, it looks like this:

    FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dn
  2. Edit the /etc/mail/virtusertable file and add lines like the following, one for each domain on your server that you want to add a catch-all for:

    @domain1.com postmaster-domain1
    @domain2.com postmaster-domain2

    In this example, any mail sent to an unknown user at domain1.com will be forwarded to the postmaster-domain1 user, and any email sent to an unknown user at domain2.com will be forwarded to the postmaster-domain2 user. For this to work, the users to whom the mail is being forwarded must exist, and be able to receive mail.

  3. From the /etc/mail directory, run the make command.
  4. Restart the sendmail service using the service sendmail restart command.

That's all there is to it. Once you take this few simple steps you wil l have a catch-all for any email sent to unknown users in your domain.

share|improve this answer
this isnt what im looking for... a want to disable checking rcpt to because i have mailboxes @mywebsite.com on my mail server mymail.com and web aplication from mywebsite.com want to sent mails there. But sendmail is checking if this mailboxes are on mywebsite.com before he relay them to mymail.com. –  B14D3 Nov 7 '11 at 7:30
@B14D3 So then you misconfigured your local Sendmail as being responsible for mywebsite.com. Remove that. –  mailq Nov 7 '11 at 15:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.