Re: [Dovecot] doveadm with multiple commands

2012-09-20 Thread Timo Sirainen
On 20.9.2012, at 22.17, Daniel Parthey wrote:

> Timo Sirainen wrote:
>> doveadm multi [-A | -u wildcards]   [> string>  [...]]
>> 
>> Thoughts?
> 
> Would be nice if this also worked through doveadm director proxy
> and executes the command sequence on the correct backend host for
> each user.

Yes, it's going to.

> As command name I could also think of "doveadm sequence", which
> implies the commands being executed in serial order.

Hmm. Maybe.



Re: [Dovecot] userdb missing driver

2012-09-20 Thread Surreal

On 9/21/2012 2:42 AM, Daryl Richards wrote:

On 12-09-20 12:35 PM, Surreal wrote:

On 9/21/2012 12:12 AM, Jerry wrote:

On Thu, 20 Sep 2012 17:57:17 +0200
Frank Bonnet articulated:


if you install from FreeBSD ports you need to enable
the MYSQL backend during configuration ( make config )

If you don't install Dovecot via the FreeBSD ports system, you are just
asking for problems. As previously stated, do run "make config" and
perhaps "make config-recursive" prior to actually attempting to build
the port.

I did, MySQL is ticked when i build dovecot2 from 
/usr/ports/mail/dovecot2/

If you do dovecot --build-options, does it list mysql?

root@mail:~# dovecot --build-options
Build options: ioloop=kqueue notify=kqueue ipv6 openssl 
io_block_size=8192

Mail storages: shared mdbox sdbox maildir mbox cydir imapc pop3c raw
SQL drivers: mysql
Passdb: checkpassword pam passwd passwd-file sql
Userdb: checkpassword nss passwd prefetch passwd-file sql

At first i have noticed that i dont  have mysql when i did 
--build-options, so i tried to deinstall and reinstall dovecot2 port and 
now i have this also:


hostname# dovecot --build-options
Build options: ioloop=kqueue notify=kqueue ipv6 openssl io_block_size=8192
Mail storages: shared mdbox sdbox maildir mbox cydir imapc pop3c raw
SQL drivers: mysql
Passdb: checkpassword pam passwd passwd-file sql
Userdb: checkpassword nss passwd prefetch passwd-file sql

But i still keep getting the same error

hostname# service dovecot start
doveconf: Error: userdb is missing driver
doveconf: Fatal: Error in configuration file 
/usr/local/etc/dovecot/dovecot.conf: userdb is missing driver

doveconf: Error: userdb is missing driver
doveconf: Fatal: Error in configuration file 
/usr/local/etc/dovecot/dovecot.conf: userdb is missing driver

Starting dovecot.
doveconf: Fatal: Error in configuration file 
/usr/local/etc/dovecot/dovecot.conf: userdb is missing driver

/usr/local/etc/rc.d/dovecot: WARNING: failed to start dovecot

Still the same output for doveconf -n

hostname# doveconf -n
# 2.1.8: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 9.0-STABLE i386
auth_default_realm = ren.wf
auth_mechanisms = plain login
auth_realms = ren.wf graphics.re
disable_plaintext_auth = no
first_valid_gid = 5000
first_valid_uid = 5000
lda_mailbox_autocreate = yes
mail_gid = 5000
mail_location = maildir:~/
mail_plugins = quota expire mail_log notify
mail_temp_dir = /var/tmp
mail_uid = 5000
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  expire = Trash
  mail_log_events = delete undelete expunge copy mailbox_delete 
mailbox_rename

  mail_log_fields = uid box msgid size
  quota = maildir:User quota
  quota2_rule = *:storage=3G
  quota_rule = *:storage=3G
  quota_rule2 = Trash:storage=+30%%
  quota_rule3 = Sent:storage=+30%%
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=75%% quota-warning 75 %u
}
sendmail_path = /usr/local/sbin/sendmail
service auth {
  unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener auth-userdb {
group = vmail
mode = 0600
user = vmail
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
user = vmail
  }
  user = vmail
}
ssl = no
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
doveconf: Error: userdb is missing driver
protocol imap {
  mail_max_userip_connections = 3
  mail_plugins = quota expire mail_log notify imap_quota imap_zlib
}
protocol pop3 {
  mail_max_userip_connections = 2
}
doveconf: Fatal: Error in configuration file 
/usr/local/etc/dovecot/dovecot.conf: userdb is missing driver




Re: [Dovecot] Trouble implementing Antispam plug-in for Dovecot

2012-09-20 Thread Ben Johnson


