Re: [exim] exim maildirsize quota calculation in the face of symlinks

2022-02-16 Thread Maarten van Baarsel via Exim-users

Hi all,

On 10-02-2022 12:10:53, Jeremy Harris via Exim-users wrote:

On 10/02/2022 10:55, Maarten van Baarsel via Exim-users wrote:



I was surprised by the symlink behaviour so I'm reconsidering the use of
the dovecot plugin, but I still wanted to ask whether this behaviour is
considered OK. I've read the appendfile docs and I could find anything
explicit about symlinks.


The coding probably doesn't consider the possibility of multiple paths
into a single directory, as afforded by the use of symlinks, at all.
I've not checked, though.

"OK" is in the eye of the beholder, naturally.

Handling the case would likely be a feature-addition.  The fastest
fix would be to not traverse symlinks, I suppose.


I'd like to say thanks for the replies, and ask for guidance how to put 
this on the feature-addition-list so that it won't be forgotten, I did 
find the problem Cyborg was alluding to in a post from a while ago :)


I had a quick look at the code but did not see a fast path to a fix.

Maarten.



--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] exim maildirsize quota calculation in the face of symlinks

2022-02-10 Thread Maarten van Baarsel via Exim-users

Hi,

I'm using Exim 4.90.1 on an Ubuntu 18.04 machine with dovecot 2.2.33 as
IMAP server.

Currently, I'm also using a plugin in dovecot:

https://wiki.dovecot.org/Plugins/MailboxAlias

to make sure the users with different names for the Sent and Trash
folder ("Verzonden items", "Deleted Messages") see the same name between
different user agents.

However, this plugin solves the alias problem with a symlink in the
Maildir directory, which makes Exim count the mails twice when the
appendfile transport is calculating quota sizes.


I managed to grab part of an exim -d+all delivery when a user was over
quota:

10:50:48 18038 maildir_compute_size: 
path=/var/mail/virtual/cobergh.nl/cynthias.2097/Maildir/.Sent
10:50:48 18038   sum=2466048922 filecount=8701 timestamp=1644486536
[...]
10:50:48 18038 maildir_compute_size: 
path=/var/mail/virtual/cobergh.nl/cynthias.2097/Maildir/.Sent Messages
10:50:48 18038   sum=2466048922 filecount=13088 timestamp=1644486536

and sure enough, one of these directories is a symlink to the other:

root@mx-1:/var/spool/mail/virtual/cobergh.nl/cynthias.2097/Maildir# ls -asF  | 
fgrep .Sent
   4 .Sent/
   0 .Sent Messages@

root@mx-1:/var/spool/mail/virtual/cobergh.nl/cynthias.2097/Maildir# stat .Sent\ 
Messages
  File: .Sent Messages -> .Sent
  Size: 5   Blocks: 0  IO Block: 4096   symbolic link
[...]



I was surprised by the symlink behaviour so I'm reconsidering the use of
the dovecot plugin, but I still wanted to ask whether this behaviour is
considered OK. I've read the appendfile docs and I could find anything
explicit about symlinks.


the transport part of the config:


virtual_delivery:
  driver  = appendfile
  # let op: geen spatie voor de \ want dat wordt ".../Maildir "
  directory   = 
/var/mail/virtual/$domain/${sg{$local_part}{/}{-}}.${extract{user_id}{$address_data}}/Maildir\
${if bool{$acl_m_mailIsSpam}\
 {${if 
match_domain{$acl_m_connectionDomainname}{+martin_domains}\
   {}\
   {/.Junk}\
   }\
 }\
 {${if ! or{ {eq{$address_file}{}} 
{eq{$address_file}{inbox}}}\
   {/.${sg{$address_file}{/}{-}}}\
   {}\
   }\
 }\
}
  directory_mode  = 2750
  mode= 0640
  user= ${extract{uid}{$address_data}}
  group   = mail
  maildir_tag = ",S=$message_size,W=$message_size"
  headers_remove  = 
Lines:Content-Length:Status:X-IMAP:X-IMAPbase:X-Keywords:X-Status:X-UID:X-UIDL
  headers_add = "Lines: $body_linecount"
  use_crlf
  maildir_format
  create_directory
  delivery_date_add
  envelope_to_add
  return_path_add

  #quota opties
  quota = ${extract{quotum}{$address_data}}
  quota_size_regex  = S=(\d+)
  quota_is_inclusive= false
  maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash).*)$
  quota_warn_threshold  = 95%
  quota_warn_message= MSG_QUOTA
  maildir_use_size_file


thanks,
Maarten.

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Re: [exim] manualroute defer

2019-03-27 Thread Maarten van Baarsel via Exim-users

On 27-03-2019 10:40:17, Andrew C Aitchison wrote:

Hi Andrew,

Thank you for the reply!

Can someone shed some light on this? Should I be using multiple routers with 
an option I failed to find when reading the docs?


That might get exim to try more than one host each queue run.
However, if a smarthost is not responding, something is wrong.
You should be aiming for this not to happen.
If a smarthost does fail to respond, your aim is for something
sensible to happen eventually, not to try to maximise performance.
Thus I would be happy if the message is delivered by the next queue run.


I implemented hosts_override halfway but I dove into the docs again, and then 
stumbled over fallback_hosts in the routers chapter and I think I got it now:


dnslookup:
  driver   = manualroute
  transport= internal_smtp
  route_list   = * 192.168.84.30
  no_more


the transport:

internal_smtp:
  driver = smtp
  interface = OUTGOING_INTERFACE
  fallback_hosts = 192.168.84.31:192.168.84.32


seems to work as I test it. There's no other routers for that transport, so I 
hope it's OK.


thank you again!

Maarten.

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/