I have an ubuntu 16.04 web server with a forwarded mx record. On server, I installed sendmail. I have multiple vhosts runnning. One of them is "xxx-tele.com".
Now I want to setup sendmail that all mails sent to info@xxx-tele.com should be forwarded to xxx@tele.com which is a mailbox on a different mail server inside of my network.
First I added a /etc/mail/virtusertable with
info@xxx-tele.com xxx@tele.com
and with "makemap hash virtusertable.db < virtusertable" I created the hash file. In /etc/mail/sendmail.mc I added the line
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl
and I run the
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
command and restarted sendmail with "service sendmail reload".
Now, I try command
sendmail -bv info@xxx-tele.com
and I just get response: info@xxx-tele.com... User unknown
The xxx-tele.com is appended in /etc/hosts and in /etc/mail/local-host-names
How can I setup sendmail to just forward this address and refuse all other?
The command: echo '$=w' | sendmail -bt just returns:
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> localhost.tele.com
web
xxx-tele.com
[internal.dmz.ip4.address]
localhost
web.tele.com
[127.0.0.1]
web.tele.com
[localhost.tele.com]
Best, dwi
here are the provided information: The answer for 1.) is
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> map_lookup: virtuser (info@xxx-tele.com) returns myuser@tele.com (0)
The answer for 2.) is
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> canonify input: info @ xxx-tele.com
Canonify2 input: info < @ xxx-tele.com >
map_lookup(host, xxx-tele.com, %0=xxx-tele.com) => localhost.xxx.com. (0)
Canonify2 returns: info < @ localhost.xxx.com . >
canonify returns: info < @ localhost.xxx.com . >
parse input: info < @ localhost.xxx.com . >
Parse0 input: info < @ localhost.xxx. com . >
map_lookup(dequote, info, %0=info) => NOT FOUND (0)
Parse0 returns: info < @ localhost.xxx.com . >
Parse1 input: info < @ localhost. xxx.com . >
map_lookup(virtuser, info@localhost.xxx.com, %0=info@localhost.xxx.com, %1=info) => NOT FOUND (0)
map_lookup(virtuser, @localhost.xxx.com, %0=@localhost.xxx.com, %1=info) => NOT FOUND (0)
Parse1 returns: $# local $: info
parse returns: $# local $: info
The third response is:
> root@web:~# _res.options = 812c3, HasWildcardMX = 0
Enter <ruleset> <address>
> canonify input: info @ xxx-tele . com
Canonify2 input: info < @ xxx-tele . com >
Canonify2 returns: info < @ localhost . xxx. com . >
canonify returns: info < @ localhost . xxx. com . >
parse input: info < @ localhost . xxx. com . >
Parse0 input: info < @ localhost . xxx. com . >
Parse0 returns: info < @ localhost . xxx. com . >
Parse1 input: info < @ localhost . xxx. com . >
Parse1 returns: $# local $: info
parse returns: $# local $: info
My host file is like:
127.0.0.1 localhost localhost.xxx.com xxx-tele.com
local.dmz.ip4.address web.xxx.com web xxx-tele.com