[Vmail-discuss] Strange Routing? on subdomain.domain.com

Gerald Freymann gerry@interpool.ca
Tue, 15 Oct 2002 21:23:05 -0400


This could be an exim bug or a vmail bug. Don't know.

VmailSQL and Exim 3.36 #1.

I have a virtual sub-domain address that accepts and delivers fine if mail
is sent from a computer on the local internal LAN.

But incoming mail from the outside world gets directed wrong.

user@theirsub.interpool.ca

gets sent to

user@interpool.ca (minus the subdomain)

and naturally, that "user" doesn't exist.

In exim Mainlog I see:

verify failed for SMTP recipient user@interpool.ca from <email@domain.com>
H=ip number

I've run exim in debug mode level 9 and captured all this. I find it odd
that in the SMTP exchange the email address changes from
robward@wardlock.interpool.ca to just robward@interpool.ca ??

====start====

Exim version 3.36 debug level 9 uid=0 gid=0
probably Berkeley DB version 1.8x (native mode)
Caller is an admin user
Caller is a trusted user
originator: uid=0 gid=0 login=root name=Charlie Root
port = 25
LOG: 0 MAIN
  Setting IPV6_V6ONLY on daemon's IPv6 wildcard socket failed (Protocol
not available): carrying on 
without itlistening on all interfaces (IPv6)
listening on all interfaces (IPv4)
pid written to /var/run/exim.pid-bd
LOG: 0 MAIN
  exim 3.36 daemon started: pid=78616, no queue runs, listening for SMTP
on port 25
set_process_info: 78616 daemon: no queue runs, port 25
daemon running with uid=26 gid=6 euid=26 egid=6
listening on port 25...
Connection request from 216.136.175.81/30740
1 SMTP accept process running
listening on port 25...
interface address = 64.231.139.9
host in rfc1413_hosts? yes (*)
ident callback failed
sender_fullhost = [216.136.175.81]
sender_rcvhost = [216.136.175.81]
Process 78617 is handling incoming connection from [216.136.175.81]
host in host_lookup? yes (*)
looking up host name for 216.136.175.81
IP address lookup yielded web13502.mail.yahoo.com
sender_fullhost = web13502.mail.yahoo.com [216.136.175.81]
sender_rcvhost = web13502.mail.yahoo.com ([216.136.175.81])
set_process_info: 78617 handling incoming connection from
web13502.mail.yahoo.com [216.136.175.81]
host in host_reject? no (option unset)
host in host_reject_recipients? no (option unset)
host in rbl_hosts? yes (0.0.0.0/0)
checking RBL domain relays.ordb.org/reject
DNS lookup of 81.175.136.216.relays.ordb.org (A) gave HOST_NOT_FOUND
returning DNS_NOMATCH
RBL lookup for 81.175.136.216.relays.ordb.org failed
=> that means it's not black listed at relays.ordb.org
host in auth_hosts? no (option unset)
host in auth_over_tls_hosts? no (option unset)
host in tls_hosts? no (option unset)
host in sender_unqualified_hosts? no (option unset)
host in receiver_unqualified_hosts? no (option unset)
host in helo_verify? no (option unset)
host in helo_accept_junk_hosts? no (option unset)
SMTP>> 220 scaryg.shacknet.nu ESMTP Exim 3.36 #1 Tue, 15 Oct 2002 20:35:24
SMTP>-0400
set_process_info: 78617 handling incoming connection from
web13502.mail.yahoo.com [216.136.175.81]
ready for new message
smtp_setup_msg entered
SMTP<< HELO web13502.mail.yahoo.com
sender_fullhost = web13502.mail.yahoo.com [216.136.175.81]
sender_rcvhost = web13502.mail.yahoo.com ([216.136.175.81])
set_process_info: 78617 handling incoming connection from
web13502.mail.yahoo.com [216.136.175.81]
SMTP>> 250 scaryg.shacknet.nu Hello web13502.mail.yahoo.com
SMTP>[216.136.175.81]
SMTP<< MAIL FROM:<bob_lablaw@yahoo.com>
bob_lablaw@yahoo.com in sender_reject? no (option unset)
bob_lablaw@yahoo.com in sender_reject_recipients? no (option unset)
host in sender_verify_hosts? yes (*)
verifying sender bob_lablaw@yahoo.com
>>>>>>>>>>>>>>>>>>>>>>>>
Verifying bob_lablaw@yahoo.com
yahoo.com in local_domains? no (end of list)
address bob_lablaw@yahoo.com
  local_part=bob_lablaw domain=yahoo.com
  domain is not local
>>>>>>>>>>>>>>>>>>>>>>>>
routing bob_lablaw@yahoo.com, domain yahoo.com
send_to_gateway router called for bob_lablaw@yahoo.com
  route_domain = yahoo.com
routelist_item = * smtp1.sympatico.ca byname
after handling route_lists items, matched = 1
original hostlist=smtp1.sympatico.ca options=byname
expanded hostlist="smtp1.sympatico.ca" options=byname
Actual local interface address is 192.168.0.1 (vr0)
Actual local interface address is fe80:1::40dc:bfbf:aa34:708 (vr0)
Actual local interface address is fe80:2::40dc:bfbf:aa34:708 (vr1)
Actual local interface address is ::40dc:bfbf:aa34:708 (lo0)
Actual local interface address is fe80:3::40dc:bfbf:aa34:708 (lo0)
Actual local interface address is 127.0.0.1 (lo0)
Actual local interface address is fe80:5::40dc:bfbf:aa34:708 (tun0)
Actual local interface address is 64.231.139.9 (tun0)
fully qualified name = smtp1.sympatico.ca
smtp1.sympatico.ca 209.226.175.82 mx=-1
smtp1.sympatico.ca 209.226.175.80 mx=-1
smtp1.sympatico.ca 209.226.175.81 mx=-1
routed by send_to_gateway router:
  deliver to bob_lablaw@yahoo.com
  transport: remote_smtp
  host smtp1.sympatico.ca [209.226.175.82]
  host smtp1.sympatico.ca [209.226.175.80]
  host smtp1.sympatico.ca [209.226.175.81]
host in sender_verify_hosts_callback? no (option unset)
bob_lablaw@yahoo.com verified ok as bob_lablaw@yahoo.com
SMTP>> 250 <bob_lablaw@yahoo.com> is syntactically correct
SMTP<< RCPT TO:<robward@interpool.ca>
SMTP>> 250 <robward@interpool.ca> is syntactically correct
SMTP<< DATA
SMTP>> 354 Enter message, ending with "." on a line by itself
search_tidyup called
host in ignore_fromline_hosts? no (option unset)
>>Original headers (size=355):
Message-ID: <20021016003521.28529.qmail@web13502.mail.yahoo.com>
Received: from [64.231.139.9] by web13502.mail.yahoo.com via HTTP; Tue, 15
Oct 2002 17:35:21 PDT
Date: Tue, 15 Oct 2002 17:35:21 -0700 (PDT)
From: Bob Lablaw <bob_lablaw@yahoo.com>
Subject: test
To: robward@wardlock.interpool.ca
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

rewrite_one_header: type=F:
  From: Bob Lablaw <bob_lablaw@yahoo.com>
rewrite_one_header: type=T:
  To: robward@wardlock.interpool.ca
