[Exim] Virtual domains, on one host

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: ryan
Dátum:  
Címzett: Exim Users
Tárgy: [Exim] Virtual domains, on one host

I'm trying to setup virtual domains, all on one host, and I need to make
sure that the To and From headers don't get touched at all once leaving
the MUA. I haven't been able to get this to work so far - it seems like
the headers are being rewritten to the primary hostname of the machine
doing the hosting.

I'm fairly certain that outgoing mail gets modified, I'm not entirely sure
about incoming at this point.

I'm runing the Debian/potato distribution of exim, with a hand modified
config file, though I'm not sure that I've changed anything significant.

I've looked through sample configs, and tried *some* of the virtual
hosting stuff, but it doesn't appear to have worked quite the way I
expected it to. (It also hasn't solved my header rewriting problems,
which is the biggest problem right now.)

Here's a sample header that I just tested from a separate machine:

Date: Sat, 18 Dec 1999 19:09:55 -0500 (EST)
From: ryan@???
To: ryan@???
Subject: test

that was address to ryan@??? when it left Pine on the other account.


One related question: With a director like
virtual:
driver = aliasfile
domains = "lsearch;/etc/exim/local-host-names"
search_type = lsearch*
no_more
file = /etc/exim/$domain-aliases

If I put a line like "*: ryan" in the alias file for a subdomain, does
that reroute *all* mail to anyone in that subdomain to the user ryan on
the local machine? If I other users that want to get mail in that domain,
but I want anything else to go to a specific user, how do I do that? Is
it easily possible?


Here's the config file I'm using. (I cleaned out some comments in the
process, I'll be more than happy to send that version if it's wanted.)


primary_hostname = michonline.com
# qualify_domain = michonline.com
# qualify_recipient =
local_domains = localhost:lsearch;/etc/exim/local-host-names
local_domains_include_host = true
local_domains_include_host_literals = true
# relay_domains =
relay_domains_include_local_mx = true
never_users = root
host_lookup = *
rbl_domains = rbl.maps.vix.com
rbl_reject_recipients = false
rbl_warn_header = true
host_accept_relay = localhost : 207.251.171.0/24:24.2.73.245/32
# percent_hack_domains=*
trusted_users = mail
smtp_verify = true
gecos_pattern = ^([^,:]*)
gecos_name = $1

smtp_accept_queue_per_connection = 100

freeze_tell_mailmaster = true

received_header_text = "Received: \
         ${if def:sender_rcvhost {from ${sender_rcvhost}\n\t}\
         {${if def:sender_ident {from ${sender_ident} }}\
         ${if def:sender_helo_name {(helo=${sender_helo_name})\n\t}}}}\
         by ${primary_hostname} \
         ${if def:received_protocol {with ${received_protocol}}} \
         (Exim ${version_number} #${compile_number} (Debian))\n\t\
         id ${message_id}\
         ${if def:received_for {\n\tfor <$received_for>}}"
end



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


local_delivery:
driver = appendfile
group = mail
mode = 0660
mode_fail_narrower = false
envelope_to_add = true
file = /var/spool/mail/${local_part}

address_pipe:
driver = pipe
return_output

address_file:
driver = appendfile

address_directory:
driver = appendfile
no_from_hack
prefix = ""
suffix = ""
# maildir_format

address_reply:
driver = autoreply

procmail_pipe:
driver = pipe
command = "/usr/bin/procmail -d ${local_part}"
from_hack

remote_smtp:
driver = smtp

virtual_smtp:
driver = appendfile
group = mail
mode = 0660
mode_fail_narrower = false
envelope_to_add = true
file = /var/spool/mail/${local_part}

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.  #
######################################################################


virtual:
driver = aliasfile
domains = "lsearch;/etc/exim/local-host-names"
search_type = lsearch*
no_more
file = /etc/exim/$domain-aliases
# transport = virtual_smtp

real_local:
prefix = real-
driver = localuser
transport = local_delivery

system_aliases:
driver = aliasfile
domains = michonline.com
file_transport = address_file
pipe_transport = address_pipe
file = /etc/aliases
search_type = lsearch*
user = list
# Uncomment the above line if you are running smartlist

procmail:
driver = localuser
transport = procmail_pipe
require_files = ${home}:${home}/.procmailrc:/usr/bin/procmail
no_verify

userforward:
driver = forwardfile
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
no_verify
check_ancestor
file = .forward
modemask = 002
filter
# except_domains="lsearch;/etc/exim/local-host-names"

localuser:
driver = localuser
transport = local_delivery

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.  #
######################################################################


lookuphost:
driver = lookuphost
transport = remote_smtp

literal:
driver = ipliteral
transport = remote_smtp

end


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


# Domain               Error       Retries


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


end

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



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

## *@michonline.com    ${lookup{$1}lsearch{/etc/email-addresses}\
#                        {$value}fail} bcfrF


# End of Exim configuration file


Thanks for any/all the help you can give, I'm planning on writing
something that explains this all concisely when I figure it all out, so
that it can be easily added to the FAQ. (I read the FAQ, and nothing
seemed to quite cover this situation, or, at least didn't *obviously*
cover it.)


Ryan Anderson