doveadm import - strange warning

2015-07-16 Thread Ralf Hildebrandt
I'm using the doveadm import command to extract mails from my backup:

% doveadm import -u restore@backup.invalid mdbox:/home/copymail/mdbox "" \
   mailbox INBOX header Delivered-To backup+$SEARCHPATTERN@backup.invalid

This works like a charm, I'm getting all the mails, and I can access
the newly generated mailbox.

But when executing the command I'm getting an annoying warning:

doveadm(restore@backup.invalid): Error: chdir(/root/) failed: Permission denied 
(euid=1001(copymail) egid=1001(copymail) missing +x perm: /root, dir owned by 
0:0 mode=0700)
doveadm(restore@backup.invalid): Error: chdir(/root) failed: Permission denied

I'm using a file based authentication:

# cat passwd
restore@backup.invalid:{SHA}+/...the.hash...:1001:1001:(gecos):/home/restore::

So why is "restore@backup.invalid" being associated with /root?

I'm using 2:2.2.18-1~auto+91, but the warning has been around for ages
:)

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein


[Patch] Fix hang in safe_sendfile on SmartOS

2015-07-16 Thread Sebastian Wiedenroth
# HG changeset patch
# User Sebastian Wiedenroth 
# Date 1437050484 -7200
#  Thu Jul 16 14:41:24 2015 +0200
# Node ID 7ef3a533b097e8e6590e754dc56ad308ab29233b
# Parent  e3640ccaa76d77a9658126d1f8f306480dad8af7
Fix hang in safe_sendfile on SmartOS

The call to sendfile on SmartOS can fail with EOPNOTSUPP. This is a valid error
code and documented in the man page. This error code needs to be handled or
else dovecot will retry the sendfile call endlessly and hang.

