[EXIM] configuration problem

Top Page
Delete this message
Reply to this message
Author: Berkan Eskikaya
Date:  
To: exim-users
Subject: [EXIM] configuration problem
Hi,

I'm running exim 1.92 on my linux box. I connect to my ISP with PPP
3-4 times a day to check my mailbox which is on another server (ie
I don't use fetchmail).

Here's what I would like to happen:

1) Any mail that is sent from my computer while it's offline should wait
in the queue until a connection is established.

2) Only local users who are listed in a file should be able to send mail
to the outside world.

3) I want to use the same file above to lookup the real email addresses
of local users to rewrite From: lines of outgoing messages.

....

1) used to work, but then I introduced 2) and 3), and now I have a
problem. I'll try to explain what my problem is and how I implemented
2) and 3). I would be really glad if you could make suggestions on all
3 points. For full reference, I'm also including my exim.conf at the
end of this message.

> 1) Any mail that is sent from my computer while it's offline should wait
> in the queue until a connection is established.


exim -qf is run automatically to flush the queue whenever the PPP link
is up. Like I said, this used to work. But now, sometimes when I send a
message while I'm offline, exim freezes the message saying that there
was a domain look-up failure.

My smarthost router includes the line

route_list = "* smtp.freeserve.net bydns_a"

And my retry configuration is

   # Domain               Error       Retries
   # ------               -----       -------
   *                      *           F,2h,15m; G,16h,2h,1.5; F,4d,8h


If I change this to

   *                       *          F,30d,1d;


I no longer get domain look-up failures, but this time, when I send
a message while I'm online, the message just sits in the queue and I
have to flush the queue manually.

> 2) Only local users who are listed in a file should be able to send mail
>    to the outside world.


The file is /etc/email-addresses, and it looks like this

local_username1: real_email_address1@???
local_username2: real_email_address2@???

The smarthost router includes a condition:

condition = "${lookup{${local_part:$sender_address}}lsearch{/etc/email-addresses} {yes} {no}}"

This, again, works only sometimes (ie, sometimes a user who is not listed
in the email-addresses file can send an email to the outside world. There
must be something wrong with my condition, but what?

> 3) I want to use the same file above to lookup the real email addresses
>    of local users to rewrite From: lines of outgoing messages.


*@@    ${lookup{$1}lsearch{/etc/email-addresses}\
                                        {$value}fail} frF


  At least this one works reliably. But any suggestions welcome.                    


Thanks a lot for reading,

Berkan

....

# Start of Exim configuration file


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


primary_hostname = nexus
# qualify_domain =
# qualify_recipient =
# local_domains =
local_domains_include_host = true
local_domains_include_host_literals = true
#relay_domains = 
#relay_domains_include_local_mx = true
never_users = root
host_lookup_nets = 0.0.0.0/0
sender_host_reject_relay = *
trusted_users = mail
smtp_verify = false
gecos_pattern = ^([^,:]*)
gecos_name = $1
received_header_text = "Received: \
          ${if def:sender_fullhost {from ${sender_fullhost} \
          ${if def:sender_ident {(${sender_ident})}}\n\t}\
          {${if def:sender_ident {from ${sender_ident} }}}}\
          by ${primary_hostname} \
          ${if def:received_protocol {with ${received_protocol}}} \
          (Exim ${version_number} #${compile_number} (Debian))\n\t\
          id ${message_id}"
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
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

remote_smtp:
driver = smtp

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 = /etc/aliases
search_type = lsearch
# user = list
# Uncomment the above line if you are running smartlist

userforward:
driver = forwardfile
no_verify
check_ancestor
file = .forward
modemask = 002
filter

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


smarthost:
driver = domainlist
condition = "${lookup{${local_part:$sender_address}}lsearch{/etc/email-addresses} {yes} {no}}"
transport = remote_smtp
route_list = "* mailcore.theplanet.net:rsunx.crn.cogs.susx.ac.uk bydns_a"

end


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


# Domain               Error       Retries
# ------               -----       -------


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


end


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


*@@    ${lookup{$1}lsearch{/etc/email-addresses}\
                    {$value}fail} frF


# End of Exim configuration file



--
*** Exim information can be found at http://www.exim.org/ ***