Re: LDA input validation

2015-01-23 Thread Joseph Tam

St?phane Cottin writes:


A typical .qmail file :

| /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" | /usr/bin/preline -f 
/usr/lib/dovecot/dovecot-lda -d "$EXT@$USER" -a "$EXT@$USER" -m "$EXT2"

When dspam segfault or is killed, preline receive an empty content and
only pass to dovecot-lda two headers ( Return-Path and Delivered-To ).
Then dovecot-lda delivers successfully and the original message
contents are lost.


Steffen Kaiser rightly points out:


That's the problem of the used Unix pipe and broken by design. The right
member of the pipe (preline) runs independendly of dspam and recieves no
content via pipe. Why should preline or dovecot-lda believe there is an
error? [... and suggests a wrapper script that aborts delivery on empty
dspam output.]


I'm not sure if it's appropriate under your circumstances, but you can also
pass stderr to stdout as well, and the recipient will get some diagnostic
message, which may or may not be helpful.

| /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" 2>&1 | 
...

Joseph Tam 


Mailbox corruption (dovecot 2.2.13, Debian 8)

2015-01-23 Thread Santiago Vila
Hello.

The attached mbox folder becomes corrupted in the server when being
retrieved by fetchmail using the --folder option.

This happens on a system running Debian jessie (i.e. dovecot 2.2.13)
using the default configuration.

I've reported this to Debian here:

https://bugs.debian.org/776094

but I thought it would be good to post it here as well in case it is
still a bug in the latest version (well, if it's not anymore a bug in
the latest version, a patch against 2.2.13 will surely help the Debian
maintainer in either case).

Thanks.

inbox-b.gz
Description: application/gzip


[PATCH] increase fd_limit to max_client_limit automatically

2015-01-23 Thread Lauri Tirkkonen
Hi, with a low soft limit on file descriptors, dovecot 2.2.15 warns on
startup:

Warning: fd limit (ulimit -n) is lower than required under max. load
(256 < 1000), because of default_client_limit

It could try increasing the limit first, and only report the warning if that
fails. I'm attaching a patch that does just this.

Without the patch, the soft fd limit is kept at whatever it was on dovecot
startup:

% pfexec plimit $(pgrep dovecot)
18737:  /opt/niksula/sbin/dovecot
   resource  current maximum
  time(seconds) unlimited   unlimited
  file(blocks)  unlimited   unlimited
  data(kbytes)  unlimited   unlimited
  stack(kbytes) 10240   unlimited
  coredump(blocks)  unlimited   unlimited
  nofiles(descriptors)  256 65536
  vmemory(kbytes)   unlimited   unlimited

and with patch applied, it's increased to max_client_limit:

% pfexec plimit $(pgrep dovecot) 
18775:  /opt/niksula/sbin/dovecot
   resource  current maximum
  time(seconds) unlimited   unlimited
  file(blocks)  unlimited   unlimited
  data(kbytes)  unlimited   unlimited
  stack(kbytes) 10240   unlimited
  coredump(blocks)  unlimited   unlimited
  nofiles(descriptors)  100065536
  vmemory(kbytes)   unlimited   unlimited

It should probably be increased to higher than that to account for fds
other than client sockets, but I don't have insights into that.

-- 
Lauri Tirkkonen
Niksula systems specialist
diff -r e30e9b2b0e37 src/master/master-settings.c
--- a/src/master/master-settings.c  Wed Jan 21 02:21:35 2015 +0200
+++ b/src/master/master-settings.c  Thu Jan 22 13:39:41 2015 +0200
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static bool master_settings_verify(void *_set, pool_t pool,
   const char **error_r);
@@ -418,7 +419,7 @@
 #ifdef CONFIG_BINARY
const struct service_settings *default_service;
 #else
-   rlim_t fd_limit;
+   struct rlimit fd_limit;
const char *max_client_limit_source = "default_client_limit";
unsigned int max_client_limit = set->default_client_limit;
 #endif
@@ -591,12 +592,18 @@
  client_limit, max_anvil_client_processes);
}
 #ifndef CONFIG_BINARY
-   if (restrict_get_fd_limit(&fd_limit) == 0 &&
-   fd_limit < (rlim_t)max_client_limit) {
-   i_warning("fd limit (ulimit -n) is lower than required "
- "under max. load (%u < %u), because of %s",
- (unsigned int)fd_limit, max_client_limit,
- max_client_limit_source);
+   if (getrlimit(RLIMIT_NOFILE, &fd_limit) == 0) {
+#ifdef HAVE_SETRLIMIT
+   rlim_t old = fd_limit.rlim_cur;
+   fd_limit.rlim_cur = I_MAX(old, max_client_limit);
+   if (setrlimit(RLIMIT_NOFILE, &fd_limit) < 0)
+   fd_limit.rlim_cur = old;
+#endif
+   if (fd_limit.rlim_cur < (rlim_t)max_client_limit)
+   i_warning("fd limit (ulimit -n) is lower than required "
+   "under max. load (%u < %u), because of %s",
+   (unsigned int)fd_limit.rlim_cur, max_client_limit,
+   max_client_limit_source);
}
 #endif
 


Fatal: master: service(imap): child 19549 killed with signal 11 (core dumped)

2015-01-23 Thread Gabriel Almaguer

hello.

Today I had a problem (core dumped) in a dovecot installation update 
yesterday.
After many hours I found that when one settings "protocol imap" the 
option "replication"

causes (core dumped).
In this server settings "replication" was removed leaving only the 
"protocol imap" (my error)

I send my documentation error so they can add a validation and not generate
  a Fatal Error end users.

Any other info you need please email me

Thank You.

dovecot-2.2.15

-/src/plugins/replication/replication-plugin.c

replication_mail_transaction_commit(void *txn,
struct 
mail_transaction_commit_changes *changes)

{
struct replication_mail_txn_context *ctx =
(struct replication_mail_txn_context *)txn;
struct replication_user *ruser =
REPLICATION_USER_CONTEXT(ctx->ns->user);
enum replication_priority priority;

if (ctx->new_messages || changes->changed) {
priority = !ctx->new_messages ? 
REPLICATION_PRIORITY_LOW :   <== linea 258 look dgb

ruser->sync_secs == 0 ? REPLICATION_PRIORITY_HIGH :
REPLICATION_PRIORITY_SYNC;
replication_notify(ctx->ns, priority);
}
i_free(ctx);
}



--- 
dovecot -n


protocol imap {
  mail_plugins = quota notify fts fts_squat zlib acl imap_zlib imap_acl 
quota imap_quota  replication

}

- 
/var/log/maillog
Jan 21 20:38:17 xx dovecot: imap(etrev...@xxx.com.mx): Fatal: 
master: service(imap): child 19549 killed with signal 11 (core dumped)

- /var/log/messages
Jan 21 20:38:17 xx kernel: imap[19549]: segfault at 0018 
rip 2aacb45ea645 rsp 7fffc2db7350 error 4


 strace
[pid 18265] fstat(4, {st_mode=S_IFREG|0600, st_size=32712, ...}) = 0
[pid 18265] write(4, "\200\200\200\205\4\0\0\0R\2\0\0R\2\0\0\10\0\0\0", 
20) = 20
[pid 18265] fcntl(4, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, 
len=0}) = 0
[pid 18265] 
stat("/var/spool/vdovecot/xx.com.mx/cduran/dovecot.index.log", 
{st_mode=S_IFREG|0600, st_size=32732, ...}) = 0

[pid 18265] fstat(4, {st_mode=S_IFREG|0600, st_size=32732, ...}) = 0
[pid 18265] munmap(0x2ab13f335000, 32712) = 0
[pid 18265] pread(4, "\200\200\200\205\4\0\0\0R\2\0\0R\2\0\0\10\0\0\0", 
8192, 32712) = 20

[pid 18265] pread(4, "", 8192, 32732)   = 0
[pid 18265] fstat(4, {st_mode=S_IFREG|0600, st_size=32732, ...}) = 0
[pid 18265] mmap(NULL, 32732, PROT_READ, MAP_SHARED, 4, 0) = 0x2ab13f335000
[pid 18265] madvise(0x2ab13f335000, 32732, MADV_SEQUENTIAL) = 0
[pid 18265] fstat(4, {st_mode=S_IFREG|0600, st_size=32732, ...}) = 0
[pid 18265] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 18265 detached
- 
gdb

Core was generated by `dovecot/imap'.
Program terminated with signal 11, Segmentation fault.
#0  replication_mail_transaction_commit (txn=0x18610d70, 
changes=0x7fff80ac1440) at replication-plugin.c:258

258 replication-plugin.c: No such file or directory.
in replication-plugin.c
(gdb) bt full
#0  replication_mail_transaction_commit (txn=0x18610d70, 
changes=0x7fff80ac1440) at replication-plugin.c:258

ctx = 
priority = 
#1  0x2ab29a975749 in notify_contexts_mail_transaction_commit 
(t=0x1861, changes=0x7fff80ac1440) at notify-plugin.c:132

ctx = 0x1859af70
mail_txn = 0x18610800
#2  0x2ab29a975d60 in notify_transaction_commit (t=0x1861, 
changes_r=0x7fff80ac1440) at notify-storage.c:182

lt = 0x18610d50
#3  0x2ab29a569beb in quota_mailbox_transaction_commit 
(ctx=0x1861, changes_r=0x7fff80ac1440) at quota-storage.c:134

qt = 0x18610d90
#4  0x2ab299bce134 in mailbox_transaction_commit_get_changes 
(_t=, changes_r=0x7fff80ac1440)

at mail-storage.c:1916
_data_stack_cur_id = 3
t = 0x1861
box = 0x18609610
save_count = 1
ret = 
__FUNCTION__ = "mailbox_transaction_commit_get_changes"
#5  0x0040b85c in cmd_append_parse_new_msg ()
No symbol table info available.
#6  0x0040b65b in cmd_append_continue_message ()
No symbol table info available.
#7  0x00416aa7 in command_exec ()
No symbol table info available.
#8  0x0040c191 in client_input_append ()
No symbol table info available.
#9  0x2ab299ee3689 in io_loop_call_io (io=0x1859c010) at ioloop.c:498
ioloop = 0x18585740
t_id = 2
__FUNCTION__ = "io_loop_call_io"
#10 0x2ab299ee4a45 in io_loop_handler_run_internal (ioloop=optimized out>) at ioloop-epoll.c:220

ctx = 
event = 0x18587240
list = 0x18587e30
io = 0x20

sendmail not invoking dovecot-lda

2015-01-23 Thread alvin

hi dovecot mailinglist 

- Configuration
FreeBSD-9.3
sendmail -d0.1  == sendmail-8.14.9  <<--
dovecot --version   == dovecot-2.2.15

# ===
# I'm trying to get sendmail to invoke dovecot.m4 ( dovecot-lda ) to
# deliver emails to dovecot's virtual users ( /etc/dovecot/passwd ) 
# or mysql/postgresql virtual users
#
#
# sendmail -bv dovecot.VirtualUser@localhost  --> returns "User Unknown"
#
# cat test.msg.txt | dovecot-lda -d  dovecot.VirtualUser  ===> works
#   email is delivered to dovecot.VirtualUser inbox
#
# ===

- there are tons of howto and comments for dovecot + postfix
  and very little for dovecot + sendmail ... therefore, it'd be 
  great if we/i can get this dovecot.m4 problem resolved

--
- status of what works and what does NOT work while testing dovecot's LDA ...
--
#
# fyi.. recepient user is in the form of user, user@localhost and 
u...@domain.com
#
sendmail -bv user.in/etc/passwd = deliverable
sendmail -bv user.in/etc/mail/virtusertable = deliverable to 
sendmail virtual user

-->>sendmail -bv dovecot.user.in/dovecot/virtual.passwd.file== user 
unknown

dovecot user user.in/etc/passwd == returns UID/GID/home/mailbox ( 
deliverable )
dovecot user dovecot.user   == returns UID/GID/home/mailbox ( 
deliverable )


# 
# dovecot's LDA delivers the test email to the dovecot/mysql recepient
# 
cat test-email-with-headers.txt | dovecot-lda -d dovecot.user   ( email 
delivered )


# 
-->># mail/mutt/sendmail canNOT deliver to dovecot recepient == FAILS
# 
-->>sendmail -bv dovecot.user.in/dovecot/virtual.passwd.file== user 
unknown
3
echo "testing mail to dovecot" | mail -v -s "testing mail to dovecot" 
doveccot.user
== user unknown ==

---
- my (relevant to dovecot ) sendmail.mc file looks like:
---

dnl #
dnl # local mail delivery
dnl #
define(`PROCMAIL_MAILER_PATH', `/usr/local/bin/procmail')dnl

FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl 

dnl #
dnl # I'm trying to get sendmail to use dovecot.m4 to deliver local mail
dnl # to dovecot's LDA ( dovecot-lda ) for mysql virtual users
dnl #
dnl uncomment and use either feature(...dovecot-lda) or 
mailer(dovecot.m4)
dnl
dnl FEATURE(`local_procmail', 
`/usr/local/libexec/dovecot/dovecot-lda',`/usr/local/libexec/dovecot/dovecot-lda
 -d $u')
dnl

MAILER(local)
MAILER(smtp)
dnl
dnl MAILER(dovecot)dnl  # did NOT work either
dnl
dnl # trying to use procmail to deliver local mail to system users ( 
/etc/passwd )
MAILER(procmail)
dnl
dnl # is the ordering of dovecot.m4 important relative to (local) and 
(procmail)
dnl
dnl # trying to use dovecot-lda to deliver email to dovecot's virtual 
users 
dnl # defined in /etc/dovecot/password
dnl
MAILER(dovecot)dnl  # see below
dnl
dnl End of File

---
- my (relevant to dovecot ) sendmail.cf file looks like:
---

# 
# lots of deleted ... ??not?? important until Mlocal  ---> MAILER(local)
#

Mlocal, P=/usr/libexec/mail.local, F=lsDFMAw5:/|@qPSXmnz9, 
S=EnvFromSMTP/HdrFromL, R=EnvToL/
HdrToL,
T=DNS/RFC822/SMTP,
A=mail.local -l
Mprog,  P=/bin/sh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, 
D=$z:/,
T=X-Unix/X-Unix/X-Unix,
A=sh -c $u

#
###   SMTP Mailer specification   ###
#

# 
# lots of deleted ... ??not?? important until procmail stuff ---> 
MAILER(procmail)
#

##*##
###   PROCMAIL Mailer specification   ###
##*##
#  $Id: procmail.m4,v 8.23 2013-11-22 20:51:14 ca Exp $  #

Mprocmail,  P=/usr/local/bin/procmail, F=DFMSPhnu9, 
S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFr
omSMTP,
T=DNS/RFC822/X-Unix,
A=pro

Re: sieve filter not working

2015-01-23 Thread Michael Williamson
On 1/23/15, Christian Kivalo  wrote:
> On 2015-01-23 18:04, Michael Williamson wrote:
>> HI,
> Hello,
>
>>
>>> You could set
>>>
>>> syslog_facility = local5
>>>
>>> and have all the log messages in the messages file.
>>
>> According to the output of command
>>
>>  # doveadm log find
>>
>> every type of message goes to the file I was looking at,
>> "/var/spool/maillog".
>>
> Ok, then the information should be in /var/log/messages when you up the
> verbosity in 10-logging.conf by setting
>
> mail_debug=yes
>
> and restart dovecot. This should work as expected and show what dovecot
> is doing.