On 9/20/2012 11:53 AM, Ben Johnson wrote:
> Thanks again, Tom. After you set me straight on the various versions of
> the plug-in, I was able to synthesize the relevant documentation and
> make it all work on Ubuntu 12.04 LTS with Dovecot 2.
> 
> The key was to understand the following:
> 
> 1.) The Ubuntu repositories use the Johannes versions of the plug-in
> (for both Dovecot 1 and 2).
> 
> Ubuntu 10.04 LTS (Dovecot 1)
> http://manpages.ubuntu.com/manpages/lucid/man7/dovecot-antispam.7.html
> 
> Ubuntu 12.04 LTS (Dovecot 2)
> http://manpages.ubuntu.com/manpages/precise/man7/dovecot-antispam.7.html
> 
> 2.) The Dovecot 2 Wiki instructions for the Antispam plug-in refer to
> the Eugene version, and that version's configuration directives differ
> from the Johannes version 2 directives. So, anyone attempting to follow
> the Wiki article on Ubuntu will need to adapt the directives accordingly
> (see documentation links above for equivalent directive names).
> 
> 3.) The sample "/usr/bin/sa-learn-pipe.sh" script in the Dovecot 2 Wiki
> instructions lacks a shebang; until a proper shebang is added to the
> shell script, script execution will fail with "status 1". I added the
> standard shebang:
> 
> #!/bin/sh
> 
> Here are the configuration directives that work for me:
> 
> plugin {
> antispam_debug_target = syslog
> antispam_backend = pipe
> antispam_signature = X-DSPAM-Signature
> antispam_signature_missing = error
> antispam_spam_pattern_ignorecase = SPAM;JUNK
> antispam_pipe_tmpdir = /tmp
> antispam_pipe_program = /usr/bin/sa-learn-pipe.sh
> antispam_pipe_program_spam_arg = --spam
> antispam_pipe_program_notspam_arg = --ham
> }
> 
> My final goal is to get the version 1 plug-in working with Dovecot 1.2.9.
> 
> I'm using the following directives, but when I move mail from Inbox to
> Junk, for example, I see no evidence that antispam is taking action.
> 
> plugin {
> antispam_signature = X-DSPAM-Signature
> antispam_signature_missing = error
> antispam_spam_pattern_ignorecase = SPAM;JUNK
> antispam_mail_tmpdir = /tmp
> antispam_mail_sendmail = /usr/bin/sa-learn-pipe.sh
> antispam_mail_spam = --spam
> antispam_mail_notspam = --ham
> }
> 
> Dovecot writes nothing at all to syslog. No errors, no reference to
> antispam. And the message is moved successfully (no failure/error notice
> in IMAP client). The back-end script, "/usr/bin/sa-learn-pipe.sh",
> attempts to create a log file in /tmp, which works with Antispam 2. But
> no such luck here; nothing is ever written to /tmp.
> 
> Version 2 of the plug-in includes a verbose debugging mode, but it seems
> that no such feature is present in version 1.
> 
> I noticed also that version 1 seems not to require a back-end to be
> specified explicitly (as in version 2). Is the back-end implied via the
> configuration directives that are present?
> 
> Respectfully,
> 
> -Ben

Just a follow-up to report that I finally have the Antispam plug-in (the
Johannes version) -- with the mailtrain/pipe back-end -- working as
expected in both of the following environments:

- Ubuntu 10.04 with Dovecot 1.2.9
- Ubuntu 12.04 with Dovecot 2.0.19

In addition to the points that I mentioned in my previous note, a
crucial step in the debugging process was to modify the
"sa-learn-pipe.sh" script to produce more verbose output. Unlike
Antispam 2, Antispam 1 lacks a verbose debugging mode, so when the
plug-in does not work as expected, tracking-down the root cause can be
much more difficult.

Here's the shell script from http://wiki2.dovecot.org/Plugins/Antispam ,
with my modifications:

http://pastebin.com/igTXCYQF

After making these modifications to the shell script, I was able to
determine the cause of the failure in Dovecot 1.2.9. In fact, I was
incorrect earlier when I stated that version 2 was working; the same
problem applied there, too.

The "vmail" user, as whom the script is executed, lacks the permissions
required to change the Bayes token database (this is a "good thing").

An excerpt from the custom log file:

29722-start (--spam)
Calling (as user vmail) '/usr/bin/sa-learn --spam
/tmp/sendmail-msg-29722.txt'
bayes: expire_old_tokens: locker: safe_lock: cannot create tmp lockfile
/var/lib/amavis/.spamassassin/bayes.lock.example.com.29725 for
/var/lib/amavis/.spamassassin/bayes.lock: Permission denied
plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create
tmp lockfile /var/lib/amavis/.spamassassin/bayes.lock.example.com.29725
for /var/lib/amavis/.spamassassin/bayes.lock: Permission denied
ERROR: the Bayes learn function returned an error, please re-run with -D
for more information at /usr/bin/sa-learn line 493.
Learned tokens from 0 message(s) (1 message(s) examined)
29722-end