>>Final headers:
P Received: from web13502.mail.yahoo.com ([216.136.175.81])
        by scaryg.shacknet.nu with smtp (Exim 3.36 #1)
        id 181c9l-000KS1-00
        for robward@interpool.ca; Tue, 15 Oct 2002 20:35:25 -0400
I Message-ID: <20021016003521.28529.qmail@web13502.mail.yahoo.com>
P Received: from [64.231.139.9] by web13502.mail.yahoo.com via HTTP; Tue,
15 Oct 2002 17:35:21 PDT
  Date: Tue, 15 Oct 2002 17:35:21 -0700 (PDT)
F From: Bob Lablaw <bob_lablaw@yahoo.com>
  Subject: test
T To: robward@wardlock.interpool.ca
  MIME-Version: 1.0
  Content-Type: text/plain; charset=us-ascii
 
search_tidyup called
Data file written for message 181c9l-000KS1-00
Writing spool header file
Size of headers = 541
LOG: 0 MAIN
 <= bob_lablaw@yahoo.com H=web13502.mail.yahoo.com [216.136.175.81] P=smtp
S=688 
id=20021016003521.28529.qmail@web13502.mail.yahoo.com
SMTP>> 250 OK id=181c9l-000KS1-00
search_tidyup called
Sender: bob_lablaw@yahoo.com
Recipients:
  robward@interpool.ca
set_process_info: 78617 handling incoming connection from
web13502.mail.yahoo.com [216.136.175.81]
ready for new message
smtp_setup_msg entered
SMTP<< QUIT
SMTP>> 221 scaryg.shacknet.nu closing connection
search_tidyup called
child 78617 ended: status=0x0
0 SMTP accept processes now running
listening on port 25...

My Exim Configuration file contains:


######################################################################
#                    MAIN CONFIGURATION SETTINGS                     #
######################################################################

LOCAL_ALIASES = /etc/mail/local_aliases
message_filter = /usr/local/etc/exim/system_filter.exim
message_body_visible = 5000

deliver_queue_load_max = 8
smtp_accept_max = 20
smtp_accept_max_per_host = 10
spool_directory = /var/spool/exim_incoming
queue_only = true

# reject messages whose sending host is in MAPS/RBL & MAP/DUL
# add warning to messages whose sending host is in RSS
rbl_domains = relays.ordb.org/reject
# check all hosts other than those on internal network
rbl_hosts = !192.168.0.1/24:0.0.0.0/0
# but allow mail to postmaster@my.dom.ain even from rejected host
recipients_reject_except = postmaster@scaryg.shacknet.nu
# change some logging actions (collect more data)
rbl_log_headers
rbl_log_rcpt_count

primary_hostname = scaryg.shacknet.nu

qualify_domain = scaryg.shacknet.nu

hide mysql_servers = localhost::3306/dbname/user/passwd

# qualify_recipient =

local_domains = scaryg.shacknet.nu:/etc/mail/local-host-names

forbid_domain_literals

exim_user = mailnull
exim_group = mail
never_users = root

host_accept_relay = localhost : 192.168.0.0/24 : 127.0.0.1 :
scaryg.shacknet.nu
relay_domains = scaryg.shacknet.nu:/etc/mail/relay-domains

host_lookup = *

receiver_verify

sender_verify

ignore_errmsg_errors_after = 2d

timeout_frozen_after = 7d

end



######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################
#                       ORDER DOES NOT MATTER                        #
#     Only one appropriate transport is called for each delivery.    #
######################################################################

# A transport is used only when referenced from a director or a router
# that successfully handles an address.

# This transport is to deliver mail going to virtual domains to user
# mailspools in directories under /var/spool/mail/SERVERS/foo/bar; this is
# triggered from a director below.
 
virtual_localdelivery:
  driver = appendfile
  file = ${lookup mysql{select path from domain left join domain_alias on
domain_alias.domain_name = domain.domain_name where domain.domain_name =
'$domain' or domain_alias.alias = '$domain'}{$value}fail}/${lookup
mysql{select mbox_name from popbox left join domain_alias on
popbox.domain_name = domain_alias.domain_name where (popbox.domain_name =
'$domain' or domain_alias.alias = '$domain') and local_part =
'$local_part'}{$value}fail}
  delivery_date_add
  envelope_to_add
  return_path_add
  user = ${lookup mysql{select unix_user from domain left join
domain_alias on domain_alias.domain_name = domain.domain_name where
domain.domain_name = '$domain' or domain_alias.alias =
'$domain'}{$value}fail}
  mode = 0660

# This transport is used for delivering messages over SMTP connections.

remote_smtp:
  driver = smtp


# This transport is used for local delivery to user mailboxes in
# traditional BSD mailbox format. By default it will be run under the uid
# and gid of the local user, and requires the sticky bit to be set on the
# /var/mail directory. Some systems use the alternative approach of
# running mail deliveries under a particular group instead of using the
# sticky bit. The commented options below show how this can be done.

local_delivery:
  driver = appendfile
  file = /var/mail/$local_part
  delivery_date_add
  envelope_to_add
  return_path_add
  group = mail
  mode = 0660


# This transport is used for handling pipe deliveries generated by alias
# or .forward files. If the pipe generates any standard output, it is
# returned to the sender of the message as a delivery error. Set
# return_fail_output instead of return_output if you want this to happen
# only when the pipe fails to complete normally. You can set different
# transports for aliases and forwards if you want to - see the references
# to address_pipe in the directors section below.

address_pipe:
  driver = pipe
  return_output


# This transport is used for handling deliveries directly to files that
# are generated by aliasing or forwarding.

address_file:
  driver = appendfile
  delivery_date_add
  envelope_to_add
  return_path_add


# This transport is used for handling autoreplies generated by the
# filtering option of the forwardfile director.

address_reply:
  driver = autoreply

end



######################################################################
#                      DIRECTORS CONFIGURATION                       #
#             Specifies how local addresses are handled              #
######################################################################
#                          ORDER DOES MATTER                         #
#   A local address is passed to each in turn until it is accepted.  #
######################################################################


bounce_spam_master:
  driver = smartuser
  require_files = /usr/local/etc/exim/bouncelist
  senders = /usr/local/etc/exim/bouncelist
  new_address = :fail: "unknown local-part \"$local_part\" in domain
\"$domain\""


bounce_spam_personal:
  driver = smartuser
  senders = /home/$local_part/.bouncelist
  require_files = /home/$local_part/.bouncelist
  new_address = :fail: unknown local-part \"$local_part\" in domain
\"$domain\"


system_aliases:
  domains = LOCAL_ALIASES
  driver = aliasfile
  file = /etc/mail/aliases
  search_type = lsearch
  user = exim
  group = mail
  qualify_preserve_domain = true
  file_transport = address_file
  pipe_transport = address_pipe


userforward:
  domains = LOCAL_ALIASES
  driver = forwardfile
  file = .forward
  no_verify
  no_expn
  check_ancestor
# filter
  file_transport = address_file
  pipe_transport = address_pipe
  reply_transport = address_reply
  match_directory = !^/nonexistent


# This director matches local user mailboxes.

localuser:
  domains = LOCAL_ALIASES
  driver = localuser
  transport = local_delivery

# For Virtual Email Stuff
# Handle forwarders and aliases (same database table)
 
virtual_forward:
  driver = aliasfile
  search_type = mysql
  query = "select remote_name from forwarder left join domain_alias on
domain_alias.domain_name = forwarder.domain_name where local_part =
'$local_part' and (forwarder.domain_name = '$domain' or alias =
'$domain')"
  forbid_file = true
  forbid_pipe = true
 
# Handle delivery; see sample config C009 for what this is based on; it
# only handles things for the virtual domains, which are listed in the
# database.
 
virtual_localuser:
  driver = aliasfile
  search_type = mysql
  query = "select mbox_name from popbox left join domain_alias on
domain_alias.domain_name = popbox.domain_name where local_part =
'$local_part' and (popbox.domain_name = '$domain' or alias = '$domain')"
  transport = virtual_localdelivery

# deliver any undelivered virtual email according to the _default_
# forwarder
 
virtual_defaultuser:
  driver = aliasfile
  search_type = mysql
  query = "select remote_name from forwarder left join domain_alias on
domain_alias.domain_name = forwarder.domain_name where local_part =
'_default_' and (forwarder.domain_name = '$domain' or domain_alias.alias =
'$domain')"
  forbid_file = true
  forbid_pipe = true

end

######################################################################
#                      ROUTERS CONFIGURATION                         #
#            Specifies how remote addresses are handled              #
######################################################################
#                          ORDER DOES MATTER                         #
#  A remote address is passed to each in turn until it is accepted.  #
######################################################################

send_to_gateway:
   driver = domainlist
   transport = remote_smtp
   route_list = * smtp1.sympatico.ca byname



end



######################################################################
#                      RETRY CONFIGURATION                           #
######################################################################

*                      *           F,2h,15m; G,16h,1h,1.5; F,4d,8h

end



######################################################################
#                      REWRITE CONFIGURATION                         #
######################################################################

# There are no rewriting specifications in this default configuration
# file.

end



######################################################################
#                   AUTHENTICATION CONFIGURATION                     #
######################################################################

# There are no authenticator specifications in this default configuration
# file.

# End of Exim configuration file