I tried this again (set mail_debug=yes and restart dovecot) but no
dovecot messages appear in "/var/log/messages". I sent spam email,
too. Also, no change appears in the output of

 # doveadm log find

> Another question:
> Local mail delivery of received mail from external sources does indeed
> work?

Yes.

> If so, was that log excerpt in one of the former mails an example of
> such delivery?

There are dovecot messages in "/var/log/maillog" showing only
imap-login & disconnected.
When I monitor "/var/log/maillog" while sending spam, there are no
messages containing 'dovecot'. I attached that output to a previous
post. It has only messages from postfix and amavis.

>
>>
 So, is it postfix doing the local mail delivery, not dovecot?

>>> To answer this question please post relevant parts of your postfix
>>> main.cf
>>> - mailbox_command
>>> - virtual_transport
>>> - mailbox_transport
>>
>> Those three do not appear to be assigned in "main.cf" (two are
>> commented out
>> and 'virtual_transport' not there):
>>
>> # The mailbox_command parameter specifies the optional external
>> # command to use instead of mailbox delivery. The command is run as
>> # the recipient with proper HOME, SHELL and LOGNAME environment
>> settings.
>> # Exception:  delivery for root is done as $default_user.
>> #
>> # Other environment variables of interest: USER (recipient username),
>> # EXTENSION (address extension), DOMAIN (domain part of address),
>> # and LOCAL (the address localpart).
>> #
>> # Unlike other Postfix configuration parameters, the mailbox_command
>> # parameter is not subjected to $parameter substitutions. This is to
>> # make it easier to specify shell syntax (see example below).
>> #
>> # Avoid shell meta characters because they will force Postfix to run
>> # an expensive shell process. Procmail alone is expensive enough.
>> #
>> # IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
>> # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
>> #
>> #mailbox_command = /some/where/procmail
>> #mailbox_command = /some/where/procmail -a "$EXTENSION"
>>
>> # The mailbox_transport specifies the optional transport in master.cf
>> # to use after processing aliases and .forward files. This parameter
>> # has precedence over the mailbox_command, fallback_transport and
>> # luser_relay parameters.
>> #
>> # Specify a string of the form transport:nexthop, where transport is
>> # the name of a mail delivery transport defined in master.cf.  The
>> # :nexthop part is optional. For more details see the sample transport
>> # configuration file.
>> #
>> # NOTE: if you use this feature for accounts not in the UNIX password
>> # file, then you must update the "local_recipient_maps" setting in
>> # the main.cf file, otherwise the SMTP server will reject mail for
>> # non-UNIX accounts with "User unknown in local recipient table".
>> #
>> #mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
>>
> Ok, none set. Could you post the output of postconf to the list so we
> are able to see your running postfix config.

OK. It is long (631 lines).

2bounce_notice_recipient = postmaster
access_map_defer_code = 450
access_map_reject_code = 554
address_verify_default_transport = $default_transport
address_verify_local_transport = $local_transport
address_verify_map =
address_verify_negative_cache = yes
address_verify_negative_expire_time = 3d
address_verify_negative_refresh_time = 3h
address_verify_poll_count = ${stress?1}${stress:3}
address_verify_poll_delay = 3s
address_verify_positive_expire_time = 31d
address_verify_positive_refresh_time = 7d
address_verify_relay_transport = $relay_transport
address_verify_relayhost = $relayhost
address_verify_sender = $double_bounce_sender
address_verify_sender_dependent_relayhost_maps =
$sender_dependent_relayhost_maps
address_verify_service_name = verify
address_verify_transport_maps = $transport_maps
address_verify_virtual_transport = $virtual_transport
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_mail_to_commands = alias, forward
allow_mail_to_files = alias, forward
allow_min_user = no
allow_percent_hack = yes
allow_untrusted_routing = no
alternate_config_directories =
always_add_missing_headers = no
always_bcc =
anvil_rate_time_unit = 60s
anvil_status_update_time = 600s
append_at_myorigin = yes
append_dot_mydomain = yes
application_event_drain_time = 100s
authoriz

Re: sieve filter not working

2015-01-23 Thread Christian Kivalo

On 2015-01-23 18:04, Michael Williamson wrote:

HI,

Hello,




You could set

syslog_facility = local5

and have all the log messages in the messages file.


According to the output of command

 # doveadm log find

every type of message goes to the file I was looking at, 
"/var/spool/maillog".


Ok, then the information should be in /var/log/messages when you up the 
verbosity in 10-logging.conf by setting


mail_debug=yes

and restart dovecot. This should work as expected and show what dovecot 
is doing.


Another question:
Local mail delivery of received mail from external sources does indeed 
work?
If so, was that log excerpt in one of the former mails an example of 
such delivery?





So, is it postfix doing the local mail delivery, not dovecot?


To answer this question please post relevant parts of your postfix
main.cf
- mailbox_command
- virtual_transport
- mailbox_transport


Those three do not appear to be assigned in "main.cf" (two are 
commented out

and 'virtual_transport' not there):

# The mailbox_command parameter specifies the optional external
# command to use instead of mailbox delivery. The command is run as
# the recipient with proper HOME, SHELL and LOGNAME environment 
settings.

# Exception:  delivery for root is done as $default_user.
#
# Other environment variables of interest: USER (recipient username),
# EXTENSION (address extension), DOMAIN (domain part of address),
# and LOCAL (the address localpart).
#
# Unlike other Postfix configuration parameters, the mailbox_command
# parameter is not subjected to $parameter substitutions. This is to
# make it easier to specify shell syntax (see example below).
#
# Avoid shell meta characters because they will force Postfix to run
# an expensive shell process. Procmail alone is expensive enough.
#
# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
# ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
#
#mailbox_command = /some/where/procmail
#mailbox_command = /some/where/procmail -a "$EXTENSION"

# The mailbox_transport specifies the optional transport in master.cf
# to use after processing aliases and .forward files. This parameter
# has precedence over the mailbox_command, fallback_transport and
# luser_relay parameters.
#
# Specify a string of the form transport:nexthop, where transport is
# the name of a mail delivery transport defined in master.cf.  The
# :nexthop part is optional. For more details see the sample transport
# configuration file.
#
# NOTE: if you use this feature for accounts not in the UNIX password
# file, then you must update the "local_recipient_maps" setting in
# the main.cf file, otherwise the SMTP server will reject mail for
# non-UNIX accounts with "User unknown in local recipient table".
#
#mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp

Ok, none set. Could you post the output of postconf to the list so we 
are able to see your running postfix config.


I believe dovecot has actually nothing to do with delivering your mails 
so no sieve filters are applied...



Thanks,
-Mike

- christian


Re: sieve filter not working

2015-01-23 Thread Michael Williamson
HI,

> You could set
>
> syslog_facility = local5
>
> and have all the log messages in the messages file.

According to the output of command

 # doveadm log find

every type of message goes to the file I was looking at, "/var/spool/maillog".


>> So, is it postfix doing the local mail delivery, not dovecot?
>>
> To answer this question please post relevant parts of your postfix
> main.cf
> - mailbox_command
> - virtual_transport
> - mailbox_transport

Those three do not appear to be assigned in "main.cf" (two are commented out
and 'virtual_transport' not there):

# The mailbox_command parameter specifies the optional external
# command to use instead of mailbox delivery. The command is run as
# the recipient with proper HOME, SHELL and LOGNAME environment settings.
# Exception:  delivery for root is done as $default_user.
#
# Other environment variables of interest: USER (recipient username),
# EXTENSION (address extension), DOMAIN (domain part of address),
# and LOCAL (the address localpart).
#
# Unlike other Postfix configuration parameters, the mailbox_command
# parameter is not subjected to $parameter substitutions. This is to
# make it easier to specify shell syntax (see example below).
#
# Avoid shell meta characters because they will force Postfix to run
# an expensive shell process. Procmail alone is expensive enough.
#
# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
# ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
#
#mailbox_command = /some/where/procmail
#mailbox_command = /some/where/procmail -a "$EXTENSION"

# The mailbox_transport specifies the optional transport in master.cf
# to use after processing aliases and .forward files. This parameter
# has precedence over the mailbox_command, fallback_transport and
# luser_relay parameters.
#
# Specify a string of the form transport:nexthop, where transport is
# the name of a mail delivery transport defined in master.cf.  The
# :nexthop part is optional. For more details see the sample transport
# configuration file.
#
# NOTE: if you use this feature for accounts not in the UNIX password
# file, then you must update the "local_recipient_maps" setting in
# the main.cf file, otherwise the SMTP server will reject mail for
# non-UNIX accounts with "User unknown in local recipient table".
#
#mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp

Thanks,
-Mike


Re: Client shows null Sender & date

2015-01-23 Thread Reindl Harald


Am 23.01.2015 um 16:06 schrieb John Hendrich:

I'm using Postfix and Dovecot 2.0.19 and Virtual domains & users
(mysql).  Incoming mail is handled by Postfix and then handed off to
Dovecot LMTP for delivery.  However, the Sender and Date are essentially
null when viewing the email with either the POP3 or IMAP client.  The
logs (below) show this.  I changed the sender and recipient addresses
for privacy.

Jan 23 08:42:07 klsrv postfix/cleanup[10842]: 1F907F00276: message-id=<>
Jan 23 08:42:07 klsrv postfix/qmgr[4889]: 1F907F00276:
from=, size=217, nrcpt=1 (queue active)

You can see that Postfix accepts the incoming mail (from
sen...@example.com) and then the message is handed to Dovecot LMTP.  But
the from=: should be "from=sen...@example.com:".

Postfix / qmgr has the sender listed (from=) but no
sender (from=) is seen in LMTP log output.  My LMTP is setup to use UNIX
sockets, not the INET socket


you need to understand e-mail basics

what you see in the postfix logs is the *envelope sender*
what you miss in the message is the non-existent To-HEADER



signature.asc
Description: OpenPGP digital signature


Re: Client shows null Sender & date

2015-01-23 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Fri, 23 Jan 2015, John Hendrich wrote:


I'm using Postfix and Dovecot 2.0.19 and Virtual domains & users
(mysql).  Incoming mail is handled by Postfix and then handed off to
Dovecot LMTP for delivery.  However, the Sender and Date are essentially
null when viewing the email with either the POP3 or IMAP client.  The
logs (below) show this.  I changed the sender and recipient addresses
for privacy.

Jan 23 08:41:48 klsrv postfix/smtpd[10836]: 1F907F00276:
client=unknown[10.0.0.19]
Jan 23 08:42:07 klsrv postfix/cleanup[10842]: 1F907F00276: message-id=<>
Jan 23 08:42:07 klsrv postfix/qmgr[4889]: 1F907F00276:
from=, size=217, nrcpt=1 (queue active)
Jan 23 08:42:07 klsrv dovecot: lmtp(10845): Connect from local
Jan 23 08:42:07 klsrv dovecot: lmtp(10845, recipi...@example.net):
wvU2Gq9PwlRdKgAAjuDoqw: subject=test to client: from=:
msgid=unspecified: status=saved mail to INBOX:
Jan 23 08:42:07 klsrv postfix/lmtp[10844]: 1F907F00276:
to=,
relay=klsrv.airhop.net[private/dovecot-lmtp], delay=28,
delays=28/0.01/0.01/0.01, dsn=2.0.0, status=sent (250 2.0.0
 wvU2Gq9PwlRdKgAAjuDoqw Saved)
Jan 23 08:42:07 klsrv dovecot: lmtp(10845): Disconnect from local:
Client quit (in reset)
Jan 23 08:42:07 klsrv postfix/qmgr[4889]: 1F907F00276: removed

You can see that Postfix accepts the incoming mail (from
sen...@example.com) and then the message is handed to Dovecot LMTP.  But
the from=: should be "from=sen...@example.com:".

Postfix / qmgr has the sender listed (from=) but no
sender (from=) is seen in LMTP log output.  My LMTP is setup to use UNIX
sockets, not the INET socket.

Any help is appreciated.


1) Where is your Postfix conf, one can comment on?

2) The message-id is empty or absent, did you _verified_, that the message 
contains "From" and "Date" headers at all? I guess it does not contain 
them either.

So, no client can display missing information.
Postfix's "from" is the envelope from, that is storred in the Return-Path 
header in the message the client retrieves.


- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBVMJmS3z1H7kL/d9rAQJg/Qf9EOuwdzwfJrJZ2qqUhFHiq5PlbHoi8N4m
88LH3YrSsGFc30xZ6BCEPywdRJHDOtOkd8GiiV4q+T+wLopSrLpVqCUBgJaSsKsJ
2wMD7Nx4QYQZz8PHalhwR9Tnl5m9A6w8j8gemJnhvweLKFQyxLw0Z6NIzQEUNo14
XFTeJVeTHGBNC6BviX+PgAVQkk50gQd/ZH9FVB5FiNnE0TJWcm5Y1nMg1vzWZpBy
IvfAPzgXDnwkAocKAhqjxPTlLkg4JQ7vDcG4w3BQPQj9EeMT8bm3lDix0juLznvX
hu5sE3LJY6JDiBogAplR+TwDe7GXg+ndYKsIzUrIdxVYsROc46vf+g==
=M+qD
-END PGP SIGNATURE-


Re: LDA input validation

2015-01-23 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Fri, 23 Jan 2015, Stéphane Cottin wrote:


I'm using qmail + dspam + dovecot-lda.

A typical .qmail file :

| /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" | /usr/bin/preline -f 
/usr/lib/dovecot/dovecot-lda -d "$EXT@$USER" -a "$EXT@$USER" -m "$EXT2"

When dspam segfault or is killed, preline receive an empty content and only 
pass to dovecot-lda two headers ( Return-Path and Delivered-To ).


Those two lines are generated by dovecot-lda or preline.


Then dovecot-lda delivers successfully and the original message contents are 
lost.

Should dovecot-lda returns an error in such conditions ( invalid contents ) ? 
Qmail will keep it in the queue and retry delivery later.


That's the problem of the used Unix pipe and broken by design. The right 
member of the pipe (preline) runs independendly of dspam and recieves no 
content via pipe. Why should preline or dovecot-lda believe there is an 
error?


If preline does not have no nifty option to prevent this, replace the 
pipe by a shell script:


| /usr/local/bin/dspam-lda-wrapper.sh "$EXT@$USER" "$EXT2"

= /usr/local/bin/dspam-lda-wrapper.sh
#!/bin/bash

tmpf="/tmp/wrapper.$$.log"
trap 'rc=$?; rm -f $tmpf; exit $rc' EXIT

if /usr/bin/dspam --client --deliver=stdout --user "$1" >$tmpf; then
test -s $tmpf && /usr/bin/preline -f \
/usr/lib/dovecot/dovecot-lda -d "$1" -a "$1" -m "$2" <$tmpf
fi
==

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBVMJlQnz1H7kL/d9rAQK90Af9Fs+uZ6P0VxQL0r8PpR30hYt1MnExozpz
QXbhKMCrXv5fZwAZ6paAbQQ999Emjj0fyBEBKodgYoi3rQm5claJwb1/NzSotgxx
Kayc0WpPP2cPMR1QZBA1FmR6+XPyEQO1h8B6aYxNNVNELCMxzotQ5hBPsqrR8ajO
86TL7FYaz6EM5nqW7w/VwwqsPDiM3mlkgckQudMzxeupP/jGZiRAkWODznSRg4Wr
yHx257i8jWj3mV2vcew16tyBuwmc3g1renPSwjaUZoLsb2A9vyJjnr0qmBdfrkDz
LE6WICAJcZuxQtyy8naTExEGKyQUhBc0nOLVljZ6ZnVC15b8gHWYRw==
=WdEr
-END PGP SIGNATURE-