The only means by which I was able to work around this issue -- without
changing filesystem permissions, users, groups, or otherwise
compromising system security -- was to migrate from the standard
flat-file Bayes database format to MySQL. (The guide at
http://www.starbridge.org/spip/spi

Re: [Dovecot] doveadm with multiple commands

2012-09-20 Thread Daniel Parthey
Timo Sirainen wrote:
> doveadm multi [-A | -u wildcards]   [ string>  [...]]
> 
> Thoughts?

Would be nice if this also worked through doveadm director proxy
and executes the command sequence on the correct backend host for
each user.

As command name I could also think of "doveadm sequence", which
implies the commands being executed in serial order.

Regards
Daniel
-- 
https://plus.google.com/103021802792276734820


Re: [Dovecot] userdb missing driver

2012-09-20 Thread Daryl Richards

On 12-09-20 12:35 PM, Surreal wrote:

On 9/21/2012 12:12 AM, Jerry wrote:

On Thu, 20 Sep 2012 17:57:17 +0200
Frank Bonnet articulated:


if you install from FreeBSD ports you need to enable
the MYSQL backend during configuration ( make config )

If you don't install Dovecot via the FreeBSD ports system, you are just
asking for problems. As previously stated, do run "make config" and
perhaps "make config-recursive" prior to actually attempting to build
the port.

I did, MySQL is ticked when i build dovecot2 from 
/usr/ports/mail/dovecot2/

If you do dovecot --build-options, does it list mysql?

root@mail:~# dovecot --build-options
Build options: ioloop=kqueue notify=kqueue ipv6 openssl io_block_size=8192
Mail storages: shared mdbox sdbox maildir mbox cydir imapc pop3c raw
SQL drivers: mysql
Passdb: checkpassword pam passwd passwd-file sql
Userdb: checkpassword nss passwd prefetch passwd-file sql

--
Daryl Richards
Isle Technical Services Inc.



Re: [Dovecot] Wrong quota calculation

2012-09-20 Thread Cibest ML

Hi Timo,
I've finally solved the issue. As usual, thinking out of the box helped :)
In fact, it was conf related but not where it was expected.
There was an autocreate = Inbox & autosubscribe = Inbox in 90-plugin.conf
Having this configuration seems to double count the Inbox quota during 
quota recalc (but not during normal IMAP operations like moving or 
receiving a message). Might be some kind of bug somewhere in recalc. The 
strange thing is that another more simple dovecot system we have (no 
nfs, all imap/smtp/filtering operations done on the server) also has 
this plugin conf but doesn't count quota twice.
Anyway, after running a small script to recalc all the quota, everything 
is now fine.

Thanks for you help

--
Regards
Sébastien

On 19/09/2012 14:47, Timo Sirainen wrote:

On 19.9.2012, at 15.15, Cibest ML wrote:


There's one quite strange thing we've seen. Display the subscription windows in Thunderbird and unchecking INBOX then shows two 
entries. "INBOX" that isn't selected" and "Inbox" that is selected and cannot been unselected. Checking 
"INBOX" again makes "Inbox" disappear (subscription window need to be closed & reopened after each 
action).

No idea. INBOX is treated case-insensitively by IMAP protocol.


I'm not sure that what we see in Thunderbird is related to the problem but who 
knows. Any help is of course welcome as we're out of ideas :)

Create a test server. Make your Dovecot config minimal. Test with another quota 
backend. Test with local filesystem. See what change breaks the quota 
calculation. It is somehow related to your current config, since it's not 
broken for everybody.





Re: [Dovecot] userdb missing driver

2012-09-20 Thread Surreal

On 9/21/2012 12:12 AM, Jerry wrote:

On Thu, 20 Sep 2012 17:57:17 +0200
Frank Bonnet articulated:


if you install from FreeBSD ports you need to enable
the MYSQL backend during configuration ( make config )

If you don't install Dovecot via the FreeBSD ports system, you are just
asking for problems. As previously stated, do run "make config" and
perhaps "make config-recursive" prior to actually attempting to build
the port.


I did, MySQL is ticked when i build dovecot2 from /usr/ports/mail/dovecot2/


Re: [Dovecot] Trouble implementing Antispam plug-in for Dovecot

2012-09-20 Thread Ben Johnson


On 9/20/2012 12:12 PM, Bradley Giesbrecht wrote:
> 
> On Sep 20, 2012, at 8:53 AM, Ben Johnson wrote:
> 
>> Thanks again, Tom. After you set me straight on the various versions of
>> the plug-in, I was able to synthesize the relevant documentation and
>> make it all work on Ubuntu 12.04 LTS with Dovecot 2.
>>
>> The key was to understand the following:
>>
>> 1.) The Ubuntu repositories use the Johannes versions of the plug-in
>> (for both Dovecot 1 and 2).
>>
>> Ubuntu 10.04 LTS (Dovecot 1)
>> http://manpages.ubuntu.com/manpages/lucid/man7/dovecot-antispam.7.html
>>
>> Ubuntu 12.04 LTS (Dovecot 2)
>> http://manpages.ubuntu.com/manpages/precise/man7/dovecot-antispam.7.html
>>
>> 2.) The Dovecot 2 Wiki instructions for the Antispam plug-in refer to
>> the Eugene version, and that version's configuration directives differ
>> from the Johannes version 2 directives.
> 
> Is there a Johannes version 2?

Thanks for your reply, Bradley.

That seems to be the implication here:
http://manpages.ubuntu.com/manpages/precise/man7/dovecot-antispam.7.html

Johannes is listed as an author, the package name is
dovecot-antispam_2.0+20120225, and the manpage is nearly identical to
that of version 1 at
http://manpages.ubuntu.com/manpages/lucid/man7/dovecot-antispam.7.html .

> I understood that Johannes dropped support at dovecot 2.x and that is why 
> Eugene's version exists.
> 
>> So, anyone attempting to follow
>> the Wiki article on Ubuntu will need to adapt the directives accordingly
>> (see documentation links above for equivalent directive names).
>>
>> 3.) The sample "/usr/bin/sa-learn-pipe.sh" script in the Dovecot 2 Wiki
>> instructions lacks a shebang; until a proper shebang is added to the
>> shell script, script execution will fail with "status 1". I added the
>> standard shebang:
>>
>> #!/bin/sh
>>
>> Here are the configuration directives that work for me:
>>
>> plugin {
>> antispam_debug_target = syslog
>> antispam_backend = pipe
>> antispam_signature = X-DSPAM-Signature
>> antispam_signature_missing = error
>> antispam_spam_pattern_ignorecase = SPAM;JUNK
>> antispam_pipe_tmpdir = /tmp
>> antispam_pipe_program = /usr/bin/sa-learn-pipe.sh
>> antispam_pipe_program_spam_arg = --spam
>> antispam_pipe_program_notspam_arg = --ham
>> }
>>
>> My final goal is to get the version 1 plug-in working with Dovecot 1.2.9.
> 
> If I were implementing Johannes  antispam plugin with Dovecot 1.2.9 I would 
> follow Johannes documentation.
> http://johannes.sipsolutions.net/files/antispam.html

