Re: Dovecot and Windows Live Mail 2012?

2016-04-13 Thread David Mehler
Hello,

I'm using self-signed certificates, but my CA public key is imported.

I checked the logs and was getting an error about no authentication
which is probably why it was failing. I then switched to 587 and 993
ports and now it works, but it's very intermediant, sometimes it
works, other times not.

If there's a better free windows email client, (please not
thunderbird), that doesn't have these Microsoft-isms i'd appreciate
knowing about it.

Thanks.
Dave.


On 4/13/16, aki.tu...@dovecot.fi  wrote:
>
>> On April 13, 2016 at 5:51 PM David Mehler  wrote:
>>
>>
>> Hello,
>>
>> I hope someone has this working, because I'm pulling my hair out at this
>> one.
>>
>> I'm using well for this it's a win7 x64 machine running Windows
>> Essentials 2012 and using the Windows Live mail component. I am trying
>> to connect to my Dovecot server running 2.23 I believe. I keep getting
>> the error "the imap command could not be sent to the server because of
>> a non-network error" googling showed many with this, but no fix.
>>
>> In this account I'm trying to access port 143 which uses starttls. In
>> Mail I've got the boxes for require a secure connection and
>> authentication checked.
>>
>> I should note of course and with no surprise that Mail works oh just
>> fine with the Hotmail account I've also got configured, it's only with
>> the downloading of folders and sending of email to the dovecot server
>> that mail has the issue.
>>
>> Please let me know if I can provide any additional information.
>>
>> Help appreciated.
>>
>> Thanks.
>> Dave.
>
> Are you using public CA signed certificate? Are there any errors in dovecot
> logs?
>
> Aki
>


Best way to only replicate specific users

2016-04-13 Thread Max
Hi,

I was wondering about the best way to achieve this. Currently, the users I don't
want replicated do not exist on the target system. The source tries to sync them
but runs into an error. Technically, that works for me, but it doesn't seem like
the right way to do it and clutters the log.

Kind Regards,

Max


Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread deano-dovecot

Johannes -

I'm running 2.2.9 under Ubuntu 14.04.  I gave up on using the pipe 
backend, just could not get the damn thing to work.  I would up using 
spool2dir and incron, which works perfectly.  The issue was that 
sa-learn would cause a pthread_cancel error with libgcc_s.so.1


Below is an excerpt from my install script :


  # Enable antispam - Damn, not working right with pipe backend
  # now using spool2dir and incron
  if [ -e /etc/spamassassin ]; then
sed -i "
  s/^  #mail_plugins.*/  mail_plugins = \$mail_plugins antispam 
${DOVENOTIFY}/

  s/^  #mail_max_userip.*/mail_max_userip_connections = 20/
" /etc/dovecot/conf.d/20-imap.conf
cat > /etc/dovecot/conf.d/99-Installerbox-antispam.conf << EOF
##
## antispam configuration
##
plugin {
  antispam_debug_target = syslog
  # antispam_verbose_debug = 1
  antispam_trash_pattern = Trash;Deleted *
  antispam_spam = Junk;Spam

  antispam_backend = spool2dir
  antispam_spool2dir_spam = 
/var/cache/dovecot-antispam/spam/%%020lu-%u-%%05luS
  antispam_spool2dir_notspam =  
/var/cache/dovecot-antispam/ham/%%020lu-%u-%%05luH


  # pipe backend not working with sa-learn - causes pthread_cancel error 
with libgcc_s.so.1

  # antispam_backend = pipe
  # antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh
  # antispam_pipe_program_args = --for;%u
  # antispam_pipe_program_spam_arg = --spam
  # antispam_pipe_program_notspam_arg = --ham
  # antispam_pipe_tmpdir = /tmp
}
EOF

# incron watches the spam/ham spool dirs, calls sa-learn-pipe.sh to 
handle

echo "root" >> /etc/incron.allow
mkdir -p /var/cache/dovecot-antispam/spam 
/var/cache/dovecot-antispam/ham

chown -R ${VMAIL_ID}.dovecot /var/cache/dovecot-antispam/
cat > /var/spool/incron/root << "EOF"
/var/cache/dovecot-antispam/spam IN_CLOSE_WRITE 
/usr/local/bin/sa-learn-pipe.sh --spam 
/var/cache/dovecot-antispam/spam/$#
/var/cache/dovecot-antispam/ham IN_CLOSE_WRITE 
/usr/local/bin/sa-learn-pipe.sh --ham /var/cache/dovecot-antispam/ham/$#

EOF
chgrp incron /var/spool/incron/root
chmod 600 /var/spool/incron/root

# inotify needs a little more room to breath - default of 128 too 
low

cat > /etc/sysctl.d/60-inotify.conf << EOF
# inotify changes for Dovecot
# http://dovecot.org/list/dovecot/2011-March/058300.html

# Defaults are
# fs.inotify.max_queued_events = 16384
# fs.inotify.max_user_instances = 128
# fs.inotify.max_user_watches = 8192

fs.inotify.max_user_instances = 2048
EOF

# spamassassin learning script
cat > /usr/local/bin/sa-learn-pipe.sh << "EOFSPAM"
#!/bin/bash
# Pipe script to learn/unlearn single email file
# Set to read from file or from stdin
# From stdin to accomodate dovecot-antispam pipe backend (nor currently 
working)


# echo /usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt
FILE=`echo $* | sed "s/^.* //"`
echo "$$-start ($*)" >> /var/log/sa-learn-pipe.log
echo -n "$$ " >> /var/log/sa-learn-pipe.log
egrep --no-filename "^Subject: " /tmp/sendmail-msg-$$.txt ${FILE} | head 
-1 >> /var/log/sa-learn-pipe.log

cat<&0 >> /tmp/sendmail-msg-$$.txt
/usr/bin/sa-learn --progress $* /tmp/sendmail-msg-$$.txt >> 
/tmp/sa-learn-pipe.$$.log 2>&1

echo $$ sa-learn rc=$? id=$(id) HOME=$HOME >> /var/log/sa-learn-pipe.log

while read line; do
  echo $$-sa-learn "$line" >> /var/log/sa-learn-pipe.log
done < /tmp/sa-learn-pipe.$$.log

rm -f /tmp/sendmail-msg-$$.txt /tmp/sa-learn-pipe.$$.log
rm -f ${FILE}
echo "$$-end" >> /var/log/sa-learn-pipe.log

exit 0
EOFSPAM
chmod 755 /usr/local/bin/sa-learn-pipe.sh
touch /var/log/sa-learn-pipe.log
chown ${VMAIL_ID}.dovecot /var/log/sa-learn-pipe.log
chmod 660 /var/log/sa-learn-pipe.log
cat > /etc/logrotate.d/sa-learn-pipe.log << EOFLOG
/var/log/sa-learn-pipe.log {
daily
missingok
rotate 10
compress
delaycompress
notifempty
create 660 ${VMAIL_ID} dovecot
}
EOFLOG
  fi # spamassassin




On 2016-04-12 14:14, Johannes Rohr wrote:

Hi, my setup is a dovecot 2.0.19 IMAP server on Ubuntu Precise with
the antispam plugin in version  2.0+20120225-2 and spamassassin at
version 3.2.2

I have been trying and failed to get the pipe backend of the antispam
plugin to work. Spamassin by itself works, a manual call of sa-learn
works fine. Bayes data is stored in a mysql DB.

I have the following configuration in 
/etc/dovecot/conf.d/90-plugin.conf


plugin {
  #setting_name = value
  sieve=~/.dovecot.sieve
  sieve_dir=~/sieve
antispam_pipe_program_spam_arg = --spam
antispam_pipe_program_notspam_arg  = --ham
antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh
antispam_pipe_program_args = --username=%u # % expansion done by 
dovecot

antispam_trash = trash;Trash;Deleted Items;Deleted Messages
antispam_spam = SPAM;Junk
antispam_backend = pipe
antispam_verbose_debug = 1
antispam_debug_target = syslog
antispam_pipe_tmpdir = 

speedup doveadm

2016-04-13 Thread Chris
All,

I've to set ACLs in public namespace for more than 5000 folders. That
takes some hours. I'm calling doveadm by a perl script. Is there any way
to speedup doveadm? Is it possible to set ACLs for multiple folders or
users in a single call?

- Chris


Re: Problem setting owner

2016-04-13 Thread Chris
Luca Bertoncello wrote:

> I already added:
>
>   mail_uid = 1005
>   mail_gid = 8
>
> in 10-mail.conf and:
>
> user_attrs = \
>   =user=exim, \
>   =uid=1005, \
>   =gid=8, \
>   =quota_rule=*:bytes=%{ldap:quotaBytes}, \
>   =home=/home/mailboxes/%{ldap:sAMAccountName}/Maildir, \
>   =mail=maildir:/home/mailboxes/%{ldap:sAMAccountName}/Maildir
>
> in the dovecot-ldap.conf.ext, but it seems to ignore them...

Have you tried override_fields?

- Chris


Re: fts-lucene with virtual folders

2016-04-13 Thread Dmitry Nezhevenko
On Tue, Apr 12, 2016 at 12:40:55PM +0300, Dmitry Nezhevenko wrote:
> 
> This proof-of-concept patch fixes issue for me. I don't think that this is
> right way to fix it. I've copied vname calculation code from
> fts_index_have_compatible_settings. Maybe it's better to create
> something like fts_index_write_settings_checksum() in fts-api.

It looks like dovecot is pretty stable with this patch. I've successfully
indexed ~7GB of mails and got ~4GB index.

In any case, any comments/suggestions? Maybe there is other solution?
 
-- 
WBR, Dmitry


signature.asc
Description: PGP signature


Re: Dovecot and Windows Live Mail 2012?

2016-04-13 Thread aki . tuomi

> On April 13, 2016 at 5:51 PM David Mehler  wrote:
> 
> 
> Hello,
> 
> I hope someone has this working, because I'm pulling my hair out at this one.
> 
> I'm using well for this it's a win7 x64 machine running Windows
> Essentials 2012 and using the Windows Live mail component. I am trying
> to connect to my Dovecot server running 2.23 I believe. I keep getting
> the error "the imap command could not be sent to the server because of
> a non-network error" googling showed many with this, but no fix.
> 
> In this account I'm trying to access port 143 which uses starttls. In
> Mail I've got the boxes for require a secure connection and
> authentication checked.
> 
> I should note of course and with no surprise that Mail works oh just
> fine with the Hotmail account I've also got configured, it's only with
> the downloading of folders and sending of email to the dovecot server
> that mail has the issue.
> 
> Please let me know if I can provide any additional information.
> 
> Help appreciated.
> 
> Thanks.
> Dave.

Are you using public CA signed certificate? Are there any errors in dovecot
logs?

Aki


Dovecot and Windows Live Mail 2012?

2016-04-13 Thread David Mehler
Hello,

I hope someone has this working, because I'm pulling my hair out at this one.

I'm using well for this it's a win7 x64 machine running Windows
Essentials 2012 and using the Windows Live mail component. I am trying
to connect to my Dovecot server running 2.23 I believe. I keep getting
the error "the imap command could not be sent to the server because of
a non-network error" googling showed many with this, but no fix.

In this account I'm trying to access port 143 which uses starttls. In
Mail I've got the boxes for require a secure connection and
authentication checked.

I should note of course and with no surprise that Mail works oh just
fine with the Hotmail account I've also got configured, it's only with
the downloading of folders and sending of email to the dovecot server
that mail has the issue.

Please let me know if I can provide any additional information.

Help appreciated.

Thanks.
Dave.


Re: dlopen() failed: /usr/lib/dovecot/modules/dict/libdict_ldap.so: undefined symbol: ldap_search_star

2016-04-13 Thread Timo Sirainen
On 13 Apr 2016, at 16:23, M. Koehler  wrote:
> 
> Hi,
> 
> I´m using dovecot on debian jessie from the xi-rename-it repo (deb 
> http://xi.rename-it.nl/debian/ stable-auto/dovecot-2.2 main). After upgrading 
> to 2.2.23 I´ve got the following error for example if I delete a message:
> 
> *Apr 13 15:14:10 mail dovecot: dict(18884): Error: Couldn't load plugin 
> /usr/lib/dovecot/modules/dict/libdict_ldap.so: dlopen() failed: 
> /usr/lib/dovecot/modules/dict/libdict_ldap.so: undefined symbol: 
> ldap_search_start
> *
> But I can´t find any ldap settings in my config (doveconf -a). Are any 
> changes that I overlook?

Thanks, should be fixed in the following builds:

https://github.com/dovecot/core/commit/c6f4485a09e4b4ff480a30328679f6b47b39da67
https://github.com/dovecot/core/commit/b025075e4874f6e9ce98883a88554f02f02bdfc5


Re: v2.3 development tree forked in git

2016-04-13 Thread Stephan Bosch



Op 13-4-2016 om 12:57 schreef Timo Sirainen:

The git master branch starts tracking Dovecot v2.3 development from now on. 
There are soon going to be several API changes there that might break plugins. 
If you wish to keep tracking latest v2.2.x development instead, switch to 
master-2.2 branch.

The nightly releases at http://dovecot.org/nightly/ will also track v2.3 tree.


Current Xi repositories now track master-2.2, since these are 
dovecot-2.2 repositories.


Will start a v2.3 builder later today.

Regards,

Stephan.


dlopen() failed: /usr/lib/dovecot/modules/dict/libdict_ldap.so: undefined symbol: ldap_search_star

2016-04-13 Thread M. Koehler

Hi,

I´m using dovecot on debian jessie from the xi-rename-it repo (deb 
http://xi.rename-it.nl/debian/ stable-auto/dovecot-2.2 main). After 
upgrading to 2.2.23 I´ve got the following error for example if I delete 
a message:


*Apr 13 15:14:10 mail dovecot: dict(18884): Error: Couldn't load plugin 
/usr/lib/dovecot/modules/dict/libdict_ldap.so: dlopen() failed: 
/usr/lib/dovecot/modules/dict/libdict_ldap.so: undefined symbol: 
ldap_search_start

*
But I can´t find any ldap settings in my config (doveconf -a). Are any 
changes that I overlook?


Thanks,
Michael


Re: Warning: Global setting won't change the setting inside an earlier filter

2016-04-13 Thread Oliver Riesen-Mallmann
Hi Timo,

> You should be able to solve this by moving the ssl_cert & ssl_key
> before the local_name {}.

Thanks for the hint.

I moved all my separate local_name config files from 10-ssl-* to 11-ssl-*

The warnings are gone.

Regards
Oliver


Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Florian Mutter

> Am 13.04.2016 um 12:14 schrieb Johannes Rohr :
> 
> Yikes! Our server is running a fairly dated Ubuntu Precise, what's your 
> version? Did an upgrade fail to fix it? I am not seeing this error on Debian 
> Sid but I am not using virtual users over here, so that might be the cause. 
> Did you report the bug to the Spamassassin bugzilla?

I’m running Debian 8 (Jessie). Dovecot is version 2.2.13, Dovecot Antispam is 
2.0+20130912-2 and SpamAssassin is 3.4.0. I did not fill a bug but I see you 
already did it.

v2.3 development tree forked in git

2016-04-13 Thread Timo Sirainen
The git master branch starts tracking Dovecot v2.3 development from now on. 
There are soon going to be several API changes there that might break plugins. 
If you wish to keep tracking latest v2.2.x development instead, switch to 
master-2.2 branch.

The nightly releases at http://dovecot.org/nightly/ will also track v2.3 tree.


Re: Warning: Global setting won't change the setting inside an earlier filter

2016-04-13 Thread Timo Sirainen
On 13 Apr 2016, at 10:40, Oliver Riesen-Mallmann  wrote:
> 
> Hi,
> 
> I'm using the Dovecot Prebuilt Binary:
> deb http://xi.rename-it.nl/debian/ stable-auto/dovecot-2.2 main
> 
> I configured multiple SSL certificates with client TLS SNI (see
> http://wiki2.dovecot.org/SSL/DovecotConfiguration).
> 
> Since my last update I get some warnings:
> 
> doveconf: Warning: /etc/dovecot/conf.d/10-ssl.conf line 12: Global
> setting ssl_cert won't change the setting inside an earlier filter at
> /etc/dovecot/conf.d/10-ssl-langzeittest.de.conf line 4
> doveconf: Warning: /etc/dovecot/conf.d/10-ssl.conf line 13: Global
> setting ssl_key won't change the setting inside an earlier filter at
> /etc/dovecot/conf.d/10-ssl-langzeittest.de.conf line 5
> doveconf: Warning: /etc/dovecot/conf.d/10-ssl.conf line 12: Global
> setting ssl_cert won't change the setting inside an earlier filter at
> /etc/dovecot/conf.d/10-ssl-langzeittest.de.conf line 4
> doveconf: Warning: /etc/dovecot/conf.d/10-ssl.conf line 13: Global
> setting ssl_key won't change the setting inside an earlier filter at
> /etc/dovecot/conf.d/10-ssl-langzeittest.de.conf line 5
> 
> The reason is this commit:
> doveconf: Log a warning if a global setting is updated after it was a…
> …lready set inside a filter
> https://github.com/dovecot/core/commit/87404eae4581d7ef834f490507503e59a500066e
> 
> My configuration is (shorted):
> 
> # dovecot -n
> # 2.2.devel (87404ea): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.4.devel (215349a)
> # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.10
> [...]
> ssl_cert =  [...]
> ssl_key =  [...]
> local_name imap.langzeittest.de {
>  ssl_cert =
>   ssl_key =  }
> local_name mail.langzeittest.de {
>  ssl_cert =
>   ssl_key =  }
> 
> I understand, that the warning is correct. I configured ssl_cert and
> ssl_key both, globally (like a default) and in some local_name filters.

You should be able to solve this by moving the ssl_cert & ssl_key before the 
local_name {}. Note that doveconf -n reorders the settings here. So right now 
doveconf reads:

local_name {
  ssl_cert = ..
}
ssl_cert = .. # it gives a warning here

If it's instead:

ssl_cert = ..
local_name {
  ssl_cert = ..
}

There is no warning.


Warning: Global setting won't change the setting inside an earlier filter

2016-04-13 Thread Oliver Riesen-Mallmann
Hi,

I'm using the Dovecot Prebuilt Binary:
deb http://xi.rename-it.nl/debian/ stable-auto/dovecot-2.2 main

I configured multiple SSL certificates with client TLS SNI (see
http://wiki2.dovecot.org/SSL/DovecotConfiguration).

Since my last update I get some warnings:

doveconf: Warning: /etc/dovecot/conf.d/10-ssl.conf line 12: Global
setting ssl_cert won't change the setting inside an earlier filter at
/etc/dovecot/conf.d/10-ssl-langzeittest.de.conf line 4
doveconf: Warning: /etc/dovecot/conf.d/10-ssl.conf line 13: Global
setting ssl_key won't change the setting inside an earlier filter at
/etc/dovecot/conf.d/10-ssl-langzeittest.de.conf line 5
doveconf: Warning: /etc/dovecot/conf.d/10-ssl.conf line 12: Global
setting ssl_cert won't change the setting inside an earlier filter at
/etc/dovecot/conf.d/10-ssl-langzeittest.de.conf line 4
doveconf: Warning: /etc/dovecot/conf.d/10-ssl.conf line 13: Global
setting ssl_key won't change the setting inside an earlier filter at
/etc/dovecot/conf.d/10-ssl-langzeittest.de.conf line 5

The reason is this commit:
doveconf: Log a warning if a global setting is updated after it was a…
…lready set inside a filter
https://github.com/dovecot/core/commit/87404eae4581d7ef834f490507503e59a500066e

My configuration is (shorted):

# dovecot -n
# 2.2.devel (87404ea): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.devel (215349a)
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.10
[...]
ssl_cert = 

Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Johannes Rohr

Am 13.04.2016 um 11:54 schrieb Florian Mutter:

Am 13.04.2016 um 10:35 schrieb Johannes Rohr :

tweaked the wrapper script to make it work. It seems like the sa-learn call 
silently fails:

"/usr/local/bin/sa-learn-pipe.sh" 10L, 350C geschrieben
root@vm10:/etc/dovecot/conf.d# cat /tmp/sa-learn-pipe.log
starting log
25200-start (--username=johan...@rohr.org --spam)
libgcc_s.so.1 must be installed for pthread_cancel to work
25200-end

Does the above error message have anything to do with it? Running the script & 
sa-learn manually works fine. do virtual users change something how dovecot calls 
programs, such as chrooting them?

Here [1] is an old thread about that problem.In short: It seems to be a problem 
in sa-learn that is triggered by the privilege drop that dovecot does when 
starting.

I have the same problem and I have not found a solution yet.


I have just filed a bug with spamassassin, 
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7309


I am not sure that they will act upon it, as it is an old version, and 
SA isn't the ultimate cause anyway.


Cheers,

Johannes




[1] http://www.dovecot.org/list/dovecot/2013-November/093378.html


Cheers,

Johannes


Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Johannes Rohr

Am 13.04.2016 um 11:54 schrieb Florian Mutter:

Am 13.04.2016 um 10:35 schrieb Johannes Rohr :

tweaked the wrapper script to make it work. It seems like the sa-learn call 
silently fails:

"/usr/local/bin/sa-learn-pipe.sh" 10L, 350C geschrieben
root@vm10:/etc/dovecot/conf.d# cat /tmp/sa-learn-pipe.log
starting log
25200-start (--username=johan...@rohr.org --spam)
libgcc_s.so.1 must be installed for pthread_cancel to work
25200-end

Does the above error message have anything to do with it? Running the script & 
sa-learn manually works fine. do virtual users change something how dovecot calls 
programs, such as chrooting them?

Here [1] is an old thread about that problem.In short: It seems to be a problem 
in sa-learn that is triggered by the privilege drop that dovecot does when 
starting.

I have the same problem and I have not found a solution yet.


Yikes! Our server is running a fairly dated Ubuntu Precise, what's your 
version? Did an upgrade fail to fix it? I am not seeing this error on 
Debian Sid but I am not using virtual users over here, so that might be 
the cause. Did you report the bug to the Spamassassin bugzilla?


Cheers,

Johannes


[1] http://www.dovecot.org/list/dovecot/2013-November/093378.html


Cheers,

Johannes


Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Johannes Rohr

Am 13.04.2016 um 11:31 schrieb Steffen Kaiser:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 13 Apr 2016, Johannes Rohr wrote:

tweaked the wrapper script to make it work. It seems like the 
sa-learn call


See the page again.


Can you kindly be more precise? The wrapper script at the page is 
broken, it cannot work, as it fails to write the message passed from the 
plugin to  /tmp/sendmail-msg-$$.txt. So the input passed to sa-learn is 
missing, which I fixed by inserting "cat > /tmp/sendmail-msg-$$.txt" at 
the beginning of the script. However, this is not the actual issue, as 
sa-learn even fails even when the script is fixed.



silently fails:

"/usr/local/bin/sa-learn-pipe.sh" 10L, 350C geschrieben
root@vm10:/etc/dovecot/conf.d# cat /tmp/sa-learn-pipe.log
starting log
25200-start (--username=johan...@rohr.org --spam)
libgcc_s.so.1 must be installed for pthread_cancel to work
25200-end

Does the above error message have anything to do with it? Running the 
script & sa-learn manually works fine. do virtual users change 
something how dovecot calls programs, such as chrooting them?


Maybe, the script uses different search paths? Uncomment "# env" to 
verify.


I'll try later, although I doubt that environment variables are to 
blame. (For now we have a cronjob which is scanning the Junk directories 
periodically as a workaround.) I have to change back a whole bunch of 
config files to enable the plugin again. It seems to be a bug which hits 
daemons that run as a limited user, see 
https://bugs.launchpad.net/ubuntu/+source/gcc-3.3/+bug/40285/comments/30


I am a bit worried because the same error is reported from newer Ubuntu 
versions, so unless the spamassassin guys have fixed it their way, it 
might not go away by upgrading


Cheers,

Johannes




Cheers,

Johannes


Am 13.04.2016 um 09:45 schrieb Johannes Rohr:

Am 13.04.2016 um 09:17 schrieb Tom Hendrikx:

On 13-04-16 08:27, Johannes Rohr wrote:

Hi List,

does the antispam plugin any way of actually seeing how it is
calling the pipe program and how it is failing? I can't reproduce the
failure when I call sa-learn manually. Can someone tell me, with
which UID the call happens, is it the UID the current dovecot process
is running under (which would be vmail, as it is a virtual user
setup) Cheers,


Hi Johannes,
http://wiki2.dovecot.org/Pigeonhole/Sieve/Troubleshooting
This is exactly what the wrapper script is supposed to log for you, or
which is trivially to add to its output. The wrapper script is not
actually useful for production, but it is for debugging. That is why I
asked for its logging, and any differences between manual run and a
dovecot run.


When I used the wrapper script recommended at 
http://wiki2.dovecot.org/Plugins/Antispam, it merely reported the 
PID and parameters (--username=s...@na.me --ham). The wrapper script 
noted in the dovecot wiki seems broken. Note the commented out line:


#echo $* > /tmp/sendmail-parms.txt cat<&0 >> /tmp/sendmail-msg-$$.txt

It seems like the second half of the line "cat<&0 >> 
/tmp/sendmail-msg-$$.txt" was originally a separate line, catting 
the message, which has been passed by the plugin via STDOUT to a 
file. Without that command, the call of sa-learn in the next line 
has no file to read from:


/usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt && rm -f 
/tmp/sendmail-msg-$$.txt &


So I moved the cat command to a separate uncommented line and to be 
sure I also commented out the


rm -f /tmp/sendmail-msg-$$.txt &

to verify that the file actually contains something, (why is there 
an "&" terminating the line, which would have the rm command 
executed in the background?)


But it seems the

/tmp/sendmail-msg-$$.txt &

was empty and the whole operation continued to fail. Could it be 
that the plugin fails to pass the actual message?


Cheers,

Johannes



Regards,
Tom



Johannes

Am 12.04.2016 um 23:09 schrieb Johannes Rohr:

Hi Tom,

Am 12.04.2016 um 22:26 schrieb Tom Hendrikx:

On 12-04-16 20:14, Johannes Rohr wrote:

Hi, my setup is a dovecot 2.0.19 IMAP server on Ubuntu Precise
with the antispam plugin in version  2.0+20120225-2 and
spamassassin at version 3.2.2

I have been trying and failed to get the pipe backend of the
antispam plugin to work. Spamassin by itself works, a manual
call of sa-learn works fine. Bayes data is stored in a mysql
DB.

I have the following configuration in
/etc/dovecot/conf.d/90-plugin.conf

plugin { #setting_name = value sieve=~/.dovecot.sieve
sieve_dir=~/sieve antispam_pipe_program_spam_arg = --spam
antispam_pipe_program_notspam_arg  = --ham
antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh
antispam_pipe_program_args = --username=%u # % expansion done
by dovecot

You need to specify the argument list as a list seperated by
semicolons, per example on the wiki:

antispam_pipe_program_args = --username;%u

Not sure about that, because sa-learn expects the parameter
--username=u...@na.me, this is one parameter, not two, and it
works for me locally, 

Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Florian Mutter
Am 13.04.2016 um 10:35 schrieb Johannes Rohr :
> 
> tweaked the wrapper script to make it work. It seems like the sa-learn call 
> silently fails:
> 
> "/usr/local/bin/sa-learn-pipe.sh" 10L, 350C geschrieben
> root@vm10:/etc/dovecot/conf.d# cat /tmp/sa-learn-pipe.log
> starting log
> 25200-start (--username=johan...@rohr.org --spam)
> libgcc_s.so.1 must be installed for pthread_cancel to work
> 25200-end
> 
> Does the above error message have anything to do with it? Running the script 
> & sa-learn manually works fine. do virtual users change something how dovecot 
> calls programs, such as chrooting them?

Here [1] is an old thread about that problem.In short: It seems to be a problem 
in sa-learn that is triggered by the privilege drop that dovecot does when 
starting.

I have the same problem and I have not found a solution yet.

[1] http://www.dovecot.org/list/dovecot/2013-November/093378.html

> 
> Cheers,
> 
> Johannes


Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 13 Apr 2016, Johannes Rohr wrote:


tweaked the wrapper script to make it work. It seems like the sa-learn call


See the page again.


silently fails:

"/usr/local/bin/sa-learn-pipe.sh" 10L, 350C geschrieben
root@vm10:/etc/dovecot/conf.d# cat /tmp/sa-learn-pipe.log
starting log
25200-start (--username=johan...@rohr.org --spam)
libgcc_s.so.1 must be installed for pthread_cancel to work
25200-end

Does the above error message have anything to do with it? Running the script 
& sa-learn manually works fine. do virtual users change something how dovecot 
calls programs, such as chrooting them?


Maybe, the script uses different search paths? Uncomment "# env" to 
verify.




Cheers,

Johannes


Am 13.04.2016 um 09:45 schrieb Johannes Rohr:

Am 13.04.2016 um 09:17 schrieb Tom Hendrikx:

On 13-04-16 08:27, Johannes Rohr wrote:

Hi List,

does the antispam plugin any way of actually seeing how it is
calling the pipe program and how it is failing? I can't reproduce the
failure when I call sa-learn manually. Can someone tell me, with
which UID the call happens, is it the UID the current dovecot process
is running under (which would be vmail, as it is a virtual user
setup) Cheers,


Hi Johannes,
http://wiki2.dovecot.org/Pigeonhole/Sieve/Troubleshooting
This is exactly what the wrapper script is supposed to log for you, or
which is trivially to add to its output. The wrapper script is not
actually useful for production, but it is for debugging. That is why I
asked for its logging, and any differences between manual run and a
dovecot run.


When I used the wrapper script recommended at 
http://wiki2.dovecot.org/Plugins/Antispam, it merely reported the PID and 
parameters (--username=s...@na.me --ham). The wrapper script noted in the 
dovecot wiki seems broken. Note the commented out line:


#echo $* > /tmp/sendmail-parms.txt cat<&0 >> /tmp/sendmail-msg-$$.txt

It seems like the second half of the line "cat<&0 >> 
/tmp/sendmail-msg-$$.txt" was originally a separate line, catting the 
message, which has been passed by the plugin via STDOUT to a file. Without 
that command, the call of sa-learn in the next line has no file to read 
from:


/usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt && rm -f 
/tmp/sendmail-msg-$$.txt &


So I moved the cat command to a separate uncommented line and to be sure I 
also commented out the


rm -f /tmp/sendmail-msg-$$.txt &

to verify that the file actually contains something, (why is there an "&" 
terminating the line, which would have the rm command executed in the 
background?)


But it seems the

/tmp/sendmail-msg-$$.txt &

was empty and the whole operation continued to fail. Could it be that the 
plugin fails to pass the actual message?


Cheers,

Johannes



Regards,
Tom



Johannes

Am 12.04.2016 um 23:09 schrieb Johannes Rohr:

Hi Tom,

Am 12.04.2016 um 22:26 schrieb Tom Hendrikx:

On 12-04-16 20:14, Johannes Rohr wrote:

Hi, my setup is a dovecot 2.0.19 IMAP server on Ubuntu Precise
with the antispam plugin in version  2.0+20120225-2 and
spamassassin at version 3.2.2

I have been trying and failed to get the pipe backend of the
antispam plugin to work. Spamassin by itself works, a manual
call of sa-learn works fine. Bayes data is stored in a mysql
DB.

I have the following configuration in
/etc/dovecot/conf.d/90-plugin.conf

plugin { #setting_name = value sieve=~/.dovecot.sieve
sieve_dir=~/sieve antispam_pipe_program_spam_arg = --spam
antispam_pipe_program_notspam_arg  = --ham
antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh
antispam_pipe_program_args = --username=%u # % expansion done
by dovecot

You need to specify the argument list as a list seperated by
semicolons, per example on the wiki:

antispam_pipe_program_args = --username;%u

Not sure about that, because sa-learn expects the parameter
--username=u...@na.me, this is one parameter, not two, and it
works for me locally, where I also set up dovecot to test. The
main differences are that the versions I have here are newer, I'm
running Debian sid, the server is on Ubuntu Precise, and second,
the server is handling virtual users, locally I have only real Unix
users.

Also, dovecot doesn't complain about configuration errors regard
--username=%u. What other way would be there to get the parameter
passed to sa-learn the way I want?

btw, I tried this, just to be sure, but the result was the same.


The verbose debug should give you some logging to work with.

Yes, and I pasted the output. I can of course repeat:

Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(Junk): 0 Apr
12 22:53:02 vm10 imap: antispam: 
mailbox_is_trash(INBhttp://wiki2.dovecot.org/Pigeonhole/Sieve/TroubleshootingOX): 
0 Apr 12

22:53:02 vm10 imap: antispam: mailbox_is_trash(Junk): 0 Apr 12
22:53:02 vm10 imap: antispam: mail copy: from trash: 0, to trash:
0 Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(INBOX): 0
Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(Junk): 1 Apr
12 

Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Johannes Rohr
tweaked the wrapper script to make it work. It seems like the sa-learn 
call silently fails:


"/usr/local/bin/sa-learn-pipe.sh" 10L, 350C geschrieben
root@vm10:/etc/dovecot/conf.d# cat /tmp/sa-learn-pipe.log
starting log
25200-start (--username=johan...@rohr.org --spam)
libgcc_s.so.1 must be installed for pthread_cancel to work
25200-end

Does the above error message have anything to do with it? Running the 
script & sa-learn manually works fine. do virtual users change something 
how dovecot calls programs, such as chrooting them?


Cheers,

Johannes


Am 13.04.2016 um 09:45 schrieb Johannes Rohr:

Am 13.04.2016 um 09:17 schrieb Tom Hendrikx:

On 13-04-16 08:27, Johannes Rohr wrote:

Hi List,

does the antispam plugin any way of actually seeing how it is
calling the pipe program and how it is failing? I can't reproduce the
failure when I call sa-learn manually. Can someone tell me, with
which UID the call happens, is it the UID the current dovecot process
is running under (which would be vmail, as it is a virtual user
setup) Cheers,


Hi Johannes,
http://wiki2.dovecot.org/Pigeonhole/Sieve/Troubleshooting
This is exactly what the wrapper script is supposed to log for you, or
which is trivially to add to its output. The wrapper script is not
actually useful for production, but it is for debugging. That is why I
asked for its logging, and any differences between manual run and a
dovecot run.


When I used the wrapper script recommended at 
http://wiki2.dovecot.org/Plugins/Antispam, it merely reported the PID 
and parameters (--username=s...@na.me --ham). The wrapper script noted 
in the dovecot wiki seems broken. Note the commented out line:


#echo $* > /tmp/sendmail-parms.txt cat<&0 >> /tmp/sendmail-msg-$$.txt

It seems like the second half of the line "cat<&0 >> 
/tmp/sendmail-msg-$$.txt" was originally a separate line, catting the 
message, which has been passed by the plugin via STDOUT to a file. 
Without that command, the call of sa-learn in the next line has no 
file to read from:


/usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt && rm -f 
/tmp/sendmail-msg-$$.txt &


So I moved the cat command to a separate uncommented line and to be 
sure I also commented out the


rm -f /tmp/sendmail-msg-$$.txt &

to verify that the file actually contains something, (why is there an 
"&" terminating the line, which would have the rm command executed in 
the background?)


But it seems the

/tmp/sendmail-msg-$$.txt &

was empty and the whole operation continued to fail. Could it be that 
the plugin fails to pass the actual message?


Cheers,

Johannes



Regards,
Tom



Johannes

Am 12.04.2016 um 23:09 schrieb Johannes Rohr:

Hi Tom,

Am 12.04.2016 um 22:26 schrieb Tom Hendrikx:

On 12-04-16 20:14, Johannes Rohr wrote:

Hi, my setup is a dovecot 2.0.19 IMAP server on Ubuntu Precise
with the antispam plugin in version  2.0+20120225-2 and
spamassassin at version 3.2.2

I have been trying and failed to get the pipe backend of the
antispam plugin to work. Spamassin by itself works, a manual
call of sa-learn works fine. Bayes data is stored in a mysql
DB.

I have the following configuration in
/etc/dovecot/conf.d/90-plugin.conf

plugin { #setting_name = value sieve=~/.dovecot.sieve
sieve_dir=~/sieve antispam_pipe_program_spam_arg = --spam
antispam_pipe_program_notspam_arg  = --ham
antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh
antispam_pipe_program_args = --username=%u # % expansion done
by dovecot

You need to specify the argument list as a list seperated by
semicolons, per example on the wiki:

antispam_pipe_program_args = --username;%u

Not sure about that, because sa-learn expects the parameter
--username=u...@na.me, this is one parameter, not two, and it
works for me locally, where I also set up dovecot to test. The
main differences are that the versions I have here are newer, I'm
running Debian sid, the server is on Ubuntu Precise, and second,
the server is handling virtual users, locally I have only real Unix
users.

Also, dovecot doesn't complain about configuration errors regard
--username=%u. What other way would be there to get the parameter
passed to sa-learn the way I want?

btw, I tried this, just to be sure, but the result was the same.


The verbose debug should give you some logging to work with.

Yes, and I pasted the output. I can of course repeat:

Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(Junk): 0 Apr
12 22:53:02 vm10 imap: antispam: 
mailbox_is_trash(INBhttp://wiki2.dovecot.org/Pigeonhole/Sieve/TroubleshootingOX): 
0 Apr 12

22:53:02 vm10 imap: antispam: mailbox_is_trash(Junk): 0 Apr 12
22:53:02 vm10 imap: antispam: mail copy: from trash: 0, to trash:
0 Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(INBOX): 0
Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(Junk): 1 Apr
12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(INBOX): 0 Apr 12
22:53:02 vm10 imap: antispam: mail copy: src spam: 0, dst spam: 1,
src unsure: 0 Apr 12 22:53:02 vm10 imap: antispam: running

Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Johannes Rohr

Am 13.04.2016 um 09:17 schrieb Tom Hendrikx:

On 13-04-16 08:27, Johannes Rohr wrote:

Hi List,

does the antispam plugin any way of actually seeing how it is
calling the pipe program and how it is failing? I can't reproduce the
failure when I call sa-learn manually. Can someone tell me, with
which UID the call happens, is it the UID the current dovecot process
is running under (which would be vmail, as it is a virtual user
setup) Cheers,


Hi Johannes,
http://wiki2.dovecot.org/Pigeonhole/Sieve/Troubleshooting
This is exactly what the wrapper script is supposed to log for you, or
which is trivially to add to its output. The wrapper script is not
actually useful for production, but it is for debugging. That is why I
asked for its logging, and any differences between manual run and a
dovecot run.


When I used the wrapper script recommended at 
http://wiki2.dovecot.org/Plugins/Antispam, it merely reported the PID 
and parameters (--username=s...@na.me --ham). The wrapper script noted 
in the dovecot wiki seems broken. Note the commented out line:


#echo $* > /tmp/sendmail-parms.txt cat<&0 >> /tmp/sendmail-msg-$$.txt

It seems like the second half of the line "cat<&0 >> 
/tmp/sendmail-msg-$$.txt" was originally a separate line, catting the 
message, which has been passed by the plugin via STDOUT to a file. 
Without that command, the call of sa-learn in the next line has no file 
to read from:


/usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt && rm -f 
/tmp/sendmail-msg-$$.txt &


So I moved the cat command to a separate uncommented line and to be sure 
I also commented out the


rm -f /tmp/sendmail-msg-$$.txt &

to verify that the file actually contains something, (why is there an 
"&" terminating the line, which would have the rm command executed in 
the background?)


But it seems the

/tmp/sendmail-msg-$$.txt &

was empty and the whole operation continued to fail. Could it be that 
the plugin fails to pass the actual message?


Cheers,

Johannes



Regards,
Tom



Johannes

Am 12.04.2016 um 23:09 schrieb Johannes Rohr:

Hi Tom,

Am 12.04.2016 um 22:26 schrieb Tom Hendrikx:

On 12-04-16 20:14, Johannes Rohr wrote:

Hi, my setup is a dovecot 2.0.19 IMAP server on Ubuntu Precise
with the antispam plugin in version  2.0+20120225-2 and
spamassassin at version 3.2.2

I have been trying and failed to get the pipe backend of the
antispam plugin to work. Spamassin by itself works, a manual
call of sa-learn works fine. Bayes data is stored in a mysql
DB.

I have the following configuration in
/etc/dovecot/conf.d/90-plugin.conf

plugin { #setting_name = value sieve=~/.dovecot.sieve
sieve_dir=~/sieve antispam_pipe_program_spam_arg = --spam
antispam_pipe_program_notspam_arg  = --ham
antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh
antispam_pipe_program_args = --username=%u # % expansion done
by dovecot

You need to specify the argument list as a list seperated by
semicolons, per example on the wiki:

antispam_pipe_program_args = --username;%u

Not sure about that, because sa-learn expects the parameter
--username=u...@na.me, this is one parameter, not two, and it
works for me locally, where I also set up dovecot to test. The
main differences are that the versions I have here are newer, I'm
running Debian sid, the server is on Ubuntu Precise, and second,
the server is handling virtual users, locally I have only real Unix
users.

Also, dovecot doesn't complain about configuration errors regard
--username=%u. What other way would be there to get the parameter
passed to sa-learn the way I want?

btw, I tried this, just to be sure, but the result was the same.


The verbose debug should give you some logging to work with.

Yes, and I pasted the output. I can of course repeat:

Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(Junk): 0 Apr
12 22:53:02 vm10 imap: antispam: 
mailbox_is_trash(INBhttp://wiki2.dovecot.org/Pigeonhole/Sieve/TroubleshootingOX):
 0 Apr 12
22:53:02 vm10 imap: antispam: mailbox_is_trash(Junk): 0 Apr 12
22:53:02 vm10 imap: antispam: mail copy: from trash: 0, to trash:
0 Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(INBOX): 0
Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(Junk): 1 Apr
12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(INBOX): 0 Apr 12
22:53:02 vm10 imap: antispam: mail copy: src spam: 0, dst spam: 1,
src unsure: 0 Apr 12 22:53:02 vm10 imap: antispam: running
mailtrain backend program /usr/bin/sa-learn Apr 12 22:53:02 vm10
imap: antispam: running mailtrain backend program
/usr/bin/sa-learn Apr 12 22:53:02 vm10 imap: antispam: running
mailtrain backend program parameter 1 --username=johan...@rohr.org
Apr 12 22:53:02 vm10 imap: antispam: running mailtrain backend
program parameter 2 --spam Apr 12 22:53:03 vm10 imap: antispam: run
program failed with exit code -1





Also, what does the wrapper script log when dovecot runs it?

I have actually ditched  the wrapper script because it works
without locally, I have configured the plugin to call sa-learn
directly.


How 

Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Tom Hendrikx
On 13-04-16 08:27, Johannes Rohr wrote:
> Hi List,
> 
> does the antispam plugin any way of actually seeing how it is
> calling the pipe program and how it is failing? I can't reproduce the
> failure when I call sa-learn manually. Can someone tell me, with
> which UID the call happens, is it the UID the current dovecot process
> is running under (which would be vmail, as it is a virtual user
> setup) Cheers,
> 

Hi Johannes,

This is exactly what the wrapper script is supposed to log for you, or
which is trivially to add to its output. The wrapper script is not
actually useful for production, but it is for debugging. That is why I
asked for its logging, and any differences between manual run and a
dovecot run.

Regards,
Tom


> Johannes
> 
> Am 12.04.2016 um 23:09 schrieb Johannes Rohr:
>> Hi Tom,
>> 
>> Am 12.04.2016 um 22:26 schrieb Tom Hendrikx:
>>> On 12-04-16 20:14, Johannes Rohr wrote:
 Hi, my setup is a dovecot 2.0.19 IMAP server on Ubuntu Precise 
 with the antispam plugin in version  2.0+20120225-2 and
 spamassassin at version 3.2.2
 
 I have been trying and failed to get the pipe backend of the
 antispam plugin to work. Spamassin by itself works, a manual
 call of sa-learn works fine. Bayes data is stored in a mysql
 DB.
 
 I have the following configuration in 
 /etc/dovecot/conf.d/90-plugin.conf
 
 plugin { #setting_name = value sieve=~/.dovecot.sieve 
 sieve_dir=~/sieve antispam_pipe_program_spam_arg = --spam 
 antispam_pipe_program_notspam_arg  = --ham 
 antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh 
 antispam_pipe_program_args = --username=%u # % expansion done
 by dovecot
>>> You need to specify the argument list as a list seperated by
>>> semicolons, per example on the wiki:
>>> 
>>> antispam_pipe_program_args = --username;%u
>> 
>> Not sure about that, because sa-learn expects the parameter 
>> --username=u...@na.me, this is one parameter, not two, and it
>> works for me locally, where I also set up dovecot to test. The
>> main differences are that the versions I have here are newer, I'm
>> running Debian sid, the server is on Ubuntu Precise, and second,
>> the server is handling virtual users, locally I have only real Unix
>> users.
>> 
>> Also, dovecot doesn't complain about configuration errors regard 
>> --username=%u. What other way would be there to get the parameter 
>> passed to sa-learn the way I want?
>> 
>> btw, I tried this, just to be sure, but the result was the same.
>> 
>>> 
>>> The verbose debug should give you some logging to work with.
>> Yes, and I pasted the output. I can of course repeat:
>> 
>> Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(Junk): 0 Apr
>> 12 22:53:02 vm10 imap: antispam: mailbox_is_trash(INBOX): 0 Apr 12
>> 22:53:02 vm10 imap: antispam: mailbox_is_trash(Junk): 0 Apr 12
>> 22:53:02 vm10 imap: antispam: mail copy: from trash: 0, to trash:
>> 0 Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(INBOX): 0 
>> Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(Junk): 1 Apr
>> 12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(INBOX): 0 Apr 12
>> 22:53:02 vm10 imap: antispam: mail copy: src spam: 0, dst spam: 1,
>> src unsure: 0 Apr 12 22:53:02 vm10 imap: antispam: running
>> mailtrain backend program /usr/bin/sa-learn Apr 12 22:53:02 vm10
>> imap: antispam: running mailtrain backend program 
>> /usr/bin/sa-learn Apr 12 22:53:02 vm10 imap: antispam: running
>> mailtrain backend program parameter 1 --username=johan...@rohr.org 
>> Apr 12 22:53:02 vm10 imap: antispam: running mailtrain backend
>> program parameter 2 --spam Apr 12 22:53:03 vm10 imap: antispam: run
>> program failed with exit code -1
>> 
>> 
>> 
>> 
>>> Also, what does the wrapper script log when dovecot runs it?
>> 
>> I have actually ditched  the wrapper script because it works
>> without locally, I have configured the plugin to call sa-learn
>> directly.
>> 
>>> How does that differ from a manual run?
>> sa-learn works just fine with a manual run. It seems as if the
>> plugin is passing the parameters wrongly, but the debugging output
>> doesn't reveal the actual command, so it's just guesswork.
>> 
>> Cheers,
>> 
>> Johannes
>> 
>>> 
>>> 
 antispam_trash = trash;Trash;Deleted Items;Deleted Messages 
 antispam_spam = SPAM;Junk antispam_backend = pipe 
 antispam_verbose_debug = 1 antispam_debug_target = syslog 
 antispam_pipe_tmpdir = /tmp }
 
 I have tried the following wrapper script: #!/bin/bash # set
 -x LOGFILE=/tmp/sa-learn-pipe.log echo "$$-start ($*)" >>
 $LOGFILE #echo $* > /tmp/sendmail-parms.txt cat<&0 >>
 /tmp/sendmail-msg-$$.txt /usr/bin/sa-learn $* -D
 /tmp/sendmail-msg-$$.txt >> $LOGFILE 2>&1 && \ rm -f
 /tmp/sendmail-msg-$$.txt echo "$$-end" >> $LOGFILE exit 0
 
 It somehow isn't working. I can call the wrapper script
 manually e.g. sudo -u vmail /usr/local/bin/sa-learn-pipe.sh
 --username=s...@mail.user --ham \ < someham

Re: antispam plugin, pipe backend, how to make it work?

2016-04-13 Thread Johannes Rohr

Hi List,

does the antispam plugin any way of actually seeing how it is calling 
the pipe program and how it is failing? I can't reproduce the failure 
when I call sa-learn manually. Can someone tell me, with which UID the 
call happens, is it the UID the current dovecot process is running under 
(which would be vmail, as it is a virtual user setup)

Cheers,

Johannes

Am 12.04.2016 um 23:09 schrieb Johannes Rohr:

Hi Tom,

Am 12.04.2016 um 22:26 schrieb Tom Hendrikx:

On 12-04-16 20:14, Johannes Rohr wrote:
 Hi, my setup is a dovecot 2.0.19 IMAP server on Ubuntu Precise 
with

the antispam plugin in version  2.0+20120225-2 and spamassassin at
version 3.2.2

I have been trying and failed to get the pipe backend of the antispam
plugin to work. Spamassin by itself works, a manual call of sa-learn
works fine. Bayes data is stored in a mysql DB.

I have the following configuration in 
/etc/dovecot/conf.d/90-plugin.conf


plugin {
   #setting_name = value
   sieve=~/.dovecot.sieve
   sieve_dir=~/sieve
 antispam_pipe_program_spam_arg = --spam
 antispam_pipe_program_notspam_arg  = --ham
 antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh
 antispam_pipe_program_args = --username=%u # % expansion done by
dovecot

You need to specify the argument list as a list seperated by semicolons,
per example on the wiki:

antispam_pipe_program_args = --username;%u


Not sure about that, because sa-learn expects the parameter 
--username=u...@na.me, this is one parameter, not two, and it works 
for me locally, where I also set up dovecot to test. The main 
differences are that the versions I have here are newer, I'm running 
Debian sid, the server is on Ubuntu Precise, and second, the server is 
handling virtual users, locally I have only real Unix users.


Also, dovecot doesn't complain about configuration errors regard 
--username=%u. What other way would be there to get the parameter 
passed to sa-learn the way I want?


btw, I tried this, just to be sure, but the result was the same.



The verbose debug should give you some logging to work with.

Yes, and I pasted the output. I can of course repeat:

Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(Junk): 0
Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_trash(INBOX): 0
Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_trash(Junk): 0
Apr 12 22:53:02 vm10 imap: antispam: mail copy: from trash: 0, to 
trash: 0

Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(INBOX): 0
Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_spam(Junk): 1
Apr 12 22:53:02 vm10 imap: antispam: mailbox_is_unsure(INBOX): 0
Apr 12 22:53:02 vm10 imap: antispam: mail copy: src spam: 0, dst spam: 
1, src unsure: 0
Apr 12 22:53:02 vm10 imap: antispam: running mailtrain backend program 
/usr/bin/sa-learn
Apr 12 22:53:02 vm10 imap: antispam: running mailtrain backend program 
/usr/bin/sa-learn
Apr 12 22:53:02 vm10 imap: antispam: running mailtrain backend program 
parameter 1 --username=johan...@rohr.org
Apr 12 22:53:02 vm10 imap: antispam: running mailtrain backend program 
parameter 2 --spam

Apr 12 22:53:03 vm10 imap: antispam: run program failed with exit code -1





  Also, what
does the wrapper script log when dovecot runs it?


I have actually ditched  the wrapper script because it works without 
locally, I have configured the plugin to call sa-learn directly.



How does that differ
from a manual run?
sa-learn works just fine with a manual run. It seems as if the plugin 
is passing the parameters wrongly, but the debugging output doesn't 
reveal the actual command, so it's just guesswork.


Cheers,

Johannes





 antispam_trash = trash;Trash;Deleted Items;Deleted Messages
 antispam_spam = SPAM;Junk
 antispam_backend = pipe
 antispam_verbose_debug = 1
 antispam_debug_target = syslog
 antispam_pipe_tmpdir = /tmp
}

I have tried the following wrapper script:
#!/bin/bash
# set -x
LOGFILE=/tmp/sa-learn-pipe.log
echo "$$-start ($*)" >> $LOGFILE
#echo $* > /tmp/sendmail-parms.txt
cat<&0 >> /tmp/sendmail-msg-$$.txt
/usr/bin/sa-learn $* -D /tmp/sendmail-msg-$$.txt >> $LOGFILE 2>&1 && \
rm -f /tmp/sendmail-msg-$$.txt
echo "$$-end" >> $LOGFILE
exit 0

It somehow isn't working. I can call the wrapper script manually e.g.
sudo -u vmail /usr/local/bin/sa-learn-pipe.sh --username=s...@mail.user
--ham \
< someham

But it doesn't work from dovecot. It seems the script is called. but no
new patterns show up in the bayes DB. Unfortunately, the plugin 
seems to

be documented poorly. How does it call the programme it pipes to? Is it
something like $programme --par1 --par2 < message ? Why can't /
shouldn't I call sa-learn directly? All the instructions I found on the
in internet contained a wrapper script, but none bothered to explain 
why

you would actually need it.

I would be very grateful, if someone could enlighten me on that...

Cheers,

Johannes




Re: Different usernames for different login method

2016-04-13 Thread Luca Bertoncello

Zitat von Steffen Kaiser :


What does your passdb /userdb config looks like ?

You can return the "user" field, see  
http://wiki2.dovecot.org/PasswordDatabase , to mangle the username  
for all passdb's, in order to let Dovecot use the same username.


I solved the problem upgrading Dovecot to version 2.2.18 and using  
%{auth_username}...


Now I just have the problem, that mail_uid and mail_gid are ignored.
Any idea?

Thanks
Luca Bertoncello
(lucab...@lucabert.de)