Client shows null Sender & date

2015-01-23 Thread John Hendrich
I'm using Postfix and Dovecot 2.0.19 and Virtual domains & users
(mysql).  Incoming mail is handled by Postfix and then handed off to
Dovecot LMTP for delivery.  However, the Sender and Date are essentially
null when viewing the email with either the POP3 or IMAP client.  The
logs (below) show this.  I changed the sender and recipient addresses
for privacy.

Jan 23 08:41:48 klsrv postfix/smtpd[10836]: 1F907F00276:
client=unknown[10.0.0.19]
Jan 23 08:42:07 klsrv postfix/cleanup[10842]: 1F907F00276: message-id=<>
Jan 23 08:42:07 klsrv postfix/qmgr[4889]: 1F907F00276:
from=, size=217, nrcpt=1 (queue active)
Jan 23 08:42:07 klsrv dovecot: lmtp(10845): Connect from local
Jan 23 08:42:07 klsrv dovecot: lmtp(10845, recipi...@example.net):
wvU2Gq9PwlRdKgAAjuDoqw: subject=test to client: from=:
msgid=unspecified: status=saved mail to INBOX:
Jan 23 08:42:07 klsrv postfix/lmtp[10844]: 1F907F00276:
to=,
relay=klsrv.airhop.net[private/dovecot-lmtp], delay=28,
delays=28/0.01/0.01/0.01, dsn=2.0.0, status=sent (250 2.0.0
 wvU2Gq9PwlRdKgAAjuDoqw Saved)
Jan 23 08:42:07 klsrv dovecot: lmtp(10845): Disconnect from local:
Client quit (in reset)
Jan 23 08:42:07 klsrv postfix/qmgr[4889]: 1F907F00276: removed

You can see that Postfix accepts the incoming mail (from
sen...@example.com) and then the message is handed to Dovecot LMTP.  But
the from=: should be "from=sen...@example.com:".

Postfix / qmgr has the sender listed (from=) but no
sender (from=) is seen in LMTP log output.  My LMTP is setup to use UNIX
sockets, not the INET socket.

Any help is appreciated.


LDA input validation

2015-01-23 Thread Stéphane Cottin
Hi,

I'm using qmail + dspam + dovecot-lda.

A typical .qmail file :

| /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" | 
/usr/bin/preline -f /usr/lib/dovecot/dovecot-lda -d "$EXT@$USER" -a 
"$EXT@$USER" -m "$EXT2"

When dspam segfault or is killed, preline receive an empty content and only 
pass to dovecot-lda two headers ( Return-Path and Delivered-To ).
Then dovecot-lda delivers successfully and the original message contents are 
lost. 

Should dovecot-lda returns an error in such conditions ( invalid contents ) ? 
Qmail will keep it in the queue and retry delivery later.

Stéphane

Re: from Cyrus to Dovecot, seen status on cyrus.index files

2015-01-23 Thread Jogi Hofmüller
Hi,

Am 2015-01-23 um 14:25 schrieb Norberto Bensa:

> I've used dsync but it's too slow.

Yes, that's also what we experienced and why we went to cyrus2dovecot.

> Also, I have some users with shared mailboxes. Those mailboxes get
> duplicated. Either this is the way it works or I'm doing something wrong.
> If I could get dsync to not duplicate shared mailboxes, I think I could use
> it.

Duplication was not a problem when we migrated.  The side effect we had
was that all mail in a shared mailbox was marked new for all the
sharers.  We could not get cyrus2dovecot to use user's flags for shared
mailboxes.  Apart from that everything worked really well.

Regards,
-- 
J.Hofmüller

Ein literarisches Meisterwerk ist nur ein Wörterbuch in Unordnung.
  - Jean Cocteau



signature.asc
Description: OpenPGP digital signature


Re: sieve filter not working

2015-01-23 Thread Oscar del Rio

On 22/01/2015 2:11 PM, Michael Williamson wrote:

I put a sieve filter in users home directory, "/home/user/.dovecot.sieve":

require ["fileinto"];
# Move spam to spam folder
if header :contains "X-Spam-Flag" ["YES"] {
   fileinto "Maildir/.SPAM";
   stop;
}


http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples

require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
  fileinto "Spam";
}


Re: from Cyrus to Dovecot, seen status on cyrus.index files

2015-01-23 Thread Norberto Bensa
2015-01-23 4:20 GMT-03:00 Marc Stürmer :

>
> Zitat von Norberto Bensa :
>
>  Does anyone use cyrus2dovecot for migrations? If so, how do you deal with
>> seen status when it is stored in the .index files?
>>
>
> Why don't you use the migration tool that comes with Dovecot bundled
> instead, namely dsync? It claims to preserve almost virtually everything
> from the old server.
>