This documentation seems to apply to the Dovecot 2 version; the
antispam_backend directive doesn't seem to exist in version 1, at least
according to the official Ubuntu package documentation (cited above). In
fact, this appears to be the exact document that is used for the Ubuntu
package for Dovecot 2 (also cited above).

> 
> Regards,
> Bradley Giesbrecht (pixilla)
> 


Re: [Dovecot] userdb missing driver

2012-09-20 Thread Jerry
On Thu, 20 Sep 2012 17:57:17 +0200
Frank Bonnet articulated:

> if you install from FreeBSD ports you need to enable
> the MYSQL backend during configuration ( make config )

If you don't install Dovecot via the FreeBSD ports system, you are just
asking for problems. As previously stated, do run "make config" and
perhaps "make config-recursive" prior to actually attempting to build
the port.

-- 
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__


Re: [Dovecot] Trouble implementing Antispam plug-in for Dovecot

2012-09-20 Thread Bradley Giesbrecht

On Sep 20, 2012, at 8:53 AM, Ben Johnson wrote:

> Thanks again, Tom. After you set me straight on the various versions of
> the plug-in, I was able to synthesize the relevant documentation and
> make it all work on Ubuntu 12.04 LTS with Dovecot 2.
> 
> The key was to understand the following:
> 
> 1.) The Ubuntu repositories use the Johannes versions of the plug-in
> (for both Dovecot 1 and 2).
> 
> Ubuntu 10.04 LTS (Dovecot 1)
> http://manpages.ubuntu.com/manpages/lucid/man7/dovecot-antispam.7.html
> 
> Ubuntu 12.04 LTS (Dovecot 2)
> http://manpages.ubuntu.com/manpages/precise/man7/dovecot-antispam.7.html
> 
> 2.) The Dovecot 2 Wiki instructions for the Antispam plug-in refer to
> the Eugene version, and that version's configuration directives differ
> from the Johannes version 2 directives.

Is there a Johannes version 2?

I understood that Johannes dropped support at dovecot 2.x and that is why 
Eugene's version exists.

> So, anyone attempting to follow
> the Wiki article on Ubuntu will need to adapt the directives accordingly
> (see documentation links above for equivalent directive names).
> 
> 3.) The sample "/usr/bin/sa-learn-pipe.sh" script in the Dovecot 2 Wiki
> instructions lacks a shebang; until a proper shebang is added to the
> shell script, script execution will fail with "status 1". I added the
> standard shebang:
> 
> #!/bin/sh
> 
> Here are the configuration directives that work for me:
> 
> plugin {
> antispam_debug_target = syslog
> antispam_backend = pipe
> antispam_signature = X-DSPAM-Signature
> antispam_signature_missing = error
> antispam_spam_pattern_ignorecase = SPAM;JUNK
> antispam_pipe_tmpdir = /tmp
> antispam_pipe_program = /usr/bin/sa-learn-pipe.sh
> antispam_pipe_program_spam_arg = --spam
> antispam_pipe_program_notspam_arg = --ham
> }
> 
> My final goal is to get the version 1 plug-in working with Dovecot 1.2.9.

If I were implementing Johannes  antispam plugin with Dovecot 1.2.9 I would 
follow Johannes documentation.
http://johannes.sipsolutions.net/files/antispam.html


Regards,
Bradley Giesbrecht (pixilla)



smime.p7s
Description: S/MIME cryptographic signature


[Dovecot] Sieve as mail client?

2012-09-20 Thread Tom Horsley
A slightly off topic question, but maybe someone here has seen
something like this:

I want a program that operates entirely on the client side of
an IMAP server, and implements the sieve filtering language
by doing the necessary client side operations to move mail
on the IMAP server, expunge mail, etc.

It would also act as a proxy between my real mail client and
the IMAP server so I'd never see any mail that hasn't been
filtered first.

The benefits are obvious: I could finally get sieve filtering
on my stupid corporate exchange mail server :-).


[Dovecot] doveadm with multiple commands

2012-09-20 Thread Timo Sirainen
This has been in my TODO for a while and today I implemented it (but didn't 
dare to test it yet :) So the problem has been that you want to run for example:

doveadm expunge -A mailbox Trash savedbefore 7d
doveadm purge -A

This is annoying because it scans through the users' mailboxes twice, wasting 
disk IO and CPU. So how to make it do the scan only once? The syntax I thought 
of today would be:

doveadm multi [-A | -u wildcards]   [  [...]]

So the first two commands could be for example:

doveadm multi -A : expunge mailbox Trash savedbefore 7d : purge

The ':' character is the separator. Any other string could be used as well, for 
example "?SEP?" or whatever.

Thoughts? Any better name for the command than "multi"?



Re: [Dovecot] userdb missing driver

2012-09-20 Thread Frank Bonnet

On 09/20/2012 05:43 PM, Reindl Harald wrote:

Am 20.09.2012 17:24, schrieb Surreal:

Good Day,

I'm using dovecot 2.1.8 and this is my dovecot -n output:

# 2.1.8: dovecot.conf
# OS: FreeBSD 9.0-STABLE i386

doveconf: Fatal: Error in configuration file 
/usr/local/etc/dovecot/dovecot.conf: userdb is missing driver

connect = host=127.0.0.1 port=3306 user=daemonuser password=password 
dbname=postfix
driver = mysql

no idea about BSD but on linux systems these are typically
seperated packages

dovecot-2.1.10-4.fc17.20120919.rh.x86_64
dovecot-mysql-2.1.10-4.fc17.20120919.rh.x86_64




if you install from FreeBSD ports you need to enable
the MYSQL backend during configuration ( make config )




Re: [Dovecot] Trouble implementing Antispam plug-in for Dovecot

2012-09-20 Thread Ben Johnson


On 9/19/2012 7:17 PM, Ben Johnson wrote:
> 
> 
> On 9/19/2012 6:19 PM, Tom Hendrikx wrote:
>> On 19/09/12 23:41, Ben Johnson wrote:
>>>
>>>
>>> On 9/11/2012 10:40 AM, Ben Johnson wrote:
 You nailed it, Ben. Thanks!

 I downloaded/installed the dovecot-dev package from the same maintainer
 and was able to build Antispam without issue.

 The hang-up now seems to be with my configuration.

 I'm seeing the following error in my email client whenever I attempt to
 move an email message from, say, Inbox to Junk folder:

 [SERVERBUG] BUG Unknown internal error.

 Nothing at all appears in syslog when this happens.

 I followed the instructions at http://wiki2.dovecot.org/Plugins/Antispam
 , to the letter, I believe.

 The relevant portions of my configuration are as follows:

 -
 protocol imap {
   mail_plugins = quota imap_quota antispam
 }

 plugin {
   quota = dict:user::file:/var/vmail/%d/%n/.quotausage
   sieve = /var/vmail/%d/%n/.sieve

   antispam_backend = MAILTRAIN
   antispam_mail_sendmail = /usr/bin/sa-learn-pipe.sh
   antispam_mail_spam = --spam
   antispam_mail_notspam = --ham
   antispam_spam_pattern_ignorecase = spam;junk
 }
 -

 The permissions and execute bit are set in accordance with other
 executables in the same directory:

 # ls -lah /usr/bin/ | grep -i "sa-learn-pipe.sh"
 -rwxr-xr-x  1 root root 297 Sep  5 11:17 sa-learn-pipe.sh

 I would provide more log content, but the debug options seem to be gone
 in the forked, >= 2.0 version of this plug-in.

 Any ideas are very much appreciated.

 Thanks,

 -Ben
>>>
>>> Given that nobody shared any insight here, I decided to stand-up a
>>> completely new VM with Ubuntu 12.04 LTS and see if the same error occurs.
>>>
>>> While the error is different this time around, I am still unable to get
>>> any variant of the dovecot-antispam plug-in working.
>>>
>>> When I attempt to use the current packages from Ubuntu 12.04.1 LTS, and
>>> I use the above configuration, my syslog fills-up with the following:
>>>
>>> dovecot: imap-login: Login: user=, method=PLAIN,
>>> rip=10.0.1.57, lip=10.0.1.8, mpid=2879, TLS
>>> dovecot: master: Error: service(imap): child 2879 returned error 3
>>>
>>> Surprisingly, I can find only two other mentions of "error 3" anywhere
>>> on the Internet. Those mentions were from another user to this mailing list:
>>>
>>> http://www.dovecot.org/list/dovecot/2012-August/067787.html
>>> http://www.dovecot.org/list/dovecot/2012-August/067814.html
>>>
>>> The lack of "error 3" ubiquity leads me to believe that I must be doing
>>> something stupid.
>>>
>>> There's no question that this behavior is related to the
>>> antispam-plugin, because when I commented-out the relevant lines in
>>> Dovecot's configuration file, the error does not occur.
>>>
>>> I have followed the instructions at
>>> http://wiki2.dovecot.org/Plugins/Antispam to the letter, and this is the
>>> result.
>>>
>>> The only instance in which I diverged from the Wiki article is that I
>>> used the Ubuntu-provided dovecot-antispam package (instead of compiling
>>> the plug-in from source).
>>>
>>> I am trying to use the "mailtrain" back-end, per the above-cited Wiki
>>> article, to call SpamAssassin's "sa-learn" utility for real-time learning.
>>>
>>> I am not using the SpamAssassin daemon (spamd).
>>>
>>> I'm about to throw in the towel on this plug-in, so any help would be
>>> greatly appreciated.
>>>
>>> Thank you,
>>>
>>> -Ben
>>
>> There are 2 versions of the dovecot-antispam package. The original
>> version was created by Johannes Berg, then died almost a silent death,
>> and was forked by Eugene Paskevitch. Later Johannes revived his original
>> version somewhat.
>>
>> The ubuntu package is based on the 'revived Johannes fork' [1], while
>> the documentation on the dovecot wiki describes the 'Eugene fork'. [2]
>>
>> [1] https://launchpad.net/ubuntu/precise/+source/dovecot-antispam/+copyright
>> [2] http://wiki2.dovecot.org/Plugins/Antispam
>>
>> Thus you'll need to choose which plugin you want, then follow the
>> complete procedure for that plugin only. They both can do what you want,
>> but building and configuration are slightly different.
>>
>> It would be nice if Johannes and Eugene would either agree on a single
>> version of the plugin, or rename one of the forks so they don't get
>> mixed up that easily. I'm not sure if that has been discussed (on- or
>> off-list) in the past.
>>
>> FWIW: I used the 'original Johannes fork' with dovecot 1.x, and the
>> 'Eugene fork' with 2.0.x, both with delight. Didn't get myself to
>> upgrade to 2.1 yet, so no experience there.
>>
>> --
>> Tom
>>
> 
> Thank you for your timely response, Tom. Much appreciated.
> 
> Your remarks clear-up a lot of the confusion for me. I didn't realize
> tha

Re: [Dovecot] userdb missing driver