diff -r e3640ccaa76d -r 7ef3a533b097 src/lib/sendfile-util.c
--- a/src/lib/sendfile-util.c   Sat Jan 10 04:32:42 2015 +0200
+++ b/src/lib/sendfile-util.c   Thu Jul 16 14:41:24 2015 +0200
@@ -116,7 +116,7 @@
if (errno == EINVAL) {
/* most likely trying to read past EOF */
ret = 0;
-   } else if (errno == EAFNOSUPPORT) {
+   } else if (errno == EAFNOSUPPORT || errno == EOPNOTSUPP) {
/* not supported, return Linux-like EINVAL so caller
   sees only consistent errnos. */
errno = EINVAL;


question on Dovecot replication

2015-07-16 Thread Arnold Wang
I'm running Dovecot 2.2.x and have a question on its replication capability.
I plan to run Dovecot in two different sites with two nodes at each site. My 
question is how many replication partners can each Dovecot node have? Can I 
define three "mail_replica" entries in every node so any message received by 
one node will be replicated to three other nodes automatically?
Thanks in advance for your help.


Quota policy service not rejecting messages when user over quota

2015-07-16 Thread james
For some very odd reason, the quota-status service is failing to enforce 
quotas. Every other aspect of my configuration is working with 
absolutely no problems. When I attempt delivery via LTMP, the message 
is, as expected, rejected due to the user's inbox being full.


root@smtp:/usr/local/etc/mail-config # nc -U 
/var/spool/postfix/private/dovecot-lmtp

< 220 mx0.lottspot.com Dovecot ready.

LHLO localhost

< 250-mx0.lottspot.com
< 250-8BITMIME
< 250-ENHANCEDSTATUSCODES
< 250 PIPELINING

MAIL FROM:

< 250 2.1.0 OK

RCPT TO:
< 552 5.2.2  Quota exceeded (mailbox for user is 
full)


The policy service however, just lets everything go right through. I 
know that accessing the userdb is not an issue, because I passed a bogus 
user before passing my real user and received the expected response.


root@smtp:/usr/local/etc/mail-config # nc -U 
/var/spool/postfix/private/policy-quota

recipient=n...@fake.tld


< action=551 User not found
<

recipient=ja...@lottspot.vpn


< action=250 Quota status success
<

I'm using Dovecot 2.2.15, and I have included my quota configuration 
below. If anyone wants to see full doveconf -n output, I can provide it, 
but figured it was a bit much for this case. Thanks in advance for any 
pointers!


--> Note: I'm the quota_status_* directives have been set as is for 
testing purposes only. I'm fully aware not to do that in production.


plugin {
  quota = maildir:User quota
  quota_rule  = *:bytes=1G
  quota_rule2 = Trash:storage=+10%%
  quota_status_success = "250 Quota status success"
  quota_status_nouser  = "551 User not found"
  quota_status_overquota = "552 5.2.2 Recipient mailbox is full"
}
service quota-status {
  executable = quota-status -p postfix
  unix_listener /var/spool/postfix/private/policy-quota {
user  = postfix
group = wheel
mode  = 0666
  }
}


[Sieve] Unable to fileinto subfolders

2015-07-16 Thread james

Hello again list!

I am configuring a server running Dovecot 2.2.15 (Pigeonhole 0.4.6), and 
I am having an issue with Sieve scripts where I cannot sort messages 
into a subfolder of a mailbox. An email which is matched by the 
following script:


require "fileinto";
if header :contains "Subject" "[SORT ME]" { fileinto "INBOX.Sorted"; }

Yields the following error:

Jul 16 18:54:46 smtp dovecot: lmtp(ja...@lottspot.vpn): Error: 
DiJmNGZgqFWLFAEANWXNPw: sieve: msgid=<4973528.yvy4Yu8Tt4@arch_project>: 
failed to store into mailbox 'INBOX.Sorted': Character not allowed in 
mailbox name: '.'


As far as I can tell based on the Sieve usage page in the wiki 
(http://wiki2.dovecot.org/Pigeonhole/Sieve/Usage), this is *supposed* to 
work. I have included my namespace configuration below, but if anyone 
wants the whole doveconf -n, I will gladly provide it. Thanks in advance 
for any help!


namespace inbox {
  type = private
  separator = /
  prefix =
  inbox = yes
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox Spam {
auto = subscribe
special_use = \Junk
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
}
namespace {
  type = shared
  separator = /
  prefix = shared/%%d/%%n/
  location = 
maildir:/home/%%d/%%n/mail:INDEX=~/indexes/%%d/%%n:INDEXPVT=~/indexes/%%d/%%n

  subscriptions = no
  list = children
}


Re: [Sieve] Unable to fileinto subfolders

2015-07-16 Thread Christian Kivalo


Am 17. Juli 2015 04:10:50 MESZ, schrieb ja...@lottspot.com:
>Hello again list!
>

Hello,

>
>require "fileinto";
>if header :contains "Subject" "[SORT ME]" { fileinto "INBOX.Sorted"; }
>
>Yields the following error:
>
>Jul 16 18:54:46 smtp dovecot: lmtp(ja...@lottspot.vpn): Error: 
>DiJmNGZgqFWLFAEANWXNPw: sieve: msgid=<4973528.yvy4Yu8Tt4@arch_project>:
>
>failed to store into mailbox 'INBOX.Sorted': Character not allowed in 
>mailbox name: '.'

[snip]

>namespace inbox {
>   type = private
>   separator = /
>   prefix =
>   inbox = yes

Your path does not exist. You use INBOX.Sorted in your sieve script but have 
set / as separator in the namespace config.

Sieve expects a directory "INBOX.Sorted" in your maildir, the dirctory probably 
exists as "INBOX" with a subdirectory "Sorted" inside.

Changeing the fileinto in the sieve script to "INBOX/Sorted" ahould sort things 
out.


regards
 - christian


Re: [Sieve] Unable to fileinto subfolders

2015-07-16 Thread James Lott
Goodness gracious. I have no idea how I overlooked that. You are, of course, 
correct, and that immediately resolved the issue. Thanks for the help getting 
that sorted!

On Friday, July 17, 2015 06:56:39 Christian Kivalo wrote:
> Am 17. Juli 2015 04:10:50 MESZ, schrieb ja...@lottspot.com:
> >Hello again list!
> 
> Hello,
> 
> >require "fileinto";
> >if header :contains "Subject" "[SORT ME]" { fileinto "INBOX.Sorted"; }
> >
> >Yields the following error:
> >
> >Jul 16 18:54:46 smtp dovecot: lmtp(ja...@lottspot.vpn): Error:
> >DiJmNGZgqFWLFAEANWXNPw: sieve: 
msgid=<4973528.yvy4Yu8Tt4@arch_project>:
> >
> >failed to store into mailbox 'INBOX.Sorted': Character not allowed in
> >mailbox name: '.'
> 
> [snip]
> 
> >namespace inbox {
> >
> >   type = private
> >   separator = /
> >   prefix =
> >   inbox = yes
> 
> Your path does not exist. You use INBOX.Sorted in your sieve script but have
> set / as separator in the namespace config.
> 
> Sieve expects a directory "INBOX.Sorted" in your maildir, the dirctory
> probably exists as "INBOX" with a subdirectory "Sorted" inside.
> 
> Changeing the fileinto in the sieve script to "INBOX/Sorted" ahould sort
> things out.
> 
> 
> regards
>  - christian

-- 
James Lott
-- 
James Lott


Re: Quota policy service not rejecting messages when user over quota

2015-07-16 Thread James Lott
This issue was another silly oversight on my part. It turns out I had 
neglected to include 'quota' in my mail_plugins directive. For shame.

On Thursday, July 16, 2015 18:42:50 ja...@lottspot.com wrote:
> For some very odd reason, the quota-status service is failing to enforce
> quotas. Every other aspect of my configuration is working with
> absolutely no problems. When I attempt delivery via LTMP, the message
> is, as expected, rejected due to the user's inbox being full.
> 
> root@smtp:/usr/local/etc/mail-config # nc -U
> /var/spool/postfix/private/dovecot-lmtp
> < 220 mx0.lottspot.com Dovecot ready.
> 
> > LHLO localhost
> 
> < 250-mx0.lottspot.com
> < 250-8BITMIME
> < 250-ENHANCEDSTATUSCODES
> < 250 PIPELINING
> 
> > MAIL FROM:
> 
> < 250 2.1.0 OK
> 
> > RCPT TO:
> 
> < 552 5.2.2  Quota exceeded (mailbox for user is
> full)
> 
> The policy service however, just lets everything go right through. I
> know that accessing the userdb is not an issue, because I passed a bogus
> user before passing my real user and received the expected response.
> 
> root@smtp:/usr/local/etc/mail-config # nc -U
> /var/spool/postfix/private/policy-quota
> 
> > recipient=n...@fake.tld
> 
> < action=551 User not found
> <
> 
> > recipient=ja...@lottspot.vpn
> 
> < action=250 Quota status success
> <
> 
> I'm using Dovecot 2.2.15, and I have included my quota configuration
> below. If anyone wants to see full doveconf -n output, I can provide it,
> but figured it was a bit much for this case. Thanks in advance for any
> pointers!
> 
> --> Note: I'm the quota_status_* directives have been set as is for
> testing purposes only. I'm fully aware not to do that in production.
> 
> plugin {
>quota = maildir:User quota
>quota_rule  = *:bytes=1G
>quota_rule2 = Trash:storage=+10%%
>quota_status_success = "250 Quota status success"
>quota_status_nouser  = "551 User not found"
>quota_status_overquota = "552 5.2.2 Recipient mailbox is full"
> }
> service quota-status {
>executable = quota-status -p postfix
>unix_listener /var/spool/postfix/private/policy-quota {
>  user  = postfix
>  group = wheel
>  mode  = 0666
>}
> }

-- 
James Lott