I've used dsync but it's too slow.

Also, I have some users with shared mailboxes. Those mailboxes get
duplicated. Either this is the way it works or I'm doing something wrong.
If I could get dsync to not duplicate shared mailboxes, I think I could use
it.

Thanks for the suggestion.

Regards,
Norberto


Re: from Cyrus to Dovecot, seen status on cyrus.index files

2015-01-23 Thread Jogi Hofmüller
Hi,

Am 2015-01-23 um 09:36 schrieb Heiko Schlichting:

>> Does anyone use cyrus2dovecot for migrations?
> 
> Yes, but this software which is not related to the one you mention:
> 
> http://www.cyrus2dovecot.sw.fu-berlin.de/

The two are identical.  Apparently someone put cyrus2dovecot on github.
 Maybe it will change in the future.

However, we recently migrated from cyrus to dovecot using this piece of
software.

The thing you are looking for is probably the switch -S,
--cyrus-seen=PATH with which you tell the script where to find the cyrus
seen.db.  Using this we had no problems with seen flags for regular
mailboxes.  But migrating shared mailboxes was a PITA ... so if you have
these, be prepared for troubles.

Regards,
-- 
j.hofmüller

mur.sat -- a space art projecthttp://sat.mur.at/



signature.asc
Description: OpenPGP digital signature


Re: Easiest way to compile dovecot on Ubuntu 14.04

2015-01-23 Thread Kevin Laurie
Dear Marc,
Noted.
I just found out on iRedmail the plugins need to be specified in
dovecot.conf instead of dovecot/conf.d/90-plugin.conf .
Making the changes now. Hopefully it should work.
Will check out the testing page.
Thanks
Kevin

On Fri, Jan 23, 2015 at 3:18 PM, Marc Stürmer  wrote:

> Am 23.01.2015 um 08:47 schrieb Kevin Laurie:
>
>  Dear Marc.
>> Thanks =)
>> Already have dovecot-solr installed.
>> Is there a way to see if dovecot-solr is actually working?
>>
>
> Yes.
>
> http://wiki2.dovecot.org/Plugins/FTS/Solr - look there at "Testing."
>
> Use a mailbox for it with at least some megabytes of data. If you don't
> see then upgrade notices, it it not working yet.
>
> The notices may look like this:
>
> * OK Indexed 11% of the mailbox, ETA 1:12
> * OK Indexed 30% of the mailbox, ETA 1:07
> * OK Indexed 49% of the mailbox, ETA 0:52
> * OK Indexed 61% of the mailbox, ETA 0:43
> * OK Indexed 80% of the mailbox, ETA 0:22
> * OK Mailbox indexing finished
> * SEARCH 857 1486 1526 1544 1589 1590 1591 1608 1737 1753 2660 2864 3967
> 4124 4127 4129 4159 4235 4254 4273 4682 4683 4684 4685 4770 5132 5467 5470
> 5735 5788 5838 5903 5904 5905 5906 5907 5996 6024 6113 6144
> 1 OK Search completed (114.650 secs)
>
> If you don't see those, enable debugging in dovecot.conf and then you need
> to further investigate on where there's the problem.
>


Re: from Cyrus to Dovecot, seen status on cyrus.index files

2015-01-23 Thread Heiko Schlichting
Hi

> Using cyrus2dovecot (https://github.com/a-schild/cyrus2dovecot) I have
> migrated some test mailboxes from Cyrus (2.4.17) to Dovecot (2.2.9).
> 
> The problem I'm having is that the seen status is in cyrus.index files,
> which cyrus2dovecot doesn't understand.
> 
> Does anyone use cyrus2dovecot for migrations?

Yes, but this software which is not related to the one you mention:

http://www.cyrus2dovecot.sw.fu-berlin.de/

Heiko


Re: Easiest way to compile dovecot on Ubuntu 14.04

2015-01-23 Thread Marc Stürmer

Am 23.01.2015 um 08:47 schrieb Kevin Laurie:


Dear Marc.
Thanks =)
Already have dovecot-solr installed.
Is there a way to see if dovecot-solr is actually working?


Yes.

http://wiki2.dovecot.org/Plugins/FTS/Solr - look there at "Testing."

Use a mailbox for it with at least some megabytes of data. If you don't 
see then upgrade notices, it it not working yet.


The notices may look like this:

* OK Indexed 11% of the mailbox, ETA 1:12
* OK Indexed 30% of the mailbox, ETA 1:07
* OK Indexed 49% of the mailbox, ETA 0:52
* OK Indexed 61% of the mailbox, ETA 0:43
* OK Indexed 80% of the mailbox, ETA 0:22
* OK Mailbox indexing finished
* SEARCH 857 1486 1526 1544 1589 1590 1591 1608 1737 1753 2660 2864 3967 
4124 4127 4129 4159 4235 4254 4273 4682 4683 4684 4685 4770 5132 5467 
5470 5735 5788 5838 5903 5904 5905 5906 5907 5996 6024 6113 6144

1 OK Search completed (114.650 secs)

If you don't see those, enable debugging in dovecot.conf and then you 
need to further investigate on where there's the problem.