2012-09-20 Thread Reindl Harald
Am 20.09.2012 17:24, schrieb Surreal:
> Good Day,
> 
> I'm using dovecot 2.1.8 and this is my dovecot -n output:
> 
> # 2.1.8: dovecot.conf
> # OS: FreeBSD 9.0-STABLE i386
>
> doveconf: Fatal: Error in configuration file 
> /usr/local/etc/dovecot/dovecot.conf: userdb is missing driver
> 
> connect = host=127.0.0.1 port=3306 user=daemonuser password=password 
> dbname=postfix
> driver = mysql

no idea about BSD but on linux systems these are typically
seperated packages

dovecot-2.1.10-4.fc17.20120919.rh.x86_64
dovecot-mysql-2.1.10-4.fc17.20120919.rh.x86_64





signature.asc
Description: OpenPGP digital signature


[Dovecot] userdb missing driver

2012-09-20 Thread Surreal

Good Day,

I'm using dovecot 2.1.8 and this is my dovecot -n output:

# 2.1.8: dovecot.conf
# OS: FreeBSD 9.0-STABLE i386
auth_default_realm = domain.xxx
auth_mechanisms = plain login
auth_realms = domainone.xxx domaintwo.xxx
disable_plaintext_auth = no
first_valid_gid = 5000
first_valid_uid = 5000
lda_mailbox_autocreate = yes
mail_gid = 5000
mail_location = maildir:~/
mail_plugins = quota expire mail_log notify
mail_temp_dir = /var/tmp
mail_uid = 5000
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  expire = Trash
  mail_log_events = delete undelete expunge copy mailbox_delete 
mailbox_rename

  mail_log_fields = uid box msgid size
  quota = maildir:User quota
  quota2_rule = *:storage=3G
  quota_rule = *:storage=3G
  quota_rule2 = Trash:storage=+30%%
  quota_rule3 = Sent:storage=+30%%
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=75%% quota-warning 75 %u
}
sendmail_path = /usr/local/sbin/sendmail
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener auth-userdb {
group = vmail
mode = 0600
user = vmail
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
user = vmail
  }
  user = vmail
}
ssl = no
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol imap {
  mail_max_userip_connections = 3
  mail_plugins = quota expire mail_log notify imap_quota imap_zlib
}
protocol pop3 {
  mail_max_userip_connections = 2
}

doveconf: Fatal: Error in configuration file 
/usr/local/etc/dovecot/dovecot.conf: userdb is missing driver





This is my dovecot-sql.conf.ext

connect = host=127.0.0.1 port=3306 user=daemonuser password=password 
dbname=postfix

driver = mysql
default_pass_scheme = MD5-CRYPT
password_query = SELECT password,CONCAT('/mail/', maildir) AS userdb_home,\
'5000' AS userdb_uid, '5000' AS userdb_gid, allow_nets,\
concat('*:bytes=', quota) AS userdb_quota_rule\
FROM mailbox WHERE username='%u' AND domain='%d' AND active=1
user_query = SELECT CONCAT('/mail/', maildir) AS home, 'maildir:~/' as 
mail, '5000' AS uid, '5000' AS gid,\

concat('*:bytes=', quota) AS quota_rule\
FROM mailbox WHERE username='%u' AND domain='%d' AND active=1
#iterate_query = SELECT username AS user FROM mailbox

--

I'm sure i granted all privileges to daemonuser to postfix db.
This is my first on dovecot so my knowledge is very minimal, all help 
possible is very much appreciated. Thanks


Re: [Dovecot] v2.1.10 released / indexer errors / lucene

