Re: [Dovecot] Dovecot-Antispam 2.0 with SpamAssassin (sa-learn)

2011-08-18 Thread Nick Rosier

Tom Hendrikx wrote:

On 17/08/11 08:26, Nikita Koshikov wrote:

On Tue, 16 Aug 2011 22:38:34 +0200
Nick Rosier wrote:


Hi,

has anyone figured out how to use the dovecot-antispam plugin with
sa-learn? I need to pass the username (u...@domain.tld) to sa-learn and
--ham or --spam depending on the move. I was thinking of using the CRM14
option and replace the command and arguments but cannot find anything
about the ability to pass the username.
Any pointers would be welcome.

N.

Write a wrapper on sa-learn. The script should parse env first and that exec 
learning with appropriative args, like:
antispam_mail_sendmail = /etc/dovecot/plugins/spam.sh

Scrip, something like:
#!/bin/bash

(
env>  /tmp/antispam.$$
/usr/bin/sa-learn $@
exit 0
)
search for PWD environment in  /tmp/antispam.$$ .




I use the dspam backend and pass the user into the commandline with %u,
which seems to work, but is not documented in the man page.

To be clear, this is with the plugin from:
http://wiki2.dovecot.org/Plugins/Antispam
I've currently got it working with the MailTrain backend. Might consider 
reconfiguring it to dspam backend as I need to do some ENV parsing to 
get the user. Using %u as argument to pass to the wrapper would be 
easier but I couldn't find anything in de documentation as you said.


N.


Re: [Dovecot] Dovecot-Antispam 2.0 with SpamAssassin (sa-learn)

2011-08-18 Thread Tom Hendrikx
On 18/08/11 10:53, Nick Rosier wrote:
> Tom Hendrikx wrote:
>> On 17/08/11 08:26, Nikita Koshikov wrote:
>>> On Tue, 16 Aug 2011 22:38:34 +0200
>>> Nick Rosier wrote:
>>>
 Hi,

 has anyone figured out how to use the dovecot-antispam plugin with
 sa-learn? I need to pass the username (u...@domain.tld) to sa-learn and
 --ham or --spam depending on the move. I was thinking of using the
 CRM14
 option and replace the command and arguments but cannot find anything
 about the ability to pass the username.
 Any pointers would be welcome.

 N.
>>> Write a wrapper on sa-learn. The script should parse env first and
>>> that exec learning with appropriative args, like:
>>> antispam_mail_sendmail = /etc/dovecot/plugins/spam.sh
>>>
>>> Scrip, something like:
>>> #!/bin/bash
>>>
>>> (
>>> env>  /tmp/antispam.$$
>>> /usr/bin/sa-learn $@
>>> exit 0
>>> )
>>> search for PWD environment in  /tmp/antispam.$$ .
>>>
>>>
>>
>> I use the dspam backend and pass the user into the commandline with %u,
>> which seems to work, but is not documented in the man page.
>>
>> To be clear, this is with the plugin from:
>> http://wiki2.dovecot.org/Plugins/Antispam
> I've currently got it working with the MailTrain backend. Might consider
> reconfiguring it to dspam backend as I need to do some ENV parsing to
> get the user. Using %u as argument to pass to the wrapper would be
> easier but I couldn't find anything in de documentation as you said.
> 
> N.
> 

I don't think that the backend has anything to do with the supported
variables (http://wiki2.dovecot.org/Variables), but you should check the
source to be sure.

Maybe Eugene is triggered to create a release when you contribute some
documentation on this :)

-- 
Regards,
Tom


Re: [Dovecot] sender for Sieve vacation message

2011-08-18 Thread Florian Effenberger
Hi,

2011/8/18 Stephan Bosch :

> You can use the :from parameter, e.g.:
>
> require "vacation";
> vacation :from "flo...@gmail.com" "Not here at the moment!";
>
> Read RFC5230 (http://tools.ietf.org/html/rfc5230) for more info.

d'oh! Sometimes things are that simply... sorry for the dull question
- seems I've read an old RFC where :from wasn't specified yet. Works
like a charm now. :)

Thanks!
Florian


[Dovecot] dovecot with pam - ldap

2011-08-18 Thread Daniel Aschauer
I am running dovecot v1.2.10 on a FreeBSD server and I am facing problems
authenticating using pam.
I always get the error message, although I do provide the right password:
pam_authenticate() failed: authentication error (password mismatch?)

I use /etc/pam.d/imap:
#
# PAM configuration for the "imap" service
#
# auth
authsufficient  /usr/local/lib/pam_ldap.so no_warn
try_first_pass
authrequiredpam_unix.so no_warn
try_first_pass
# account
account requiredpam_unix.so

and my config:

srvfbsd01# dovecot -n
# 1.2.10: /usr/local/etc/dovecot.conf
# OS: FreeBSD 8.0-RELEASE-p2 amd64
protocols: imap
ssl: no
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
verbose_proctitle: yes
first_valid_uid: 1000
first_valid_gid: 0
mail_location: maildir:~/Maildir
namespace:
  type: private
  separator: .
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: public
  separator: .
  prefix: Public.
  location: maildir:/home/vmail/public
  list: yes
auth default:
  debug: yes
  passdb:
driver: pam
args: failure_show_msg=yes cache_key=%u imap
  passdb:
driver: passwd-file
args: /usr/local/etc/dovecot/vmail
  userdb:
driver: passwd
  userdb:
driver: passwd-file
args: /usr/local/etc/dovecot/vmail

Logging:

Aug 18 12:48:10 srvfbsd01 dovecot: auth(default): passwd-file
/usr/local/etc/dovecot/vmail: Read 6 users
Aug 18 12:48:10 srvfbsd01 dovecot: auth-worker(default): passwd-file
/usr/local/etc/dovecot/vmail: Read 6 users
Aug 18 12:48:11 srvfbsd01 dovecot: auth(default): new auth connection:
pid=3690
Aug 18 12:48:11 srvfbsd01 dovecot: auth(default): new auth connection:
pid=3688
Aug 18 12:48:11 srvfbsd01 dovecot: auth(default): new auth connection:
pid=3689
Aug 18 12:48:14 srvfbsd01 dovecot: auth(default): client in: AUTH   1
PLAIN   service=imaplip=10.0.10.150 rip=10.0.10.71  lport=143
rport=3583
Aug 18 12:48:14 srvfbsd01 dovecot: auth(default): client out: CONT  1
Aug 18 12:48:14 srvfbsd01 dovecot: auth(default): client in: CONT
Aug 18 12:48:14 srvfbsd01 dovecot: auth-worker(default):
pam(daniel,10.0.10.71): lookup service=imap
Aug 18 12:48:14 srvfbsd01 dovecot: auth-worker(default):
pam(daniel,10.0.10.71): #1/1 style=1 msg=Password:
Aug 18 12:48:14 srvfbsd01 dovecot: auth-worker(default):
pam(daniel,10.0.10.71): pam_authenticate() failed: authentication error
(password mismatch?)
Aug 18 12:48:14 srvfbsd01 dovecot: auth(default):
passwd-file(daniel,10.0.10.71): lookup: user=daniel
file=/usr/local/etc/dovecot/vmail
Aug 18 12:48:14 srvfbsd01 dovecot: auth(default):
passwd-file(daniel,10.0.10.71): unknown user
Aug 18 12:48:14 srvfbsd01 dovecot: auth(default): new auth connection:
pid=3691
Aug 18 12:48:16 srvfbsd01 dovecot: auth(default): client out: FAIL  1
user=daniel
Aug 18 12:48:21 srvfbsd01 dovecot: auth(default): client in: AUTH   2
PLAIN   service=imaplip=10.0.10.150 rip=10.0.10.71  lport=143
rport=3583  resp=
Aug 18 12:48:21 srvfbsd01 dovecot: auth-worker(default):
pam(daniel,10.0.10.71): lookup service=imap
Aug 18 12:48:21 srvfbsd01 dovecot: auth-worker(default):
pam(daniel,10.0.10.71): #1/1 style=1 msg=Password:
Aug 18 12:48:21 srvfbsd01 dovecot: auth-worker(default):
pam(daniel,10.0.10.71): pam_authenticate() failed: authentication error
(password mismatch?)
Aug 18 12:48:21 srvfbsd01 dovecot: auth(default):
passwd-file(daniel,10.0.10.71): lookup: user=daniel
file=/usr/local/etc/dovecot/vmail
Aug 18 12:48:21 srvfbsd01 dovecot: auth(default):
passwd-file(daniel,10.0.10.71): unknown user
Aug 18 12:48:23 srvfbsd01 dovecot: auth(default): client out: FAIL  2
user=daniel


Re: [Dovecot] Bug report v2.0.13 - CentOS x86_64 - NFS - mbox - Problem reproduced

2011-08-18 Thread Kostas Zorbadelos

On 08/16/2011 04:42 PM, Kostas Zorbadelos wrote:

On 08/15/2011 11:17 AM, kzo...@otenet.gr wrote:

Quoting Timo Sirainen:



OK,

we managed to reproduce the problem with the following scenario.

Using Thunderbird (3.1.11 if that matters) we set up a mail account 
using POP served by dovecot. In the account settings we have checked the 
boxes "Leave messages on server" and "Until I delete them" which is the 
default setting for new accounts.


We make the first POP session and get the mails. We then delete a 
message (moving it to trash) and try to Get Mails. Dovecot crashes with 
the aforementioned stack trace (included below). If you again try Get 
Mail in the client, you get the deleted mail again.


It seems to be related to the indexing code since if we change the setting

mbox_min_index_size

to something bigger than the mailbox (so no cache index files are 
created) the problem does not appear and the mails get deleted from the 
server normally. We didn't manage to reproduce the problem with 
Microsoft Outlook.


We 'll keep investigating until we have a fix.

Regards,

Kostas


With a quick test I can't reproduce pop3_lock_session=yes causing a
crash. I guess it needs something else besides what I tested. It would
be helpful if your Dovecot binaries weren't stripped of debug symbols. I
could then ask for some more information from the core dumps with gdb.





Timo, all

here is a backtrace with debuging symbols in the executables:

[root@pop08 ]# gdb /opt/dovecot-debug/libexec/dovecot/pop3 core.2929
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-32.el5_6.2)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /opt/dovecot-debug/libexec/dovecot/pop3...done.
BFD: Warning: /var/mail7/folders/P/K/U/amihal/core.2929 is truncated: expected 
core file size>= 569344, found: 565248.
Reading symbols from 
/opt/dovecot-debug/lib/dovecot/libdovecot-storage.so.0...done.
Loaded symbols for /opt/dovecot-debug/lib/dovecot/libdovecot-storage.so.0
Reading symbols from /opt/dovecot-debug/lib/dovecot/libdovecot.so.0...done.
Loaded symbols for /opt/dovecot-debug/lib/dovecot/libdovecot.so.0
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols 
found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols 
found)...done.
Loaded symbols for /lib64/libpthread.so.0
Core was generated by `dovecot/pop3'.
Program terminated with signal 11, Segmentation fault.
#0  istream_raw_mbox_get_start_offset (stream=0x0) at istream-raw-mbox.c:498
498 istream-raw-mbox.c: No such file or directory.
 in istream-raw-mbox.c
(gdb) bt
#0  istream_raw_mbox_get_start_offset (stream=0x0) at istream-raw-mbox.c:498
#1  0x2b4114afc769 in mbox_mail_get_special (_mail=0x1bad8fa0, field=, value_r=0x7fff9600fa88) at mbox-mail.c:198
#2  0x2b4114adb2d0 in index_mail_expunge (mail=0x0) at index-mail.c:1503
#3  0x00405eac in client_update_mails (client=0x1bac4a00) at 
pop3-commands.c:255
#4  0x004061d1 in cmd_quit (client=0x1bac4a00, name=0x1baccbd4 "", args=0x406a0c 
"") at pop3-commands.c:274
#5  client_command_execute (client=0x1bac4a00, name=0x1baccbd4 "", args=0x406a0c 
"") at pop3-commands.c:773
#6  0x004045c9 in client_handle_input (client=0x1bac4a00) at 
pop3-client.c:628
#7  0x2b4114db0698 in io_loop_call_io (io=0x1bac01d0) at ioloop.c:384
#8  0x2b4114db19d5 in io_loop_handler_run (ioloop=) at 
ioloop-epoll.c:213
#9  0x2b4114db062d in io_loop_run (ioloop=0x1baa8610) at ioloop.c:405
#10 0x2b4114d9ef13 in master_service_run (service=0x1baa84e0, 
callback=0x1baccbe4) at master-service.c:478
#11 0x004039a4 in main (argc=1, argv=0x1baa8370) at main.c:252
(gdb) bt full
#0  istream_raw_mbox_get_start_offset (stream=0x0) at istream-raw-mbox.c:498
 rstream =
 __FUNCTION__ = "istream_raw_mbox_get_start_offset"
#1  0x2b4114afc769 in mbox_mail_get_special (_mail=0x1bad8fa0, field=, value_r=0x7fff9600fa88) at mbox-mail.c:198
 mail =
 mbox = 0x1bac97d0
 offset = 0
#2  0x2b4114adb2d0 in index_mail_expunge (mail=0x0) at index-mail.c:1503
 value =
 guid_128 = 
"\240\267\252\033\000\000\000\000\001\000\000\000\0

Re: [Dovecot] Duplicate Email with Dovecot Sieve

2011-08-18 Thread Holden Hao
>
>  Hmm, odd. The above log only shows one delivery. I would expect a
> duplicate entry there when Dovecot is causing this. You can enable
> mail_debug to see whether that shows more. Also, the user log
> (~/.dovecot.sieve.log) could contain other info. But, I don't expect much
> more from that.
>

Thank you for your reply.  However, there are no relevant information in
dovecot.log (general log file for dovecot) and from ~/dovecot.sieve.log
(nothing specific to the transaction)


> Are you perhaps doing something interesting at MTA level?
>

I am not sure as I just took over management of the server and it is not
documented.  But if it helps here are some log entries from qmail:

General Qmail log:

@40004e4d1d7b2965966c info msg 1337024: bytes 2257 from <
testu...@gmail.com> qp 15984 uid 113
@40004e4d1d7b2965a60c starting delivery 62510: msg 1337024 to local
u...@xx.org
@40004e4d1d7b2965b5ac status: local 1/10 remote 0/100
@40004e4d1d7b390469a4 delivery 62510: success: did_1+0+1/
@40004e4d1d7b3905119c status: local 0/10 remote 0/100
@40004e4d1d7b39058ab4 end msg 1337024

--
Qmail SMTP log:

@40004e4d1d7b0db7cd7c tcpsvd: info: start 15966
mail.xx.org:xxx.xx.xx.xxx
:mail-gx0-f182.google.com:xxx.xx.xxx.xxx:36540
@40004e4d1d7b0dc8adcc qmail-smtpd 15966: connection from xxx.xx.xxx.xxx
(mail-gx0-f182.google.com) to mail.xx.org
@40004e4d1d7b0dc8c924 qmail-smtpd 15966: enabled options: starttls
sanitycheck sendercheck rcptcheck smtp-auth qmailqueue /var/qmail/bin/
qmail-scanner-queue.pl
@40004e4d1d7b0ef4b664 qmail-smtpd 15966: remote ehlo:
mail-gx0-f182.google.com
@40004e4d1d7b13dc6384 qmail-smtpd 15966: remote ehlo:
mail-gx0-f182.google.com
@40004e4d1d7b15089714 qmail-smtpd 15966: mail from: testu...@gmail.com
@40004e4d1d7b1508f8bc qmail-smtpd 15966: sender verify, sender not in
goodmailaddr
@40004e4d1d7b16316b5c qmail-smtpd 15966: rcpt to: u...@xxx.org
@40004e4d1d7b16318e84 qmail-smtpd 15966: recipient verify, recipient not
in goodmailaddr
@40004e4d1d7b16319a3c qmail-smtpd 15966: recipient verify, recipient is
local
@40004e4d1d7b1646b87c qmail-verfiy: verifying u...@xxx.org
@40004e4d1d7b165e3434 qmail-smtpd 15966: recipient verify OK
@40004e4d1d7b19e73bb4 qmail-smtpd 15966: go ahead
@40004e4d1d7b28fd762c qmail-smtpd 15966: message queued: 1313676657 qp
15968 size 1227 bytes
@40004e4d1d992a04b4cc qmail-smtpd 15966: quit, closing connection
@40004e4d1d992a051674 tcpsvd: info: end 15966 exit 0
@40004e4d1d992a05222c tcpsvd: info: status 0/20

Any more ideas?


Holden


Re: [Dovecot] mdbox and doveadm purge

2011-08-18 Thread Timo Sirainen
On Sat, 2011-07-09 at 19:23 +0200, Morten P.D. Stevens wrote:

> We are currently testing Dovecot 2.0.13 with mdbox. If I delete large 
> objects with refcount=0 the index is not updated apparently.

Looks like it happens every time. Fixed:
http://hg.dovecot.org/dovecot-2.0/rev/1449a2e2c1f5




Re: [Dovecot] mdbox and doveadm purge

2011-08-18 Thread Morten Stevens

On Thu, 18 Aug 2011 18:22:06 +0300, Timo Sirainen wrote:

On Sat, 2011-07-09 at 19:23 +0200, Morten P.D. Stevens wrote:

We are currently testing Dovecot 2.0.13 with mdbox. If I delete 
large

objects with refcount=0 the index is not updated apparently.


Looks like it happens every time. Fixed:
http://hg.dovecot.org/dovecot-2.0/rev/1449a2e2c1f5


Hi Timo,

Thanks. This patch will be a part of version 2.0.14?

Best regards,

Morten


Re: [Dovecot] segfault in dovecot 2.0.9

2011-08-18 Thread Morten Stevens

On Mon, 13 Jun 2011 16:02:57 +0300, Timo Sirainen wrote:

On Fri, 2011-06-10 at 19:52 +0200, Morten P.D. Stevens wrote:
Jun  9 00:12:34 mail dovecot: master: Error: service(imap): child 
8987

killed with signal 11 (core dumps disabled)


There's really no way to know why this happens without a gdb 
backtrace.

See http://dovecot.org/bugreport.html


# dovecot -n
# 2.0.9: /etc/dovecot/dovecot.conf


It's also possible that it has already been fixed in newer versions.


Hi Timo,

Small update on this: In 6 months the error occurred only once. The bug 
was not reproducible.


There was a BIOS update for IBM servers which fixes the following 
microcode error:


- Fixed : Intel microcode fix for a potential memory addressing error 
in 64-bit
  operating mode; it could cause page fault, data loss, data 
corruption

  or other unpredictable system behavior.

So I am assuming that it was not a Dovecot bug.

Best regards,

Morten


Re: [Dovecot] mail spool filesystem

2011-08-18 Thread Stan Hoeppner
On 8/17/2011 8:23 AM, Julio Cesar Covolato wrote:
> Hi!
> 
> I´m about to migrate a system whith 5000 accounts whith (~ 500GB) from
> "postfix/courier-imap/maildrop/mysql" to a new hardware whith
> "postfix/dovecot/dovecot/mysql".
> 
>  I´ll make a separate partition (raid 1) for the mail spool
> (/var/spool/vmail) and want to now what type of filesystem to use on it
> to increase performance. I read that XFS is a good choice, but is not
> too reliable...

With only a single spindle of seek performance, which is what mirroring
(RAID 1) gives you, about 150-300 seeks/second depending on which disks
you use, the filesystem will not be a limiting factor, no matter which
one you choose.  The low IOPS of the disk will limit your performance.
Thus, choose the filesystem you are most comfortable, and experienced,
in managing.

All other factors being equal (proper fit, use, administration, etc) XFS
is as reliable, if not more reliable, than any other Linux filesystem.
I'm guessing that what you read related to a bug that was fixed in 2007,
which previously could cause corruption in certain circumstances, mainly
with many transactions in flight during a power failure, i.e. no UPS or
a failed UPS.

-- 
Stan