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 [email protected] 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
[email protected]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
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 [127.0.0.1], pleased to meet you
mail from: [email protected]
250 2.1.0 [email protected]... Sender ok
rcpt to: [email protected]
550 5.1.1 [email protected] ... User unknown
data
503 5.0.0 Need RCPT (recipient)
Is there a way to disable checking rcpt for local domain??
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:
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: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: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.
/etc/mail
directory, run themake
command.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.