2012-09-20 Thread Robert Schetterer
Am 19.09.2012 17:16, schrieb Timo Sirainen:
> On 19.9.2012, at 17.25, Robert Schetterer wrote:
> 
>> Am 18.09.2012 20:52, schrieb Timo Sirainen:
>>> http://dovecot.org/releases/2.1/dovecot-2.1.10.tar.gz
>>> http://dovecot.org/releases/2.1/dovecot-2.1.10.tar.gz.sig
>>>
>>
>> Hi Timo, i see a few rare errors with lucene and/or indexer
>> since update
> 
> Hmm. But not before? I did one change to fts-lucene, but it wasn't supposed 
> to change the existing behavior.
> 
>> /lucene-indexes: IndexWriter() failed (#1): Lock obtain timed out
>> lucene-indexes) failed: Directory not empty
>>
>> Error: unlink_directory(/usr/local/virtual/.../.../lucene-indexes)
>> failed: Directory not empty
>>
>> lucene-indexes: IndexReader::open() failed (#1): File does not exist
> 
> The above errors are also from indexer-worker? I wonder how it gets to 
> unlink_directory(). That shouldn't happen I think, at least I don't see by 
> grepping the sources how it could, unless something is configured wrong (user 
> is able to see lucene-indexes as a mailbox and is able to delete it).
> 
>> Sep 19 14:46:19 mail01 dovecot: indexer-worker: Error: pure virtual
>> method called
>> Sep 19 14:46:19 mail01 dovecot: indexer-worker: Error: terminate called
>> without an active exception
>>
>> Error: indexer failed to index mailbox INBOX
>>
>> should i care
>> -- 
>> Best Regards
>> MfG Robert Schetterer
>>
> 

update: the above errors didnt happen again today

for one time this error comes up instead

Error: Log synchronization error at seq=8,offset=28596 for
/usr/local/virtual/././dovecot.index: Extension header update
without intro prefix


-- 
Best Regards
MfG Robert Schetterer


Re: [Dovecot] Prevent Download messages from server

2012-09-20 Thread David Ford
do you mean to leave a copy of the email on the server so it can be read 
in multiple email clients?  IMAP can do this and i think modern POP3 
can.  look for an account config option in your mail client to "leave 
mail on server".


i think there is a setting in dovecot to prevent expunging of email but 
it has been years since i was researching this.


-david

On 09/20/2012 02:21 AM, Selcuk Yazar wrote:

Hi,

can we prevent download messages from server user by user ? sme common used
mail's message must be remain at the server, but sometimes we download them
?

thanks in advance





Re: [Dovecot] Prevent Download messages from server

2012-09-20 Thread Robert Schetterer
Am 20.09.2012 09:24, schrieb Peter Mogensen:
> Preventing download will prevent reading the mail

famous last words *g

-- 
Best Regards
MfG Robert Schetterer


Re: [Dovecot] Trouble implementing Antispam plug-in for Dovecot

2012-09-20 Thread Bill Shirley


On 9/19/2012 5:41 PM, Ben Johnson wrote:


On 9/11/2012 10:40 AM, Ben Johnson wrote:

You nailed it, Ben. Thanks!

I downloaded/installed the dovecot-dev package from the same maintainer
and was able to build Antispam without issue.

The hang-up now seems to be with my configuration.

I'm seeing the following error in my email client whenever I attempt to
move an email message from, say, Inbox to Junk folder:

[SERVERBUG] BUG Unknown internal error.

Nothing at all appears in syslog when this happens.

I followed the instructions at http://wiki2.dovecot.org/Plugins/Antispam
, to the letter, I believe.

The relevant portions of my configuration are as follows:

-
protocol imap {
   mail_plugins = quota imap_quota antispam
}

plugin {
   quota = dict:user::file:/var/vmail/%d/%n/.quotausage
   sieve = /var/vmail/%d/%n/.sieve

   antispam_backend = MAILTRAIN
   antispam_mail_sendmail = /usr/bin/sa-learn-pipe.sh
   antispam_mail_spam = --spam
   antispam_mail_notspam = --ham
   antispam_spam_pattern_ignorecase = spam;junk
}
-

The permissions and execute bit are set in accordance with other
executables in the same directory:

# ls -lah /usr/bin/ | grep -i "sa-learn-pipe.sh"
-rwxr-xr-x  1 root root 297 Sep  5 11:17 sa-learn-pipe.sh

I would provide more log content, but the debug options seem to be gone
in the forked, >= 2.0 version of this plug-in.

Any ideas are very much appreciated.

Thanks,

-Ben

Given that nobody shared any insight here, I decided to stand-up a
completely new VM with Ubuntu 12.04 LTS and see if the same error occurs.

While the error is different this time around, I am still unable to get
any variant of the dovecot-antispam plug-in working.

When I attempt to use the current packages from Ubuntu 12.04.1 LTS, and
I use the above configuration, my syslog fills-up with the following:

dovecot: imap-login: Login: user=, method=PLAIN,
rip=10.0.1.57, lip=10.0.1.8, mpid=2879, TLS
dovecot: master: Error: service(imap): child 2879 returned error 3

Surprisingly, I can find only two other mentions of "error 3" anywhere
on the Internet. Those mentions were from another user to this mailing list:

http://www.dovecot.org/list/dovecot/2012-August/067787.html
http://www.dovecot.org/list/dovecot/2012-August/067814.html

The lack of "error 3" ubiquity leads me to believe that I must be doing
something stupid.

There's no question that this behavior is related to the
antispam-plugin, because when I commented-out the relevant lines in
Dovecot's configuration file, the error does not occur.

I have followed the instructions at
http://wiki2.dovecot.org/Plugins/Antispam to the letter, and this is the
result.

The only instance in which I diverged from the Wiki article is that I
used the Ubuntu-provided dovecot-antispam package (instead of compiling
the plug-in from source).

I am trying to use the "mailtrain" back-end, per the above-cited Wiki
article, to call SpamAssassin's "sa-learn" utility for real-time learning.

I am not using the SpamAssassin daemon (spamd).

I'm about to throw in the towel on this plug-in, so any help would be
greatly appreciated.

Thank you,

-Ben


I've never used this plugin but let offer up my home brewed script that 
I call from crontab:

# Process and delete .Spam and .Ham Maildirs
11 */4 * * */usr/local/sbin/maildir.sa-learn

and /usr/local/sbin/maildir.sa-learn:
#!/bin/bash

MAILDIR=Maildir

LS=/bin/ls
RM=/bin/rm
SU=/bin/su
FIND=/bin/find
SALEARN=/usr/bin/sa-learn

for i in `$LS /home`; do
prefs="/home/$i/.spamassassin/user_prefs"

#   [ ! ."$i" == ".bill" ] && continue
echo $i
spamdir="/home/$i/$MAILDIR/.SystemFolders.Spam"
[ ! -d "$spamdir" ] && continue

$SU -c "$SALEARN --prefspath=$prefs --spam $spamdir/new" $i
$FIND "$spamdir/new" -type f -delete

$SU -c "$SALEARN --prefspath=$prefs --spam $spamdir/cur" $i
$FIND "$spamdir/cur" -type f -delete


hamdir="/home/$i/$MAILDIR/.SystemFolders.Ham"
[ ! -d "$hamdir" ] && continue

$SU -c "$SALEARN --prefspath=$prefs --ham $hamdir/new" $i
$FIND "$hamdir/new" -type f -delete

$SU -c "$SALEARN --prefspath=$prefs --ham $hamdir/cur" $i
$FIND "$hamdir/cur" -type f -delete
done

With my setup each user has their own spamassassin user_prefs and bayes 
tokens.


Bill



Re: [Dovecot] Prevent Download messages from server

2012-09-20 Thread Selcuk Yazar
why are you trying ??? this is brain storming




On Thu, Sep 20, 2012 at 10:51 AM, Jakob Curdes  wrote:

>  Am 20.09.2012 09:28, schrieb Selcuk Yazar:
>
> Alessio and Peter thank you again. maybe it can be future request. :)
>
>  We are trying to tell you that it is impossible to write a mail *client*that 
> does not download (i.e. transfer) the mail that it shows to the user.
> This is why it makes no sense to prevent the download on the server side,
> and so there will never be such a function.
> Preventing the download (the transfer) of the mail fro mthe server to the
> client just means that the user *cannot read it*.
>
> Another question is whether there are mail *clients* which do not offer a
> possibility to *save* the read mail (which has already been "downloaded"
> for reading it). But that question is not really related to the dovecot
> mail server.
>
> If you want to get users to read mails, but not download them, I would
> suggest you deny the direct access to the mail server and use a
> browser-based application that shows the entire mail to the user, maybe as
> a graphical representation.  Or you use some sort of terminal software
> that connects to a host where the mail *clients* itself are installed,
> just letting the user view the data but nor copy it, e.g. the VNC protocol.
>
> Hope this helps,
> Jakob Curdes
>
>
>


