Email setup problems
I am trying to set up a mail system on a small home network. All machines use
Woody from the stable tree.
My idea is to use fetchmail to retrieve mail from my ISP account (pop) and
Exim to send messages to external addresses on the internet (smtp). I am
using a dial-up connection (modem).
As client I have installed Kmail.
Sometime I might also look into the possibility to filter the messages so
that each user on the system can have their own mail addresses
(someting like "user<mailaddress@ISP.com>"). I guess I need procmail for this.
If possible I want the client to be set up in a way that mail is stored on
the mailserver (/var/mail/myuser) so that I can access it from any machine in
the LAN.
So far I have managed to do the following:
Installed Fetchmail and configured it so that mail is downloaded from
my dial up mail account. When I run fetchmail, mail is downloaded
and stored in /var/mail/myuser.
This part of the system appears to be working fine.
To configure Exim I used eximconfig.
First I selected "Intenet site using smarthost".
As visible mail name I entered "home.net" (my LAN).
As other names I listed "mailserver" (name of host).
I selected no to relay any mail from external machines.
I listed "192.168.0.0/24" to relay mail for the local domain.
The smarthost handling the outgoing mail is "smtp.ISP.com".
Sysadmin and root mail is redirected to "myuser".
The file /etc/email-addresses look like this:
myuser: mailaddress@ISP.com
user2: mailaddress@ISP.com
user3: mailaddress@ISP.com
user4: mailaddress@ISP.com
If I use the client that is standard on the system (mail) I can now send mail
to external addresses. However, it appears that queued mail is not being
stored untill the machine is connected to the internet.
The problem appears when I'm trying to configure Kmail. I have
problems setting it up so that it uses /var/mail/myuser.
I have tried to set up Kmail as a standalone mail program. This works fine
(as a matter of fact I am sending this message using this kmail setup now!).
So, does anyone have an idea how to set up the mail system the way I have
described it ?
Regards
Ole
The /etc/exim/exim.conf:
######################################################################
# MAIN CONFIGURATION SETTINGS #
######################################################################
qualify_domain = home.net
# qualify_recipient =
local_domains = localhost:home.net:mailserver:localhost
local_domains_include_host = true
local_domains_include_host_literals = true
#relay_domains =
#relay_domains_include_local_mx = true
never_users = root
host_lookup = *
# headers_check_syntax
#rbl_domains = rbl.mail-abuse.org/reject : dialups.mail-abuse.org/warn
host_accept_relay = 127.0.0.1 : ::::1 : 192.168.0.0/24
host_auth_accept_relay = *
# percent_hack_domains=*
trusted_users = mail
smtp_verify = false
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>}}"
receiver_try_verify = true
#accept_8bitmime = true
#local_interfaces = 127.0.0.1
#queue_list_requires_admin = false
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
return_path_add = true
file = /var/spool/mail/${local_part}
address_pipe:
driver = pipe
path = /usr/bin:/bin:/usr/local/bin
return_output
address_file:
driver = appendfile
envelope_to_add = true
return_path_add = true
address_directory:
driver = appendfile
no_from_hack
prefix = ""
suffix = ""
# maildir_format
address_reply:
driver = autoreply
procmail_pipe:
driver = pipe
command = "/usr/bin/procmail"
return_path_add
delivery_date_add
envelope_to_add
# check_string = "From "
# escape_string = ">From "
suffix = ""
remote_smtp:
driver = smtp
# authenticate_hosts = smarthost.isp.com
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. #
######################################################################
real_local:
prefix = real-
driver = localuser
transport = local_delivery
system_aliases:
driver = aliasfile
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
userforward:
driver = forwardfile
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
no_verify
check_ancestor
check_local_user
file = .forward
modemask = 002
filter
procmail:
driver = localuser
transport = procmail_pipe
require_files =
${local_part}:+${home}:+${home}/.procmailrc:+/usr/bin/procmail
no_verify
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. #
######################################################################
# Send all mail to a smarthost
smarthost:
driver = domainlist
transport = remote_smtp
route_list = "* smtp.ISP.com bydns_a"
end
######################################################################
# RETRY CONFIGURATION #
######################################################################
# Domain Error Retries
# ------ ----- -------
* * F,2h,15m; G,16h,2h,1.5; F,4d,8h
end
######################################################################
# REWRITE CONFIGURATION #
######################################################################
*@home.net ${lookup{$1}lsearch{/etc/email-addresses}\
{$value}fail} frFs
end
######################################################################
# AUTHENTICATION CONFIGURATION #
######################################################################
# plain:
# driver = plaintext
# public_name = PLAIN
# server_condition = "${if
crypteq{$2}{${extract{1}{:}{${lookup{$1}lsearch{/etc/exim/passwd}{$value}{*:*}}}}}{1}{0}}"
# server_set_id = $1
#
# login:
# driver = plaintext
# public_name = LOGIN
# server_prompts = "Username:: : Password::"
# server_condition = "${if
crypteq{$2}{${extract{1}{:}{${lookup{$1}lsearch{/etc/exim/passwd}{$value}{*:*}}}}}{1}{0}}"
# server_set_id = $1
# plain:
# driver = plaintext
# public_name = PLAIN
# client_send = "^username^password"
#
# login:
# driver = plaintext
# public_name = LOGIN
# client_send = ": username : password"
#
# cram_md5:
# driver = cram_md5
# public_name = CRAM-MD5
# client_name = username
# client_secret = password
# End of Exim configuration file
Reply to: