S
S
Sheryorg2015-10-26 12:08:49
Exim
Sheryorg, 2015-10-26 12:08:49

How to save outgoing Exim mail?

Installed mail server in a bunch of dovecot - exim. You need to save outgoing mail that was not sent through the mail client (the mail client automatically saves letters).
At the moment, the server is running on such a configuration of routers and transport, outgoing mail is not saved, but it goes locally and to others without any problems.

begin routers  

dnslookup:  
  driver = dnslookup  
  domains = ! +local_domains  
  transport = remote_smtp  
  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8  
  no_more  

system_aliases:  
    driver      = redirect  
    allow_fail  
    allow_defer  
    data = ${lookup mysql{SELECT `goto` FROM `alias` WHERE \  
            `address`='${quote_mysql:[email protected]$domain}' OR \  
                `address`='${quote_mysql:@$domain}'}}  

dovecot_user:  
  driver = accept  
  condition = ${lookup mysql{SELECT `goto` FROM \  
  `alias` WHERE \  
  `address`='${quote_mysql:[email protected]$domain}' OR \  
  `address`='${quote_mysql:@$domain}'}{yes}{no}}  
  transport = dovecot_delivery  

store_outbox:
  driver = accept
  condition = ${lookup mysql{SELECT `goto` FROM \
  `alias` WHERE \
  `address`='${quote_mysql:[email protected]$domain}' OR \
  `address`='${quote_mysql:@$domain}'}{yes}{no}}
  transport = dovecot_delivery_outbox

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

remote_smtp:  
  driver = smtp  
  interface = 111.111.111.111
  helo_data = mail.domain.com 


dovecot_delivery_outbox:
  driver = pipe
  command = /usr/libexec/dovecot/deliver -d $sender_address -f $sender_address -m Outbox
  headers_add = X-Outbox: yes
  message_prefix =
  message_suffix =
  delivery_date_add
  envelope_to_add
  return_path_add
  log_output
  user = exim
  temp_errors = 64 : 69 : 70: 71 : 72 : 73 : 74 : 75 : 78


dovecot_delivery:  
  driver = pipe  
  command = /usr/libexec/dovecot/deliver -d [email protected]$domain  
  message_prefix =  
  message_suffix =  
  delivery_date_add  
  envelope_to_add  
  return_path_add  
  log_output  
  user = exim  

  
address_pipe:  
  driver = pipe  
  return_output  

address_reply:  
  driver = autoreply

With this configuration of the router, mail is saved in outgoing mail, but when sent, for example, from gmail, mail is delivered, but gmail receives a message that the user was not found:
begin routers  

store_outbox:
  driver = accept
  unseen
  condition = ${lookup mysql{SELECT `goto` FROM \
  `alias` WHERE \
  `address`='${quote_mysql:[email protected]$domain}' OR \
  `address`='${quote_mysql:@$domain}'}{yes}{no}}
  transport = dovecot_delivery_outbox


dnslookup:  
  driver = dnslookup  
  domains = ! +local_domains  
  transport = remote_smtp  
  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8  
  no_more  

system_aliases:  
    driver      = redirect  
    allow_fail  
    allow_defer  
    data = ${lookup mysql{SELECT `goto` FROM `alias` WHERE \  
            `address`='${quote_mysql:[email protected]$domain}' OR \  
                `address`='${quote_mysql:@$domain}'}}  

dovecot_user:  
  driver = accept  
  condition = ${lookup mysql{SELECT `goto` FROM \  
  `alias` WHERE \  
  `address`='${quote_mysql:[email protected]$domain}' OR \  
  `address`='${quote_mysql:@$domain}'}{yes}{no}}  
  transport = dovecot_delivery

And yet, when outgoing mail is saved to the Outbox folder, it is marked as unread, how can I make it read?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2016-10-10
@Zarom

With gmail - look at the server log, at what point you get a note from Exim about a non-existent user. Something at first glance I do not see where the error you have.
Regarding the mark as read - I see only a way using the Sieve filter of the form:

if exists "X-Outbox"  {
    removeflag "\\Seen";
    stop;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question