-- 
Selçuk YAZAR
http://www.selcukyazar.blogspot.com


Re: [Dovecot] Prevent Download messages from server

2012-09-20 Thread Jakob Curdes

Am 20.09.2012 09:28, schrieb Selcuk Yazar:

Alessio and Peter thank you again. maybe it can be future request. :)
We are trying to tell you that it is impossible to write a mail _client_ 
that does not download (i.e. transfer) the mail that it shows to the user.
This is why it makes no sense to prevent the download on the server 
side, and so there will never be such a function.
Preventing the download (the transfer) of the mail fro mthe server to 
the client just means that the user *cannot read it*.


Another question is whether there are mail _clients_ which do not offer 
a possibility to *save* the read mail (which has already been 
"downloaded" for reading it). But that question is not really related to 
the dovecot mail server.


If you want to get users to read mails, but not download them, I would 
suggest you deny the direct access to the mail server and use a 
browser-based application that shows the entire mail to the user, maybe 
as a graphical representation.  Or you use some sort of terminal 
software  that connects to a host where the mail _clients_ itself are 
installed, just letting the user view the data but nor copy it, e.g. the 
VNC protocol.


Hope this helps,
Jakob Curdes




Re: [Dovecot] Prevent Download messages from server

2012-09-20 Thread Selcuk Yazar
Alessio and Peter thank you again. maybe it can be future request. :)


selcuk.


On Thu, Sep 20, 2012 at 10:24 AM, Peter Mogensen  wrote:

> > we have no problem, just i want to learn how can i do that. i think
> > it's clear .
>
> Well... I'm pretty sure most others don't.
>
> But anyway. As in ALL Internet protocols (IMAP being no exception),
> letting the client read data on the server requires it to download the data.
> Preventing download will prevent reading the mail. Period.
>
> So if you're fine with that and just want to learn how to do it, then just
> disable the account in the user database.
>
> /Peter
>
>


-- 
Selçuk YAZAR
http://www.selcukyazar.blogspot.com


Re: [Dovecot] Prevent Download messages from server

2012-09-20 Thread Peter Mogensen

> we have no problem, just i want to learn how can i do that. i think
> it's clear .

Well... I'm pretty sure most others don't.

But anyway. As in ALL Internet protocols (IMAP being no exception), 
letting the client read data on the server requires it to download the data.

Preventing download will prevent reading the mail. Period.

So if you're fine with that and just want to learn how to do it, then 
just disable the account in the user database.


/Peter



Re: [Dovecot] Prevent Download messages from server

2012-09-20 Thread Alessio Cecchi


Il 20/09/2012 08:53, Selcuk Yazar ha scritto:

Thank you,

i looked up http://wiki2.dovecot.org/ACL section. We use POP3 , i think
it's diffucult to evaluate in POP3.

also we are using openLDAP backend, if i change folder permissions , does
it work ?




Change folder permissions is a bad idea, for example if you use Maildir/ 
as mailbox format you can't remove +w, messages should be moved from 
new/ to cur/, add flags to name and so on.


I do not think it's possible to do what you ask.

--
Alessio Cecchi is:
@ ILS -> http://www.linux.it/~alessice/
on LinkedIn -> http://www.linkedin.com/in/alessice
Assistenza Sistemi GNU/Linux -> http://www.cecchi.biz/
@ PLUG -> ex-Presidente, adesso senatore a vita, http://www.prato.linux.it



Re: [Dovecot] Prevent Download messages from server

2012-09-20 Thread Odhiambo Washington
On Thu, Sep 20, 2012 at 9:53 AM, Selcuk Yazar wrote:

> Thank you,
>
> i looked up http://wiki2.dovecot.org/ACL section. We use POP3 , i think
> it's diffucult to evaluate in POP3.
>
> also we are using openLDAP backend, if i change folder permissions , does
> it work ?
>
>
Changing folder permissions to what? I suppose you understand what you mean
by changing folder permissions!
If you make them read-only (no write) for the users group, as that is what
you could be thinking, you'll probably also affect the ability of the MTA
to write to them (deliver mail).

Please explain your situation holistically so that we can understand and
give suggestions...



-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254733744121/+254722743223
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
I can't hear you -- I'm using the scrambler.