[Dovecot] Dovecot 2.2.7/2.2.8 failing to call dspam with antispam

2013-11-25 Thread Guillaume Hilt

Hello again,

I'm running Gentoo AMD64 2013 with postfix, mysql, dovecot and dspam :
dovecot 2.2.8 (it was working fine with 2.2.6 after doing a chmod 4511 
on dspam binary), dspam 3.10.2-r1 and dovecot-antispam-2.0_pre20130429 
(recompiled after each dovecot upgrade).


I've set dspam to debug, and mail_debug to yes.

uid 1001 is user vmail (dovecot is running under vmail)
gid 12 is group mail (vmail is a member, with 
mail,postfix,dspam,dovecot,apache)

All the necessary users are trusted in dspam configuration.

Here's my plugin settings :
antispam_verbose_debug = 1
antispam_debug_target = syslog
antispam_backend = dspam
antispam_allow_append_to_spam = NO
antispam_skip_from_line = NO
antispam_spam = Spam
antispam_trash = Trash
antispam_signature = X-DSPAM-Signature
antispam_signature_missing = error
antispam_dspam_binary = /usr/bin/dspam
antispam_dspam_args = --user;%u;--deliver=;--source=error;--signature=%%s
antispam_dspam_spam = --class=spam
antispam_dspam_notspam = --class=innocent
antispam_dspam_result_header = X-DSPAM-Result

When i'm moving an email to the dspam folder, Thunderbird throw me an 
error : Failed to call dspam (email is dropped in the Spam folder 
anyway, but a copy stay on my INBOX)


== /var/log/mail/mail/log ==
Nov 25 13:01:04 srv1 dovecot: imap: Debug: Loading modules from 
directory: /usr/lib64/dovecot
Nov 25 13:01:04 srv1 dovecot: imap: Debug: Module loaded: 
/usr/lib64/dovecot/lib90_antispam_plugin.so
Nov 25 13:01:04 srv1 dovecot: imap: Debug: Added userdb setting: 
plugin/maildir=shadowprojects.org/ghilt/
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug: 
Effective uid=1001, gid=12, home=/home/vmail/shadowprojects.org/ghilt/
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug: 
Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, 
list=yes, subscriptions=yes 
location=maildir:/home/vmail/shadowprojects.org/ghilt/.maildir
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug: 
maildir++: root=/home/vmail/shadowprojects.org/ghilt/.maildir, index=, 
indexpvt=, control=, 
inbox=/home/vmail/shadowprojects.org/ghilt/.maildir, alt=
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug: 
Namespace : Using permissions from 
/home/vmail/shadowprojects.org/ghilt/.maildir: mode=0770 gid=default
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug: 
dspam error:29764 prefix=imap(gh...@shadowprojects.org):
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug: 
executing /usr/bin/dspam failed: 13 (uid=1001, gid=12)

Nov 25 13:01:04 srv1 dovecot: imap: Error:
Nov 25 13:01:04 srv1 dovecot: imap: Error:

== /var/log/dspam/dspam.debug ==
9976: [11/25/2013 13:12:23] DSPAM Instance Startup
9976: [11/25/2013 13:12:23] input args: /usr/bin/dspam --user 
gh...@shadowprojects.org --deliver= --source=error 
--signature=89,52900600118151560172939 --class=spam

9976: [11/25/2013 13:12:23] pass-thru args:
9976: [11/25/2013 13:12:23] processing user gh...@shadowprojects.org
9976: [11/25/2013 13:12:23] uid = 1001, euid = 0, gid = 12, egid = 12
9976: [11/25/2013 13:12:23] loading preferences for user 
gh...@shadowprojects.org

...
9976: [11/25/2013 13:06:08] DSPAM Instance Shutdown.  Exit Code: 99
9976: [11/25/2013 13:06:08] process_users() failed on error 9

If i try to call dspam like this, it works :
sudo -u vmail /usr/bin/dspam --source=error --class=spam 
--signature=4be87a9f953248352114216 --client --user vmail


Any idea ?

Thanks,

--
  Guillaume Hilt



Re: [Dovecot] Dovecot 2.2.7/2.2.8 failing to call dspam with antispam

2013-11-25 Thread Guillaume Hilt

It works, there was just a mistake in my command line :

$ sudo -u vmail /usr/bin/dspam --source=error --class=spam 
--signature=89,52900600118151560172939 --client --user 
gh...@shadowprojects.org


...
16004: [11/25/2013 13:43:46] destroying/freeing configuration
16004: [11/25/2013 13:43:46] match attribute 'Broken' with value 
'returnCodes'

16004: [11/25/2013 13:43:46] find attribute 'Broken'
16004: [11/25/2013 13:43:46]  - found attribute 'Broken' with value 
'returnCodes'
16004: [11/25/2013 13:43:46]  - matched attribute 'Broken' with value 
'returnCodes'

16004: [11/25/2013 13:43:46] DSPAM Instance Shutdown.  Exit Code: 99
16004: [11/25/2013 13:43:46] SEND: 250 2.6.0 gh...@apteo.com Message 
accepted for delivery: SPAM

16004: [11/25/2013 13:43:46] checking trusted user list for root(0)
16004: [11/25/2013 13:43:46] SRECV: QUIT

The user ghilt@ exists in mysql dspam_virtual_uids table.

  Guillaume Hilt

Le 25/11/2013 13:39, Tom Hendrikx a écrit :

On 11/25/2013 01:17 PM, Guillaume Hilt wrote:

 Hello again,

I'm running Gentoo AMD64 2013 with postfix, mysql, dovecot and dspam :
dovecot 2.2.8 (it was working fine with 2.2.6 after doing a chmod 4511
on dspam binary), dspam 3.10.2-r1 and dovecot-antispam-2.0_pre20130429
(recompiled after each dovecot upgrade).

I've set dspam to debug, and mail_debug to yes.

uid 1001 is user vmail (dovecot is running under vmail)
gid 12 is group mail (vmail is a member, with
mail,postfix,dspam,dovecot,apache)
All the necessary users are trusted in dspam configuration.

Here's my plugin settings :
antispam_verbose_debug = 1
antispam_debug_target = syslog
antispam_backend = dspam
antispam_allow_append_to_spam = NO
antispam_skip_from_line = NO
antispam_spam = Spam
antispam_trash = Trash
antispam_signature = X-DSPAM-Signature
antispam_signature_missing = error
antispam_dspam_binary = /usr/bin/dspam
antispam_dspam_args = --user;%u;--deliver=;--source=error;--signature=%%s

Configured to use the mail recipient


antispam_dspam_spam = --class=spam
antispam_dspam_notspam = --class=innocent
antispam_dspam_result_header = X-DSPAM-Result

When i'm moving an email to the dspam folder, Thunderbird throw me an
error : Failed to call dspam (email is dropped in the Spam folder
anyway, but a copy stay on my INBOX)

== /var/log/mail/mail/log ==
Nov 25 13:01:04 srv1 dovecot: imap: Debug: Loading modules from
directory: /usr/lib64/dovecot
Nov 25 13:01:04 srv1 dovecot: imap: Debug: Module loaded:
/usr/lib64/dovecot/lib90_antispam_plugin.so
Nov 25 13:01:04 srv1 dovecot: imap: Debug: Added userdb setting:
plugin/maildir=shadowprojects.org/ghilt/
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug:
Effective uid=1001, gid=12, home=/home/vmail/shadowprojects.org/ghilt/
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug:
Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no,
list=yes, subscriptions=yes
location=maildir:/home/vmail/shadowprojects.org/ghilt/.maildir
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug:
maildir++: root=/home/vmail/shadowprojects.org/ghilt/.maildir, index=,
indexpvt=, control=,
inbox=/home/vmail/shadowprojects.org/ghilt/.maildir, alt=
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug:
Namespace : Using permissions from
/home/vmail/shadowprojects.org/ghilt/.maildir: mode=0770 gid=default
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug:
dspam error:29764 prefix=imap(gh...@shadowprojects.org):
Nov 25 13:01:04 srv1 dovecot: imap(gh...@shadowprojects.org): Debug:
executing /usr/bin/dspam failed: 13 (uid=1001, gid=12)
Nov 25 13:01:04 srv1 dovecot: imap: Error:
Nov 25 13:01:04 srv1 dovecot: imap: Error:

== /var/log/dspam/dspam.debug ==
9976: [11/25/2013 13:12:23] DSPAM Instance Startup
9976: [11/25/2013 13:12:23] input args: /usr/bin/dspam --user
gh...@shadowprojects.org --deliver= --source=error
--signature=89,52900600118151560172939 --class=spam

Called using the mail recipient


9976: [11/25/2013 13:12:23] pass-thru args:
9976: [11/25/2013 13:12:23] processing user gh...@shadowprojects.org
9976: [11/25/2013 13:12:23] uid = 1001, euid = 0, gid = 12, egid = 12
9976: [11/25/2013 13:12:23] loading preferences for user
gh...@shadowprojects.org
...
9976: [11/25/2013 13:06:08] DSPAM Instance Shutdown.  Exit Code: 99
9976: [11/25/2013 13:06:08] process_users() failed on error 9

If i try to call dspam like this, it works :
sudo -u vmail /usr/bin/dspam --source=error --class=spam
--signature=4be87a9f953248352114216 --client --user vmail

Called spam using some other user.


Any idea ?


The user ghilt@... is not recognized in your dspam setup. You should
change the antispam config to use a static username, or make dspam
accept your recipient addresses.


Regards,
Tom





[Dovecot] Dovecot antispam unable to call dspam since dovecot upgrade to 2.X

2013-11-14 Thread Guillaume Hilt
 binary is owned by dspam (chmod u+s) :
-r-s--x--- 1 dspam dspam 96K 14 nov.  10:08 /usr/bin/dspam


And all the necessary users are trusted by DSPAM :
Trust root
Trust dspam
Trust apache
Trust mail
Trust mailnull
Trust smmsp
Trust daemon
Trust vmail
Trust dovecot
Trust postfix

Any idea ?

Thanks,

--
  Guillaume Hilt



Re: [Dovecot] Dovecot antispam unable to call dspam since dovecot upgrade to 2.X

2013-11-14 Thread Guillaume Hilt

Le 15/11/2013 08:23, Steffen Kaiser a écrit :

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 14 Nov 2013, Benny Pedersen wrote:


Guillaume Hilt skrev den 2013-11-14 12:12:

When i'm moving a mail to or from the Spam folder, Igot this error 
in my logs :

Nov 14 10:33:25 srv1 dovecot: imap(gh...@shadowprojects.org): Debug:
dspam error:7751 prefix=imap(gh...@shadowprojects.org):


googled One More Thing :)

http://www.gentoo-wiki.info/HOWTO_Spam_Filtering_with_DSPAM_and_Postfix

see the section i googled, its know problem not yet resolved :/


Is this problem the same then that one?
http://www.reddit.com/r/linuxadmin/comments/1ljdq2/dovecot_virtual_users_and_dspam/ 



- From the problem description:
 I traced problem to the fact that dovecot seems to run dspam with 
uid/gid of virtual user. And dspam seem to be upset by it. 


So you need the make dspam run as vmail. Do you get the error if you 
execute


sudo -u vmail /usr/bin/dspam 

?

Indeed.
sudo: unable to execute /usr/bin/dspam: Permission denied


Then this advice from Benny's link might help:
One More Thing

There are a few loose ends to tie up. Without all this it wouldn't 
need masking after all.


mkdir /var/spool/dspam/log/
chown -R dspam:dspam /var/spool/dspam/

This was already good.


chmod 4511 /usr/bin/dspam

And this one fixed my issue, thanks :)
I'm going to fill a bug for Gentoo.


Note:- you will have to do this command again if you re-emarge or 
update dspam


- -or-

Maybe just the advice about trusting users from the reddit link:

Did you add the user to the trust list?

Trust dovecot Trust vmail

etc, etc. 

- -- Steffen Kaiser
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUoXL4l3r2wJMiz2NAQIjxwgAkcGR2jeu2Vmkn/8zjKy6vmQC0QifwXFv
AroTc8rNka8H/H8Ba2EXnkX6tEgtgmm4Zk856O6CUsy5QVxb3t7/JwAjcY3fv65y
JcRJXeLQPinki2xYP6wBS0bfZHXw7iaU1cd0ogcxbnO7GHk3Va5eRdZwgmQ38TXQ
oZ/1nskuDZVCaxRPN6f6m6Cofdpt5vhhte9mrd+Y0tbJpmOAhzzSPfgtbfFfdpbd
e4OLM5zpZb5aY5PTV3ZhMt9UkmuiVG2uWSK8uf9jiWJ7e0FvWcgEmTBRFqymptcY
U0DvcNCu00p2/raH3k4zsEck7s4bJcdF4kdIViyyqsB11w6q1yNPOQ==
=MfrR
-END PGP SIGNATURE-





[Dovecot] Problem compiling dovecot-antispam on Ubuntu 11.10 using Doveot 2.0.13

2012-03-31 Thread Guillaume Hilt

Hello,

Last dovecot available version on Ubuntu 11.10 AMD64 is dovecot 2.0.13.
dovecot-antispam package is compiled for dovecot 2.0.15.

So, i'm trying to compile a new dovecot antispam plugin.
I followed dovecot wiki but i'm running into this error :
Successfully compiled dspam.c (plugin).
mailbox.c: In function 'antispam_save_begin':
mailbox.c:138:12: error: 'struct mail_save_context' has no member named 
'copying_via_save'

mailbox.c: In function 'antispam_save_finish':
mailbox.c:174:12: error: 'struct mail_save_context' has no member named 
'copying_via_save'

Failed to compile mailbox.c (plugin)!

Any hint please ?

Regards,

--
  Guillaume Hilt



Re: [Dovecot] Problem compiling dovecot-antispam on Ubuntu 11.10 using Doveot 2.0.13

2012-03-31 Thread Guillaume Hilt

Thanks, compilation works fine now.

  Guillaume Hilt


Le 31/03/2012 19:01, e-frog a écrit :

On 31.03.2012 18:55, wrote Guillaume Hilt:

Hello,

Last dovecot available version on Ubuntu 11.10 AMD64 is dovecot 2.0.13.
dovecot-antispam package is compiled for dovecot 2.0.15.

So, i'm trying to compile a new dovecot antispam plugin.
I followed dovecot wiki but i'm running into this error :
Successfully compiled dspam.c (plugin).
mailbox.c: In function 'antispam_save_begin':
mailbox.c:138:12: error: 'struct mail_save_context' has no member named
'copying_via_save'
mailbox.c: In function 'antispam_save_finish':
mailbox.c:174:12: error: 'struct mail_save_context' has no member named
'copying_via_save'
Failed to compile mailbox.c (plugin)!

Any hint please ?

Regards,



Revert this patch and it should work:

http://hg.dovecot.org/dovecot-antispam-plugin/rev/5e8351bcfb29






Re: [Dovecot] CMUSieve with virtual users

2009-03-31 Thread Guillaume HILT

Is there an incompatibily I could have fallen into ?

Guillaume Hilt a écrit :

I'm back with this problem since i never found a way to fix it.
I'm now using dovecot 1.1.13 (still under Gentoo) and I tried something.
I modified the lda section from this :
mail_plugins = cmusieve

To this :
mail_plugins = sieve

The problem is that dovecot never complained that it can't found the 
sieve or cmusieve plugin although sieve is present and enabled with 
dovecot.
Looks like it doesn't care about it and doesn't try to load it (it 
would explain why sieve isn't working).


I used thse flags mysql pam pop3d sieve ssl.
The only difference with my other config, with is working fine, is 
that i added the ipv6 flag on this one and i'm not using virtual users 
or pop3.


Now i'm confused ...

 Guillaume Hilt



Guillaume Hilt a écrit :


Guillaume Hilt a écrit :

Alex a écrit :

Roderick A. Anderson wrote:



Guillaume Hilt wrote:


Alex a écrit :

Guillaume HILT wrote:

Upgrade done and running, but it didn't fixed the problem :x

Alex a écrit :
I had been the same issue with 1.1.7. Try to unmask the 
1.1.10-r1 and install; it solve my issue.


Do you see anything in your log?

Nothing about sieve.


Interestingly enough there appear to be some values in the 
dovecot.conf that don't show up with (when I try in on my system) 
a dovecot -n.  I must admit I'm surprised everything _seems_ to be 
working as I've had some formatting issues in the dovecot.conf file


Anyway; specifically the lda stuff.

Here's mine slightly munged.

protocol lda {
  log_path = /var/log/dovecot/dovecot-deliver.log
  auth_socket_path = /var/run/dovecot/auth-master
  postmaster_address = postmas...@mydomain.com
  hostname = mx0.mydomain.com
  mail_plugins = cmusieve
  mail_plugin_dir = /usr/lib/dovecot/lda
}



Here's mine :

protocol lda {
 postmaster_address = postmas...@mydomain.com
 hostname = mail.mydomain.com
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda
 log_path = /var/log/mail/dovecot-deliver.log
 info_log_path = /var/log/mail/dovecot-deliver.log
 sendmail_path = /usr/sbin/sendmail
 rejection_reason = Votre message pour %t a été rejeté:%n%r
 auth_socket_path = /var/run/dovecot/auth-master
 fsync_disable = no
}


Rod


Did you defined sieve_global_path = /etc/dovecot/sieve/default.sieve?
Remeber to change ownership to default.sieve file with your vmail 
user and group.



No, I didn't defined it.
And my .dovecot.sieve files are owned by vmail and mail, 
respectively my vmail user and group :)


The only difference I found with this current setup and my other 
server (except for the virtual user configuration on this server) is 
that i compiled dovecot without pop3d on the other one, and with it 
on this one (and since pop3 is currently used, i can't afford to 
remove it).






Re: [Dovecot] CMUSieve with virtual users

2009-03-31 Thread Guillaume HILT
Mar 31 17:29:55 srv1 postfix/qmgr[30752]: A2C0677460ED: 
from=postmas...@shadowprojects.org, size=902, nrcpt=1 (queue active)
Mar 31 17:29:55 srv1 postfix/smtpd[12284]: disconnect from 
rendez-vous.shadowprojects.fr[91.121.100.167]

Mar 31 15:29:55 srv1 postfix/smtpd[12897]: connect from unknown[127.0.0.1]
Mar 31 15:29:55 srv1 postfix/smtpd[12897]: 4C74977460FE: 
client=unknown[127.0.0.1]
Mar 31 17:29:55 srv1 postfix/cleanup[12810]: 4C74977460FE: 
message-id=49d236e0.6060...@shadowprojects.org
Mar 31 17:29:55 srv1 postfix/qmgr[30752]: 4C74977460FE: 
from=postmas...@shadowprojects.org, size=1339, nrcpt=1 (queue active)
Mar 31 15:29:55 srv1 postfix/smtpd[12897]: disconnect from 
unknown[127.0.0.1]
Mar 31 17:29:55 srv1 postfix/lmtp[12879]: A2C0677460ED: 
to=gh...@domain2.com, 
relay=mail.domain2.com[/var/run/dspam/dspam.sock], delay=1.1, 
delays=0.56/0/0/0.5, dsn=2.6.0, status=sent (250 2.6.0 
gh...@domain2.com Message accepted for delivery)

Mar 31 17:29:55 srv1 postfix/qmgr[30752]: A2C0677460ED: removed
Mar 31 17:29:55 srv1 postfix/qmgr[30752]: 4C74977460FE: removed
Mar 31 17:29:55 srv1 postfix/virtual[13438]: 4C74977460FE: 
to=gh...@domain2.com, relay=virtual, delay=0.5, delays=0.45/0/0/0.04, 
dsn=2.0.0, status=sent (delivered to maildir)


Mar 31 18:13:05 srv1 dovecot: imap-login: Login: 
user=ethieblem...@domain.com, method=PLAIN, rip=216.9.253.200, 
lip=91.121.50.194
Mar 31 18:13:05 srv1 dovecot: IMAP(ethieblem...@domain.com): Loading 
modules from directory: /usr/lib/dovecot/imap
Mar 31 18:13:05 srv1 dovecot: IMAP(ethieblem...@domain.com): Module 
loaded: /usr/lib/dovecot/imap/lib90_antispam_plugin.so
Mar 31 18:13:05 srv1 dovecot: IMAP(ethieblem...@domain.com): Effective 
uid=1001, gid=12, home=/home/vmail/domain.com/ethieblemont/
Mar 31 18:13:05 srv1 dovecot: IMAP(ethieblem...@domain.com): maildir: 
data=/home/vmail/domain.com/ethieblemont/.maildir
Mar 31 18:13:05 srv1 dovecot: IMAP(ethieblem...@domain.com): maildir++: 
root=/home/vmail/domain.com/ethieblemont/.maildir, index=, control=, 
inbox=/home/vmail/domain.com/ethieblemont/.maildir


The path are correct and I have a .dovecot.sieve file in the user folder 
(on the same level with .maildir).


Here's my dovecot conf  (1.1.13) with libsieve (2.2.7) on a Gentoo x64 
box :


I have this under the lda protocol section, although dovecot -n doesn't 
show it :

 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda

# dovecot -n
# 1.1.13: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.28-gentoo-r1--std-ipv4-64 x86_64 Gentoo Base System 
release 1.12.11.1 ext3

base_dir: /var/run/dovecot/
protocols: imap pop3
listen(default): *:143
listen(imap): *:143
listen(pop3): *:110
disable_plaintext_auth: no
login_dir: /var/run/dovecot//login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
first_valid_uid: 1001
last_valid_uid: 1001
mail_privileged_group: mail
mail_uid: vmail
mail_gid: mail
mail_location: maildir:/home/vmail/%d/%n/.maildir
mail_debug: yes
fsync_disable: yes
maildir_copy_preserve_filename: yes
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): antispam
mail_plugins(imap): antispam
mail_plugins(pop3):
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
imap_client_workarounds(default): delay-newmail
imap_client_workarounds(imap): delay-newmail
imap_client_workarounds(pop3):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
 user: nobody
 gssapi_hostname: mail.domain2.com
 passdb:
   driver: sql
   args: /etc/dovecot/dovecot-sql.conf
 userdb:
   driver: sql
   args: /etc/dovecot/dovecot-sql.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/private/auth
 mode: 432
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 438
 user: vmail
 group: mail
plugin:
 antispam_signature: X-DSPAM-Signature
 antispam_signature_missing: error
 antispam_trash: Trash
 antispam_spam: Spam
 antispam_dspam_binary: /usr/bin/dspam

Timo Sirainen a écrit :

On Mar 29, 2009, at 6:28 AM, Guillaume Hilt wrote:


I'm back with this problem since i never found a way to fix it.
I'm now using dovecot 1.1.13 (still under Gentoo) and I tried something.
I modified the lda section from this :
mail_plugins = cmusieve

To this :
mail_plugins = sieve

The problem is that dovecot never complained that it can't found the 
sieve or cmusieve plugin although sieve is present and enabled with 
dovecot.
Looks like it doesn't care about it and doesn't try to load it (it 
would explain why sieve isn't working).


If you list a plugin that Dovecot can't load, it definitely will give 
an error message

Re: [Dovecot] CMUSieve with virtual users

2009-03-31 Thread Guillaume Hilt
I modified my dspam conf file to transfer the message to deliver but the 
problem is still the same.

Even with debug enabled, I don't see a line about deliver in my logs.

 Guillaume Hilt



Timo Sirainen a écrit :

On Mar 31, 2009, at 12:20 PM, Guillaume HILT wrote:

Mar 31 17:29:55 srv1 postfix/virtual[13438]: 4C74977460FE: 
to=gh...@domain2.com, relay=virtual, delay=0.5, 
delays=0.45/0/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)


Postfix's virtual transport is delivering the mail. Dovecot's deliver 
is never even called.





Re: [Dovecot] CMUSieve with virtual users

2009-03-31 Thread Guillaume Hilt

It does.

deliver(gh...@domain2.com): Mar 31 19:22:50 Warning: Growing pool 'Cache 
fields' with: 2048
Mar 31 19:22:51 srv1 postfix/lmtp[14367]: BB74477460FE: 
to=gh...@domain2.com, 
relay=mail.domain2.com[/var/run/dspam/dspam.sock], delay=0.43, 
delays=0.1/0/0/0.33, dsn=2.6.0, status=sent (250 2.6.0 
gh...@domain2.com Message accepted for delivery)

Mar 31 19:22:51 srv1 postfix/qmgr[14353]: BB74477460FE: removed

Here's the lines in dspam :
TrustedDeliveryAgent /usr/libexec/dovecot/deliver -d %u
UntrustedDeliveryAgent /usr/libexec/dovecot/deliver -d %u

Postfix isn't delivering the mail anymore, it transfer them to dspam 
which calls deliver since it can't deliver them itself.


 Guillaume Hilt



Timo Sirainen a écrit :

The problem isn't with dspam or Dovecot configuration files. It's that
your Postfix is configured to write the mail directly to the Maildir. I
don't think your Postfix even calls dspam. As long as you see
postfix/virtual line in your logs, Postfix is delivering the mail
itself.

On Tue, 2009-03-31 at 19:11 +0200, Guillaume Hilt wrote:
  
I modified my dspam conf file to transfer the message to deliver but the 
problem is still the same.

Even with debug enabled, I don't see a line about deliver in my logs.

  Guillaume Hilt



Timo Sirainen a écrit :


On Mar 31, 2009, at 12:20 PM, Guillaume HILT wrote:

  
Mar 31 17:29:55 srv1 postfix/virtual[13438]: 4C74977460FE: 
to=gh...@domain2.com, relay=virtual, delay=0.5, 
delays=0.45/0/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)

Postfix's virtual transport is delivering the mail. Dovecot's deliver 
is never even called.



  


Re: [Dovecot] CMUSieve with virtual users

2009-03-31 Thread Guillaume Hilt


Timo Sirainen a écrit :

On Tue, 2009-03-31 at 19:27 +0200, Guillaume Hilt wrote:
  

It does.

deliver(gh...@domain2.com): Mar 31 19:22:50 Warning: Growing pool 'Cache 
fields' with: 2048



OK, so here's finally a line from deliver. Now show the whole debug
output of deliver. It probably was written to a different file. See
http://wiki.dovecot.org/Logging and http://wiki.dovecot.org/LDA#logging

deliver always logs a line such as:

deliver(timo): Jan 13 13:47:16 Info: msgid=a...@b: saved mail to INBOX

Find the file that has that line, and show the full debug output of
what's before that line.
  

Yeah, in fact i log this into mail.info and now it works.
Looks like I forgot to use deliver :x

deliver(gh...@domain2.com): Mar 31 19:41:58 Info: cmusieve: Using sieve 
path: /home/vmail/domain2.com/ghilt/.dovecot.sieve
deliver(gh...@domain2.com): Mar 31 19:41:58 Info: cmusieve: Executing 
script /home/vmail/domain2.com/ghilt/.dovecot.sievec
deliver(gh...@domain2.com): Mar 31 19:41:59 Info: 
msgid=49d255e3.1000...@shadowprojects.org: saved mail to INBOX.Portage

Also you have configured Dovecot with --enable-devel-checks, which
causes Dovecot to log some information that's mainly useful for
developers. It also includes extra checks that slow things down in
normal use. You most likely want to disable it by reconfiguring and
reinstalling.
  
I know. It was on purpose to see if it could provide me some useful 
informations about my problem.


Thanks for your help Timo, sorry the time loss for such a stupid mistake.


Re: [Dovecot] CMUSieve with virtual users

2009-03-29 Thread Guillaume Hilt

I'm back with this problem since i never found a way to fix it.
I'm now using dovecot 1.1.13 (still under Gentoo) and I tried something.
I modified the lda section from this :
mail_plugins = cmusieve

To this :
mail_plugins = sieve

The problem is that dovecot never complained that it can't found the 
sieve or cmusieve plugin although sieve is present and enabled with dovecot.
Looks like it doesn't care about it and doesn't try to load it (it would 
explain why sieve isn't working).


I used thse flags mysql pam pop3d sieve ssl.
The only difference with my other config, with is working fine, is that 
i added the ipv6 flag on this one and i'm not using virtual users.


Now i'm confused ...

 Guillaume Hilt



Guillaume Hilt a écrit :


Guillaume Hilt a écrit :

Alex a écrit :

Roderick A. Anderson wrote:



Guillaume Hilt wrote:


Alex a écrit :

Guillaume HILT wrote:

Upgrade done and running, but it didn't fixed the problem :x

Alex a écrit :
I had been the same issue with 1.1.7. Try to unmask the 
1.1.10-r1 and install; it solve my issue.


Do you see anything in your log?

Nothing about sieve.


Interestingly enough there appear to be some values in the 
dovecot.conf that don't show up with (when I try in on my system) a 
dovecot -n.  I must admit I'm surprised everything _seems_ to be 
working as I've had some formatting issues in the dovecot.conf file


Anyway; specifically the lda stuff.

Here's mine slightly munged.

protocol lda {
  log_path = /var/log/dovecot/dovecot-deliver.log
  auth_socket_path = /var/run/dovecot/auth-master
  postmaster_address = postmas...@mydomain.com
  hostname = mx0.mydomain.com
  mail_plugins = cmusieve
  mail_plugin_dir = /usr/lib/dovecot/lda
}



Here's mine :

protocol lda {
 postmaster_address = postmas...@mydomain.com
 hostname = mail.mydomain.com
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda
 log_path = /var/log/mail/dovecot-deliver.log
 info_log_path = /var/log/mail/dovecot-deliver.log
 sendmail_path = /usr/sbin/sendmail
 rejection_reason = Votre message pour %t a été rejeté:%n%r
 auth_socket_path = /var/run/dovecot/auth-master
 fsync_disable = no
}


Rod


Did you defined sieve_global_path = /etc/dovecot/sieve/default.sieve?
Remeber to change ownership to default.sieve file with your vmail 
user and group.



No, I didn't defined it.
And my .dovecot.sieve files are owned by vmail and mail, respectively 
my vmail user and group :)


The only difference I found with this current setup and my other 
server (except for the virtual user configuration on this server) is 
that i compiled dovecot without pop3d on the other one, and with it on 
this one (and since pop3 is currently used, i can't afford to remove it).




Re: [Dovecot] CMUSieve with virtual users

2009-02-22 Thread Guillaume Hilt


Guillaume Hilt a écrit :

Alex a écrit :

Roderick A. Anderson wrote:



Guillaume Hilt wrote:


Alex a écrit :

Guillaume HILT wrote:

Upgrade done and running, but it didn't fixed the problem :x

Alex a écrit :
I had been the same issue with 1.1.7. Try to unmask the 
1.1.10-r1 and install; it solve my issue.


Do you see anything in your log?

Nothing about sieve.


Interestingly enough there appear to be some values in the 
dovecot.conf that don't show up with (when I try in on my system) a 
dovecot -n.  I must admit I'm surprised everything _seems_ to be 
working as I've had some formatting issues in the dovecot.conf file


Anyway; specifically the lda stuff.

Here's mine slightly munged.

protocol lda {
  log_path = /var/log/dovecot/dovecot-deliver.log
  auth_socket_path = /var/run/dovecot/auth-master
  postmaster_address = postmas...@mydomain.com
  hostname = mx0.mydomain.com
  mail_plugins = cmusieve
  mail_plugin_dir = /usr/lib/dovecot/lda
}



Here's mine :

protocol lda {
 postmaster_address = postmas...@mydomain.com
 hostname = mail.mydomain.com
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda
 log_path = /var/log/mail/dovecot-deliver.log
 info_log_path = /var/log/mail/dovecot-deliver.log
 sendmail_path = /usr/sbin/sendmail
 rejection_reason = Votre message pour %t a été rejeté:%n%r
 auth_socket_path = /var/run/dovecot/auth-master
 fsync_disable = no
}


Rod


Did you defined sieve_global_path = /etc/dovecot/sieve/default.sieve?
Remeber to change ownership to default.sieve file with your vmail 
user and group.



No, I didn't defined it.
And my .dovecot.sieve files are owned by vmail and mail, respectively 
my vmail user and group :)


The only difference I found with this current setup and my other server 
(except for the virtual user configuration on this server) is that i 
compiled dovecot without pop3d on the other one, and with it on this one 
(and since pop3 is currently used, i can't afford to remove it).


Re: [Dovecot] CMUSieve with virtual users

2009-02-21 Thread Guillaume Hilt

Alex a écrit :

Roderick A. Anderson wrote:



Guillaume Hilt wrote:


Alex a écrit :

Guillaume HILT wrote:

Upgrade done and running, but it didn't fixed the problem :x

Alex a écrit :
I had been the same issue with 1.1.7. Try to unmask the 
1.1.10-r1 and install; it solve my issue.


Do you see anything in your log?

Nothing about sieve.


Interestingly enough there appear to be some values in the 
dovecot.conf that don't show up with (when I try in on my system) a 
dovecot -n.  I must admit I'm surprised everything _seems_ to be 
working as I've had some formatting issues in the dovecot.conf file


Anyway; specifically the lda stuff.

Here's mine slightly munged.

protocol lda {
  log_path = /var/log/dovecot/dovecot-deliver.log
  auth_socket_path = /var/run/dovecot/auth-master
  postmaster_address = postmas...@mydomain.com
  hostname = mx0.mydomain.com
  mail_plugins = cmusieve
  mail_plugin_dir = /usr/lib/dovecot/lda
}



Here's mine :

protocol lda {
 postmaster_address = postmas...@mydomain.com
 hostname = mail.mydomain.com
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda
 log_path = /var/log/mail/dovecot-deliver.log
 info_log_path = /var/log/mail/dovecot-deliver.log
 sendmail_path = /usr/sbin/sendmail
 rejection_reason = Votre message pour %t a été rejeté:%n%r
 auth_socket_path = /var/run/dovecot/auth-master
 fsync_disable = no
}


Rod


Did you defined sieve_global_path = /etc/dovecot/sieve/default.sieve?
Remeber to change ownership to default.sieve file with your vmail user 
and group.



No, I didn't defined it.
And my .dovecot.sieve files are owned by vmail and mail, respectively my 
vmail user and group :)


[Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume HILT

   Hi,

I'm using dovecot 1.1.7 on Gentoo with Postfix and PostfixAdmin to 
manage my virtual users.
I'm trying to use sieve (which has been compiled with Dovecot) but it 
doesn't work.


I added cmusieve in the lda protocol :
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda

My maildir scheme is : /home/vmail/%d/%n/.maildir
The sieve file is in /home/vmail/%d/%n/.dovecot.sieve (i'm using the 
sieve variable in the plugin section).

I also tried in /home/vmail/%d/%n/.maildir/.dovecot.sieve.
Then I tried in /var/sieve-scripts/%u.sieve.
None of these solutions worked :x

I enabled all the debug options in dovecot, and i can't see anything 
about sieve in my logs.


I'm using the same configuration without virtual users on another server 
and it's working fine.

I'm out of ideas.

Could someone has managed to use sieve scripts with virtual users ?

Thanks :)

   Guillaume


Re: [Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume HILT



Alex a écrit :

Guillaume HILT wrote:

Hi,


   Hi,

I'm using dovecot 1.1.7 on Gentoo with Postfix and PostfixAdmin to 
manage my virtual users.
I'm trying to use sieve (which has been compiled with Dovecot) but it 
doesn't work.


I added cmusieve in the lda protocol :
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda

My maildir scheme is : /home/vmail/%d/%n/.maildir
The sieve file is in /home/vmail/%d/%n/.dovecot.sieve (i'm using the 
sieve variable in the plugin section).

I also tried in /home/vmail/%d/%n/.maildir/.dovecot.sieve.
Then I tried in /var/sieve-scripts/%u.sieve.
None of these solutions worked :x

I enabled all the debug options in dovecot, and i can't see anything 
about sieve in my logs.


I'm using the same configuration without virtual users on another 
server and it's working fine.

I'm out of ideas.



Did you compile dovecot with sieve in USE flag?


As I said 'm trying to use sieve (which has been compiled with 
Dovecot), yes :)


Re: [Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume HILT



Alex a écrit :

Guillaume HILT wrote:



Alex a écrit :

Guillaume HILT wrote:

Hi,


   Hi,

I'm using dovecot 1.1.7 on Gentoo with Postfix and PostfixAdmin to 
manage my virtual users.
I'm trying to use sieve (which has been compiled with Dovecot) but 
it doesn't work.


I added cmusieve in the lda protocol :
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda

My maildir scheme is : /home/vmail/%d/%n/.maildir
The sieve file is in /home/vmail/%d/%n/.dovecot.sieve (i'm using 
the sieve variable in the plugin section).

I also tried in /home/vmail/%d/%n/.maildir/.dovecot.sieve.
Then I tried in /var/sieve-scripts/%u.sieve.
None of these solutions worked :x

I enabled all the debug options in dovecot, and i can't see 
anything about sieve in my logs.


I'm using the same configuration without virtual users on another 
server and it's working fine.

I'm out of ideas.



Did you compile dovecot with sieve in USE flag?


As I said 'm trying to use sieve (which has been compiled with 
Dovecot), yes :)

:)
I had been the same issue with 1.1.7. Try to unmask the 1.1.10-r1 and 
install; it solve my issue.


When migrating from 1.1.7 to 1.1.10-r1, did you had any issues or 
configuration update to do ?
Since i'm pretty busy right now, i don't want to create a problem with 
our mailserver :)


Re: [Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume HILT



Alex a écrit :

Guillaume HILT wrote:



Alex a écrit :

Guillaume HILT wrote:



Alex a écrit :

Guillaume HILT wrote:

Hi,


   Hi,

I'm using dovecot 1.1.7 on Gentoo with Postfix and PostfixAdmin 
to manage my virtual users.
I'm trying to use sieve (which has been compiled with Dovecot) 
but it doesn't work.


I added cmusieve in the lda protocol :
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda

My maildir scheme is : /home/vmail/%d/%n/.maildir
The sieve file is in /home/vmail/%d/%n/.dovecot.sieve (i'm using 
the sieve variable in the plugin section).

I also tried in /home/vmail/%d/%n/.maildir/.dovecot.sieve.
Then I tried in /var/sieve-scripts/%u.sieve.
None of these solutions worked :x

I enabled all the debug options in dovecot, and i can't see 
anything about sieve in my logs.


I'm using the same configuration without virtual users on another 
server and it's working fine.

I'm out of ideas.



Did you compile dovecot with sieve in USE flag?


As I said 'm trying to use sieve (which has been compiled with 
Dovecot), yes :)

:)
I had been the same issue with 1.1.7. Try to unmask the 1.1.10-r1 
and install; it solve my issue.


When migrating from 1.1.7 to 1.1.10-r1, did you had any issues or 
configuration update to do ?
Since i'm pretty busy right now, i don't want to create a problem 
with our mailserver :)


Can you paste here a grep sieve from your /var/log/dovecot-deliver.log?
The fact is, even with log_path and info_log_path enabled in the lda 
section, i don't have anything about sieve in my logs.


==

The upgrade process is quite easy, nothing to change in dovecot config.
Before upgrade I suggest to do this action:

- backup with tar your /etc/dovecot dir;
- emerge -B dovecot (so you have a binary copy for your working version)
- echo net-mail/dovecot ~arch  /etc/portage/package.keywords
- emerge -av dovecot

when merge is finished *don't* do etc-update.

If something goes wrong you will come back to 1.1.7 without problem. 
Just recover your backup.


my2cents
:)


Thanks :)


Re: [Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume HILT


Roderick A. Anderson a écrit :



Guillaume HILT wrote:

   Hi,

I'm using dovecot 1.1.7 on Gentoo with Postfix and PostfixAdmin to 
manage my virtual users.
I'm trying to use sieve (which has been compiled with Dovecot) but it 
doesn't work.


I added cmusieve in the lda protocol :
 mail_plugins = cmusieve
 mail_plugin_dir = /usr/lib/dovecot/lda

My maildir scheme is : /home/vmail/%d/%n/.maildir
The sieve file is in /home/vmail/%d/%n/.dovecot.sieve (i'm using the 
sieve variable in the plugin section).

I also tried in /home/vmail/%d/%n/.maildir/.dovecot.sieve.
Then I tried in /var/sieve-scripts/%u.sieve.
None of these solutions worked :x

I enabled all the debug options in dovecot, and i can't see anything 
about sieve in my logs.


I'm using the same configuration without virtual users on another 
server and it's working fine.

I'm out of ideas.

Could someone has managed to use sieve scripts with virtual users ?


I have.

CentOS 5.2
dovecot-1.1.11-0_90.el5
postfix-2.3.3-2.1.el5_2
dovecot-sieve-1.1.6-9.el5

What is your plugin {} setting.  I have

sieve = /home/vmail/%d/%n/.dovecot.sieve


plugin {
   sieve = /var/mail/vhosts/%d/%n/dovecot.sieve
}

Rod


Re: [Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume HILT

I don't have any sieve error file.

# dovecot -n
# 1.1.11: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.28-gentoo-r1--std-ipv4-64 x86_64 Gentoo Base System 
release 1.12.11.1 ext3

base_dir: /var/run/dovecot/
log_path: /var/log/mail/dovecot.log
info_log_path: /var/log/mail/dovecot.info
protocols: imap imaps pop3 pop3s
listen(default): *:143
listen(imap): *:143
listen(pop3): *:110
ssl_listen(default): *:993
ssl_listen(imap): *:993
ssl_listen(pop3): *:995
ssl_cert_file: /etc/ssl/dovecot/server.pem
ssl_key_file: /etc/ssl/dovecot/server.key
disable_plaintext_auth: no
login_dir: /var/run/dovecot//login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
first_valid_uid: 1001
last_valid_uid: 1001
mail_privileged_group: mail
mail_uid: vmail
mail_gid: mail
mail_location: maildir:/home/vmail/%d/%n/.maildir
maildir_copy_preserve_filename: yes
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): antispam
mail_plugins(imap): antispam
mail_plugins(pop3):
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
imap_client_workarounds(default): delay-newmail
imap_client_workarounds(imap): delay-newmail
imap_client_workarounds(pop3):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
 user: nobody
 gssapi_hostname: mail.myserver.com
 passdb:
   driver: sql
   args: /etc/dovecot/dovecot-sql.conf
 userdb:
   driver: sql
   args: /etc/dovecot/dovecot-sql.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/private/auth
 mode: 432
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 432
 user: vmail
 group: mail
plugin:
 quota_warning: storage=95%% /usr/local/bin/quota-warning.sh 95
 quota_warning2: storage=80%% /usr/local/bin/quota-warning.sh 80
 quota: maildir
 antispam_signature: X-DSPAM-Signature
 antispam_signature_missing: error
 antispam_trash: Trash
 antispam_spam: Spam
 antispam_dspam_binary: /usr/bin/dspam
 sieve: /home/vmail/%d/%n/.dovecot.sieve
dict:
 quota: mysql:/etc/dovecot/dovecot-dict-quota.conf


Re: [Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume HILT

Upgrade done and running, but it didn't fixed the problem :x

Alex a écrit :
I had been the same issue with 1.1.7. Try to unmask the 1.1.10-r1 
and install; it solve my issue.


Re: [Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume HILT

# /etc/init.d/dovecot restart
* Service dovecot stopping
* Service dovecot stopped
* Service dovecot starting
ILoading modules from directory: /usr/lib/dovecot/imap
IModule loaded: /usr/lib/dovecot/imap/lib90_antispam_plugin.so
IEffective uid=65534, gid=65534, home=/tmp
* Service dovecot started

Why don't I see cmusieve ?

Still nothing about sieve in the logs ...

Roderick A. Anderson a écrit :



Guillaume HILT wrote:

I don't have any sieve error file.


Do you have and messages in the dovecot (or postfix) log files that 
relate to 'sieve'?


Here is the one I got when I'd forgotten to install dovecot-sieve (yum 
or rpm)


deliver(i...@mydomain.com): Feb 03 08:39:27 Fatal: Plugin
 cmusieve not found from directory /usr/lib/dovecot/lda

And this after I installed dovecot-sieve and it was working for 
another account.


deliver(raand...@mydomain.com): Feb 20 08:47:25 Info: cmusieve: 
Executing script /var/mail/vhosts/mydomain.com/raanders/dovecot.sievec


And then this if there is no dovecot.sieve file (I don't hide mine 
like in the examples as this is a virtual mailbox server.)


deliver(i...@aesoft-sbcs.com): Feb 17 13:42:42 Info: cmusieve:
/var/mail/vhosts/mydomain.com/info/dovecot.sieve doesn't exist


Rod


Re: [Dovecot] CMUSieve with virtual users

2009-02-20 Thread Guillaume Hilt


Alex a écrit :

Guillaume HILT wrote:

Upgrade done and running, but it didn't fixed the problem :x

Alex a écrit :
I had been the same issue with 1.1.7. Try to unmask the 1.1.10-r1 
and install; it solve my issue.


Do you see anything in your log?

Nothing about sieve.


Re: [Dovecot] I've moved to US

2009-02-07 Thread Guillaume Hilt


Timo Sirainen a écrit :

And if it's not clear from that blog: Pretty much everything I do here
will be Dovecot improvements that will be released as open source.
Mailtrust has actually been paying for Dovecot features for about 3
years now.

  

I don't know them, but I already love them :D


Re: [Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-03 Thread Guillaume Hilt

Timo Sirainen a écrit :

On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:

Jan  2 14:48:52 mail deliver(postmas...@adomain.fr): chdir(/root) 
failed: Permission denied

..

Why does it look inside the /root folder for sieve configuration ?


Your userdb returns /root as home directory. Show your 
dovecot-sql.conf and enable auth_debug=yes and show the logs again.




Oh.

Here's the relevant part of my dovecot-sql.conf file : (it uses the 
database created for postfixadmin)


connect = host=localhost dbname=X user= password= client_flags=0
default_pass_scheme = MD5-CRYPT
password_query = SELECT password FROM mailbox WHERE username = '%u'
user_query = SELECT maildir, 207 AS uid, 207 AS gid FROM mailbox WHERE 
username = '%u' (that's postfix uid and gid since I don't use a vmail 
user but postfix)


Ok I saw the problem.
Postfixadmin inly store a portion of the maildir path.
Instead of storing /home/vmail/domain/user it stores domain/user.

Thanks :)



Re: [Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-03 Thread Guillaume Hilt
Anyway, I correct the sql request by adding a concat with .home/vmail/ 
and now I have the good home directory but the error still occurs.

Setting sieve_global_dir didn't change anything.

 Guillaume Hilt




Timo Sirainen a écrit :

On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:


Timo Sirainen a écrit :

On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:

Jan  2 14:48:52 mail deliver(postmas...@adomain.fr): chdir(/root) 
failed: Permission denied

..

Why does it look inside the /root folder for sieve configuration ?


Your userdb returns /root as home directory. Show your 
dovecot-sql.conf and enable auth_debug=yes and show the logs again.




Oh.

Postfixadmin inly store a portion of the maildir path.
Instead of storing /home/vmail/domain/user it stores domain/user.



OK. Looks like I was a bit wrong. Your userdb doesn't return any home 
directory (it's preferred to return one, 
http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver preserves 
HOME environment which is set to /root in your case. That causes the 
chdir() error. I think I'll have to do something about this in v1.2. 
The HOME environment shouldn't be preserved when using -d parameter.





Re: [Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-03 Thread Guillaume Hilt

In dovecot-sql.conf

user_query = SELECT CONCAT('/home/vmail/',maildir) AS maildir, 207 AS 
uid, 207 AS gid FROM mailbox WHERE username = '%u'

So I'll have a complete path like /home/vmail/mydomain/myuser/.

 Guillaume Hilt




Timo Sirainen a écrit :
Where did you add that? You'll need to return a home field from 
user_query poiting to the sieve script directory.


On Jan 3, 2009, at 10:35 AM, Guillaume Hilt wrote:

Anyway, I correct the sql request by adding a concat with 
.home/vmail/ and now I have the good home directory but the error 
still occurs.

Setting sieve_global_dir didn't change anything.

Guillaume Hilt




Timo Sirainen a écrit :

On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:


Timo Sirainen a écrit :

On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:

Jan  2 14:48:52 mail deliver(postmas...@adomain.fr): chdir(/root) 
failed: Permission denied

..

Why does it look inside the /root folder for sieve configuration ?


Your userdb returns /root as home directory. Show your 
dovecot-sql.conf and enable auth_debug=yes and show the logs again.




Oh.

Postfixadmin inly store a portion of the maildir path.
Instead of storing /home/vmail/domain/user it stores domain/user.



OK. Looks like I was a bit wrong. Your userdb doesn't return any 
home directory (it's preferred to return one, 
http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver preserves 
HOME environment which is set to /root in your case. That causes the 
chdir() error. I think I'll have to do something about this in v1.2. 
The HOME environment shouldn't be preserved when using -d parameter.








Re: [Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-03 Thread Guillaume Hilt

I'll try that.
For the mail location, it's already the case : ~/.maildir

 Guillaume Hilt




Timo Sirainen a écrit :
maildir field isn't used for anything. Perhaps there is some 
completely undocumented and unreliable code that makes use of it for 
pop3/imap, but it is used in no way by Sieve. Try something like:


user_query = SELECT CONCAT('/home/vmail', maildir) AS home, 207 AS 
uid, 207 AS gid FROM mailbox WHERE username = '%u'


And in dovecot.conf:

mail_location = maildir:~/

(or actually preferrably mail_location = maildir:~/Maildir if can 
afford to change it).


On Jan 3, 2009, at 10:43 AM, Guillaume Hilt wrote:


In dovecot-sql.conf

user_query = SELECT CONCAT('/home/vmail/',maildir) AS maildir, 207 AS 
uid, 207 AS gid FROM mailbox WHERE username = '%u'

So I'll have a complete path like /home/vmail/mydomain/myuser/.

Guillaume Hilt




Timo Sirainen a écrit :
Where did you add that? You'll need to return a home field from 
user_query poiting to the sieve script directory.


On Jan 3, 2009, at 10:35 AM, Guillaume Hilt wrote:

Anyway, I correct the sql request by adding a concat with 
.home/vmail/ and now I have the good home directory but the error 
still occurs.

Setting sieve_global_dir didn't change anything.

Guillaume Hilt




Timo Sirainen a écrit :

On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:


Timo Sirainen a écrit :

On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:

Jan  2 14:48:52 mail deliver(postmas...@adomain.fr): 
chdir(/root) failed: Permission denied

..

Why does it look inside the /root folder for sieve configuration ?


Your userdb returns /root as home directory. Show your 
dovecot-sql.conf and enable auth_debug=yes and show the logs again.




Oh.

Postfixadmin inly store a portion of the maildir path.
Instead of storing /home/vmail/domain/user it stores domain/user.



OK. Looks like I was a bit wrong. Your userdb doesn't return any 
home directory (it's preferred to return one, 
http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver 
preserves HOME environment which is set to /root in your case. 
That causes the chdir() error. I think I'll have to do something 
about this in v1.2. The HOME environment shouldn't be preserved 
when using -d parameter.











Re: [Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-03 Thread Guillaume Hilt

Looks like using As home in the sql request corrected the problem :)
Thanks Timo ;)

 Guillaume Hilt




Guillaume Hilt a écrit :

I'll try that.
For the mail location, it's already the case : ~/.maildir

 Guillaume Hilt




Timo Sirainen a écrit :
maildir field isn't used for anything. Perhaps there is some 
completely undocumented and unreliable code that makes use of it for 
pop3/imap, but it is used in no way by Sieve. Try something like:


user_query = SELECT CONCAT('/home/vmail', maildir) AS home, 207 AS 
uid, 207 AS gid FROM mailbox WHERE username = '%u'


And in dovecot.conf:

mail_location = maildir:~/

(or actually preferrably mail_location = maildir:~/Maildir if can 
afford to change it).


On Jan 3, 2009, at 10:43 AM, Guillaume Hilt wrote:


In dovecot-sql.conf

user_query = SELECT CONCAT('/home/vmail/',maildir) AS maildir, 207 
AS uid, 207 AS gid FROM mailbox WHERE username = '%u'

So I'll have a complete path like /home/vmail/mydomain/myuser/.

Guillaume Hilt




Timo Sirainen a écrit :
Where did you add that? You'll need to return a home field from 
user_query poiting to the sieve script directory.


On Jan 3, 2009, at 10:35 AM, Guillaume Hilt wrote:

Anyway, I correct the sql request by adding a concat with 
.home/vmail/ and now I have the good home directory but the error 
still occurs.

Setting sieve_global_dir didn't change anything.

Guillaume Hilt




Timo Sirainen a écrit :

On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:


Timo Sirainen a écrit :

On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:

Jan  2 14:48:52 mail deliver(postmas...@adomain.fr): 
chdir(/root) failed: Permission denied

..
Why does it look inside the /root folder for sieve 
configuration ?


Your userdb returns /root as home directory. Show your 
dovecot-sql.conf and enable auth_debug=yes and show the logs 
again.




Oh.

Postfixadmin inly store a portion of the maildir path.
Instead of storing /home/vmail/domain/user it stores domain/user.



OK. Looks like I was a bit wrong. Your userdb doesn't return any 
home directory (it's preferred to return one, 
http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver 
preserves HOME environment which is set to /root in your case. 
That causes the chdir() error. I think I'll have to do something 
about this in v1.2. The HOME environment shouldn't be preserved 
when using -d parameter.













[Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-02 Thread Guillaume Hilt

   Hi,

I'm using dovecot (+sieve), dspam, clamav and postfix with wirtual users 
and domains.

When the server receive an email, I get this error :
Jan  2 14:48:52 mail postfix/qmgr[13573]: 89DE1276C42B: 
from=postmas...@shadowprojects.org, size=926, nrcpt=1 (queue active)
Jan  2 14:48:52 mail deliver(postmas...@adomain.fr): chdir(/root) 
failed: Permission denied
Jan  2 14:48:52 mail deliver(postmas...@adomain.fr): 
stat(/root/.dovecot.sieve) failed: Permission denied
Jan  2 14:48:52 mail deliver(postmas...@adomain.fr): 
msgid=495e1b33.5020...@shadowprojects.org: saved mail to INBOX
Jan  2 14:48:52 mail postfix/lmtp[13584]: 89DE1276C42B: 
to=postmas...@adomain.fr, 
relay=mail.mydomain.com[/var/run/dspam/dspam.sock], delay=0.07, 
delays=0.05/0/0/0.01, dsn=2.6.0, status=sent (250 2.6.0 
postmas...@adomain Message accepted for delivery)


Why does it look inside the /root folder for sieve configuration ?
All virtual mailboxes are in /home/vmail/DOMAIN/USER/.maildir (owned by 
postfix:postfix; dspam has been put in the postfix group)


I uploaded the following config files in http://hiltg.pastebin.com/ :
- main.cf
- master.cf
- dovecot.conf
- dspam.conf

(mails are supposed to be delivered to the mailbox by dovecot, which is 
called by dspam)


Any idea please ?

Thanks and happy new year to you all,

--
 Guillaume Hilt




Re: [Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-02 Thread Guillaume Hilt

# postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = lmtp:unix:/var/run/dspam/dspam.sock
daemon_directory = /usr/lib64/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = .maildir/
html_directory = /usr/share/doc/postfix-2.5.5/html
mail_owner = postfix
mailbox_command = /usr/bin/dspam --deliver=innocent -- -d %u
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost,
mail.$mydomain, www.$mydomain, ftp.$mydomain

mydomain = apteo.com
myhostname = mail.apteo.com
mynetworks = 127.0.0.0/8, hash:/etc/postfix/pop-before-smtp
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.5.5/readme
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
recipient_delimiter = +
sample_directory = /etc/postfix
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_sender_dependent_authentication = yes
smtp_tls_note_starttls_offer = yes
smtpd_client_restrictions = permit_mynetworks
smtpd_recipient_restrictions = reject_unauth_pipelining,  
reject_non_fqdn_recipient,  reject_unknown_recipient_domain,  
permit_mynetworks,  permit_sasl_authenticated,  
reject_unauth_destination,  warn_if_reject,  reject_non_fqdn_hostname,  
reject_non_fqdn_sender,  reject_invalid_hostname,  reject_rbl_client 
list.dsbl.org,  reject_rbl_client sbl-xbl.spamhaus.org

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/StartSSL.crt
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/Apteo.crt
smtpd_tls_key_file = /etc/ssl/private/Apteo.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:207
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 207
virtual_transport = virtual
virtual_uid_maps = static:207


# dovecot -n
# 1.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.24.5-grsec--grs-ipv4-64 x86_64 Gentoo Base System 
release 1.12.11.1 ext3

protocols: imap imaps pop3 pop3s
listen(default): *:143
listen(imap): *:143
listen(pop3): *:110
ssl_listen(default): *:993
ssl_listen(imap): *:993
ssl_listen(pop3): *:995
ssl_ca_file: /etc/ssl/StartSSL.crt
ssl_cert_file: /etc/ssl/Apteo.crt
ssl_key_file: /etc/ssl/private/Apteo.key
ssl_key_password: Y0ullN3v3rF1ndTh1sPassphras3
ssl_cipher_list: ALL:!LOW:!SSLv2
disable_plaintext_auth: no
verbose_ssl: yes
login_dir: /var/run/dovecot/login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
login_greeting_capability(default): yes
login_greeting_capability(imap): yes
login_greeting_capability(pop3): no
first_valid_uid: 207
mail_location: maildir:/home/vmail/%d/%n/.maildir
fsync_disable: yes
maildir_copy_preserve_filename: yes
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): antispam
mail_plugins(imap): antispam
mail_plugins(pop3):
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
imap_client_workarounds(default): delay-newmail
imap_client_workarounds(imap): delay-newmail
imap_client_workarounds(pop3):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
 passdb:
   driver: sql
   args: /etc/dovecot/dovecot-sql.conf
 userdb:
   driver: sql
   args: /etc/dovecot/dovecot-sql.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/private/auth
 mode: 432
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 438
plugin:
 antispam_signature: X-DSPAM-Signature
 antispam_signature_missing: error
 antispam_trash: Trash
 antispam_spam: Spam
 antispam_dspam_binary: /usr/bin/dspam




 Guillaume Hilt




Charles Marcus a écrit :

On 1/2/2009, Guillaume Hilt (postmas...@shadowprojects.org) wrote:
  

I uploaded the following config files in http://hiltg.pastebin.com/ :
- main.cf
- master.cf
- dovecot.conf
- dspam.conf 



Posting to a service like this is really a bother - just paste into the
email body...

Also, you should only post output of 'postconf -n' and 'dovecot -n'...
this shows

Re: [Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-02 Thread Guillaume Hilt

It's okay, you're trying to help me, so I won't complain :)

So, postfix isn't running in a chroot.
I've done the modifications you suggested.

My problem is that sieve is looking into the root folder for a sieve 
configuration file when the server receive a new email (mail for a 
virtual user).
I'll change the ssl key later, the server is not in production and i 
haven't finished the ssl part yet.


 Guillaume Hilt




Charles Marcus a écrit :

On 1/2/2009 10:10 AM, Guillaume Hilt wrote:
  

# OS: Linux 2.6.24.5-grsec--grs-ipv4-64



Hmmm... maybe it is a grsec problem? I can't help you there...

  
ssl_key_password: Y0ullN3v3rF1ndTh1sPassphras3 



If thats really your passphrase, you'd best change it asap...

  

smtpd_client_restrictions = permit_mynetworks



Redundant... remove this...

  
smtpd_recipient_restrictions = 
 reject_unauth_pipelining,



useless here... either put this in smtpd_data_restrictions, or remove it

  

 reject_non_fqdn_recipient,
 reject_unknown_recipient_domain,
 permit_mynetworks,
 permit_sasl_authenticated,
 reject_unauth_destination,
 warn_if_reject,  reject_non_fqdn_hostname,



Is that comma a cut-n-paste typo? if you want to warn only on
reject_non_fqdn_hostname, then remove this comma, otherwise remove
'warn_if_reject' completely...

master.cf contents (ie, is it running chrooted?)?

The devil is in the details - the more you provide when asking for help,
the more likely you'll get a helpful response...

Also - when re-sending like this, it would be most helpful if you
restate your problem too - prevents people from having to switch back
and forth between different messages...

Sorry if it seems like I'm picking nits...

  


Re: [Dovecot] deliver looking into root directory for sieve configuration ?

2009-01-02 Thread Guillaume Hilt

Charles Marcus a écrit :

On 1/2/2009 11:54 AM, Guillaume Hilt wrote:
  

It's okay, you're trying to help me, so I won't complain :)

So, postfix isn't running in a chroot.



Are you sure? master .cf?
  

smtp  inet  n   -   n   -   -   smtpd
pickupfifo  n   -   n   60  1   pickup
cleanup   unix  n   -   n   -   0   cleanup
qmgr  fifo  n   -   n   300 1   qmgr
tlsmgrunix  -   -   n   1000?   1   tlsmgr
rewrite   unix  -   -   n   -   -   trivial-rewrite
bounceunix  -   -   n   -   0   bounce
defer unix  -   -   n   -   0   bounce
trace unix  -   -   n   -   0   bounce
verifyunix  -   -   n   -   1   verify
flush unix  n   -   n   1000?   0   flush
proxymap  unix  -   -   n   -   -   proxymap
proxywrite unix -   -   n   -   1   proxymap
smtp  unix  -   -   n   -   -   smtp
relay unix  -   -   n   -   -   smtp
   -o smtp_fallback_relay=
showq unix  n   -   n   -   -   showq
error unix  -   -   n   -   -   error
retry unix  -   -   n   -   -   error
discard   unix  -   -   n   -   -   discard
local unix  -   n   n   -   -   local
virtual   unix  -   n   n   -   -   virtual
lmtp  unix  -   -   n   -   -   lmtp
anvil unix  -   -   n   -   1   anvil
scacheunix  -   -   n   -   1   scache
  

My problem is that sieve is looking into the root folder for a sieve
configuration file when the server receive a new email (mail for a
virtual user).



I didn't see anything in your dovecot config about sieve...

Did you read and install/configure according to this page?

http://wiki.dovecot.org/LDA/Sieve
  

sieve is declared and called in the lda section :)
(i followed the tutorial yeah)
  

I'll change the ssl key later, the server is not in production and i
haven't finished the ssl part yet.



no worries then... ;)

  


[Dovecot] Dovecot with LDAP on multiple domains ?

2008-12-20 Thread Guillaume Hilt

   Hello,

I intend to set up a mail server for a few domains with 
Dovecot/Postfix/MySQL/DSPAM and antispam plugin.

The better solution to manage users would be to set up a ldap server.

So, do anyone have ever set up this kind of server with dovecot ?
Any advice that would help me ?

Thanks,

--
 Guillaume Hilt




Re: [Dovecot] deliver segv on sieve redirect

2008-11-26 Thread Guillaume Hilt

If you redirect the mail, how can it be stored into a folder after that ?

Andy Howell a écrit :

Hello,

I've been trying out the bleeding edge, 1.2.alpha4. I'm having a 
problem with deliver and dovecot-1.2-sieve-0.1.1.


I get a segv on this sieve script:

require [fileinto, reject, vacation, envelope, regex];
if header :contains subject [urgent] {
 redirect [EMAIL PROTECTED];
 fileinto test;
}

Seems its happening on the redirect. If I put the fileinto before 
the redirect, the fileinto works.


I tried putting extra debug statements in 
plugins/lda-sieve/lda-sieve-plugin.c right after the sieve_execute in 
lda_sieve_run, but it never prints anything. I'm guessing thats the 
right place. Its quite possible there is something amiss in my setup.


My logs show:

Nov 26 02:51:12 marvin dovecot: deliver([EMAIL PROTECTED]): sieve: using 
sieve path: /var/mail/vhosts/x.y.org/andy/.dovecot.sieve
Nov 26 02:51:12 marvin dovecot: deliver([EMAIL PROTECTED]): sieve: opening 
script /var/mail/vhosts/x.y.org/andy/.dovecot.sieve
Nov 26 02:51:12 marvin dovecot: deliver([EMAIL PROTECTED]): sieve: 
executing compiled script /var/mail/vhosts/x.y.org/andy/.dovecot.sieve
Nov 26 02:51:12 marvin postfix/pipe[17027]: 0CA895CB3A: 
to=[EMAIL PROTECTED], relay=dovecot, delay=0.41, delays=0.33/0.01/0/0.07, 
dsn=5.3.0, status=bounced (Command died with signal 11: 
/usr/libexec/dovecot/deliver)


Thanks,

Andy



[Dovecot] Unable to use imapflags in sieve

2008-11-25 Thread Guillaume Hilt

   Hello,

I'm using dovecot 1.1.6 with libsieve 2.2.5 and I can't use the 
imapflags extension.

Here's the begginning of my .dovecot.sieve file :

require [fileinto];
#require imapflags;
#require reject;

#if header :contains X-DSPAM-Probability: 0.9 {
#   addflag $label3;
#}

# On déplace le spam dans le dossier Spam et on s'arrête là
if header :contains X-DSPAM-Result Spam {
   fileinto Spam;
#   addflag \\Seen;
   stop;
}

# Si le destinataire est l'user apache, on discarde le mail
if address :is to [EMAIL PROTECTED] {
   discard;
}

# Listes de diffusion
if header :contains List-Id dovecot.dovecot.org {
 fileinto Listes.Dovecot;
 stop;
}

If i enable imapflags (require [fileinto,imapflags];) sieve won't 
work anymore (same with reject by the way).
Only enabling it without using it (with addflag) is enough to stop sieve 
from working. All my emails will be delivered in my inbox despite the 
rules I use. If I remove imapflags, everything is working fine.

And I don't see anything in my logs explaining the problem.


Re: [Dovecot] antispam plugin claims antispam signature not found

2008-11-15 Thread Guillaume HILT

Sounds like the training is working with your patch :
Nov 15 11:13:59 ks29138 imap: antispam: plugin initialising (1.1-notgit)
Nov 15 11:13:59 ks29138 imap: antispam: Trash is trash folder
Nov 15 11:13:59 ks29138 imap: antispam: Spam is spam folder
Nov 15 11:13:59 ks29138 imap: antispam: no unsure folders
Nov 15 11:13:59 ks29138 imap: antispam: dspam binary set to /usr/bin/dspam
Nov 15 11:13:59 ks29138 imap: antispam: signature header line is 
X-DSPAM-Signature
Nov 15 11:13:59 ks29138 imap: antispam: will silently move mails with 
missing signature

Nov 15 13:05:37 ks29138 imap: antispam: mailbox_is_unsure(Spam): 0
Nov 15 13:05:37 ks29138 imap: antispam: mailbox_is_trash(INBOX): 0
Nov 15 13:05:37 ks29138 imap: antispam: mailbox_is_trash(Spam): 0
Nov 15 13:05:37 ks29138 imap: antispam: mail copy: from trash: 0, to 
trash: 0

Nov 15 13:05:37 ks29138 imap: antispam: mailbox_is_spam(INBOX): 0
Nov 15 13:05:37 ks29138 imap: antispam: mailbox_is_spam(Spam): 1
Nov 15 13:05:37 ks29138 imap: antispam: mailbox_is_unsure(INBOX): 0
Nov 15 13:05:37 ks29138 imap: antispam: mail copy: src spam: 0, dst 
spam: 1, src unsure: 0
Nov 15 13:05:37 ks29138 imap: antispam: /usr/bin/dspam --source=error 
--class=spam --signature=491eb6f2313798800310897


And without the patch :

Nov 15 13:18:42 ks29138 imap: antispam: plugin initialising (1.1-3-g03a1d10)
Nov 15 13:18:42 ks29138 imap: antispam: Trash is trash folder
Nov 15 13:18:42 ks29138 imap: antispam: Spam is spam folder
Nov 15 13:18:42 ks29138 imap: antispam: no unsure folders
Nov 15 13:18:42 ks29138 imap: antispam: dspam binary set to /usr/bin/dspam
Nov 15 13:18:42 ks29138 imap: antispam: signature header line is 
X-DSPAM-Signature

Nov 15 13:18:45 ks29138 imap: antispam: mailbox_is_unsure(Spam): 0
Nov 15 13:18:45 ks29138 imap: antispam: mailbox_is_trash(INBOX): 0
Nov 15 13:18:45 ks29138 imap: antispam: mailbox_is_trash(Spam): 0
Nov 15 13:18:45 ks29138 imap: antispam: mail copy: from trash: 0, to 
trash: 0

Nov 15 13:18:45 ks29138 imap: antispam: mailbox_is_spam(INBOX): 0
Nov 15 13:18:45 ks29138 imap: antispam: mailbox_is_spam(Spam): 1
Nov 15 13:18:45 ks29138 imap: antispam: mailbox_is_unsure(INBOX): 0
Nov 15 13:18:45 ks29138 imap: antispam: mail copy: src spam: 0, dst 
spam: 1, src unsure: 0
Nov 15 13:18:45 ks29138 imap: antispam: /usr/bin/dspam --source=error 
--class=spam --signature=491eb6f2313798800310897


I tried with some new mails this time.

Guillaume HILT a écrit :

Not really, I haven't tried it with some new mails.
I had this problem with some old one I imported from my previous 
server (i used spamassassin and courier-imap).
I'll try to test the training and if it's not working, I'll revert to 
the svn version.
It's not a big deal anyway if I can't use some old mails to train the 
plugin.


Johannes Berg a écrit :

On Fri, 2008-11-14 at 16:53 +0100, Guillaume HILT wrote:
 

Ok, i updated the files by hand, and it's working like a charm :)
Thanks for the patch Johannes.



Umm, you realise that now it's not training at all, right? That's why
the docs there say don't use this patch unless you verified that it
works first. Unless you really had this problem only with some large
emails?

johannes
  




--
 Guillaume Hilt





Re: [Dovecot] antispam plugin claims antispam signature not found

2008-11-14 Thread Guillaume HILT



Johannes Berg a écrit :

On Tue, 2008-11-11 at 11:42 +0100, Johannes Berg wrote:

  

Not sure, I personally think that moving them silently makes errors
harder to diagnose. I'll add an option since then you can set this
option (antispam_missing_signature = [error|move]) to move after you've
tested and verified that it works just fine.



Try this patch please, I have only compiled it so far. (there might be
rejects in the signature-log.c file unless you update to the current git
tree but you don't care about that)

diff --git a/antispam.7 b/antispam.7
index d07c1d0..e26db69 100644
--- a/antispam.7
+++ b/antispam.7
@@ -108,6 +108,13 @@ plugin {
 # mail signature (used with any backend requiring a signature)
 antispam_signature = X-DSPAM-Signature
 
+# action to take on mails without signature

+# (used with any backend requiring a signature)
+# (we recommend only setting this to 'move' after verifying that the
+# whole setup is working)
+# antispam_signature_missing = move # move silently without training
+antispam_signature_missing = error
+
 # semicolon-separated list of Trash folders (default unset i.e. none)
 # antispam_trash =
 # antispam_trash = trash;Trash;Deleted Items
diff --git a/signature-log.c b/signature-log.c
index ab8cd6d..5b7b306 100644
--- a/signature-log.c
+++ b/signature-log.c
@@ -99,7 +99,12 @@ int backend_handle_mail(struct mailbox_transaction_context 
*t,
return -1;
}
 
-	signature = signature_extract(t, mail);

+   ret = signature_extract(t, mail, signature);
+   if (ret)
+   return ret;
+
+   if (!signature)
+   return 0;
 
 	switch (wanted) {

case CLASS_SPAM:
diff --git a/signature.c b/signature.c
index 7f9d83b..7ad29d6 100644
--- a/signature.c
+++ b/signature.c
@@ -5,6 +5,7 @@
 #include mail-storage-private.h
 
 const char *signature_hdr = X-DSPAM-Signature;

+static int signature_nosig_ignore = 0;
 
 void signature_init(void)

 {
@@ -12,6 +13,16 @@ void signature_init(void)
if (tmp)
signature_hdr = tmp;
debug(signature header line is \%s\\n, signature_hdr);
+
+   tmp = get_setting(SIGNATURE_MISSING);
+   if (!tmp)
+   tmp = error;
+   if (strcmp(tmp, move) == 0) {
+   signature_nosig_ignore = 1;
+   debug(will silently move mails with missing signature\n);
+   } else if (strcmp(tmp, error) != 0) {
+   debug(invalid signature_missing setting '%s', ignoring\n, 
tmp);
+   }
 }
 
 int signature_extract_to_list(struct mailbox_transaction_context *t,

@@ -23,10 +34,14 @@ int signature_extract_to_list(struct 
mailbox_transaction_context *t,
 
 	signatures = get_mail_headers(mail, signature_hdr);

if (!signatures || !signatures[0]) {
-   mail_storage_set_error(t-box-storage,
-  ME(NOTPOSSIBLE)
-  antispam signature not found);
-   return -1;
+   if (!signature_nosig_ignore) {
+   mail_storage_set_error(t-box-storage,
+  ME(NOTPOSSIBLE)
+  antispam signature not found);
+   return -1;
+   } else {
+   return 0;
+   }
}
 
 	while (signatures[1])

@@ -42,23 +57,30 @@ int signature_extract_to_list(struct 
mailbox_transaction_context *t,
return 0;
 }
 
-const char *signature_extract(struct mailbox_transaction_context *t,

- struct mail *mail)
+int signature_extract(struct mailbox_transaction_context *t,
+ struct mail *mail, const char **signature)
 {
const char *const *signatures;
 
 	signatures = get_mail_headers(mail, signature_hdr);

if (!signatures || !signatures[0]) {
-   mail_storage_set_error(t-box-storage,
-  ME(NOTPOSSIBLE)
-  antispam signature not found);
-   return NULL;
+   if (!signature_nosig_ignore) {
+   mail_storage_set_error(t-box-storage,
+  ME(NOTPOSSIBLE)
+  antispam signature not found);
+   return -1;
+   } else {
+   *signature = NULL;
+   return 0;
+   }
}
 
 	while (signatures[1])

signatures++;
 
-	return signatures[0];

+   *signature = signatures[0];
+
+   return 0;
 }
 
 void signature_list_free(struct siglist **list)

diff --git a/signature.h b/signature.h
index e25d1b5..1384924 100644
--- a/signature.h
+++ b/signature.h
@@ -16,8 +16,8 @@ void signature_init(void);
 int signature_extract_to_list(struct mailbox_transaction_context *t,
 

Re: [Dovecot] antispam plugin claims antispam signature not found

2008-11-14 Thread Guillaume HILT

I have the same problem and i'm wondering how should i use this patch ?
I'm not familiar with the patch command.

Thanks.

PS: Sorry for the empty mail

Johannes Berg a écrit 

On Tue, 2008-11-11 at 11:42 +0100, Johannes Berg wrote:

  

Not sure, I personally think that moving them silently makes errors
harder to diagnose. I'll add an option since then you can set this
option (antispam_missing_signature = [error|move]) to move after you've
tested and verified that it works just fine.



Try this patch please, I have only compiled it so far. (there might be
rejects in the signature-log.c file unless you update to the current git
tree but you don't care about that)

diff --git a/antispam.7 b/antispam.7
index d07c1d0..e26db69 100644
--- a/antispam.7
+++ b/antispam.7
@@ -108,6 +108,13 @@ plugin {
 # mail signature (used with any backend requiring a signature)
 antispam_signature = X-DSPAM-Signature
 
+# action to take on mails without signature

+# (used with any backend requiring a signature)
+# (we recommend only setting this to 'move' after verifying that the
+# whole setup is working)
+# antispam_signature_missing = move # move silently without training
+antispam_signature_missing = error
+
 # semicolon-separated list of Trash folders (default unset i.e. none)
 # antispam_trash =
 # antispam_trash = trash;Trash;Deleted Items
diff --git a/signature-log.c b/signature-log.c
index ab8cd6d..5b7b306 100644
--- a/signature-log.c
+++ b/signature-log.c
@@ -99,7 +99,12 @@ int backend_handle_mail(struct mailbox_transaction_context 
*t,
return -1;
}
 
-	signature = signature_extract(t, mail);

+   ret = signature_extract(t, mail, signature);
+   if (ret)
+   return ret;
+
+   if (!signature)
+   return 0;
 
 	switch (wanted) {

case CLASS_SPAM:
diff --git a/signature.c b/signature.c
index 7f9d83b..7ad29d6 100644
--- a/signature.c
+++ b/signature.c
@@ -5,6 +5,7 @@
 #include mail-storage-private.h
 
 const char *signature_hdr = X-DSPAM-Signature;

+static int signature_nosig_ignore = 0;
 
 void signature_init(void)

 {
@@ -12,6 +13,16 @@ void signature_init(void)
if (tmp)
signature_hdr = tmp;
debug(signature header line is \%s\\n, signature_hdr);
+
+   tmp = get_setting(SIGNATURE_MISSING);
+   if (!tmp)
+   tmp = error;
+   if (strcmp(tmp, move) == 0) {
+   signature_nosig_ignore = 1;
+   debug(will silently move mails with missing signature\n);
+   } else if (strcmp(tmp, error) != 0) {
+   debug(invalid signature_missing setting '%s', ignoring\n, 
tmp);
+   }
 }
 
 int signature_extract_to_list(struct mailbox_transaction_context *t,

@@ -23,10 +34,14 @@ int signature_extract_to_list(struct 
mailbox_transaction_context *t,
 
 	signatures = get_mail_headers(mail, signature_hdr);

if (!signatures || !signatures[0]) {
-   mail_storage_set_error(t-box-storage,
-  ME(NOTPOSSIBLE)
-  antispam signature not found);
-   return -1;
+   if (!signature_nosig_ignore) {
+   mail_storage_set_error(t-box-storage,
+  ME(NOTPOSSIBLE)
+  antispam signature not found);
+   return -1;
+   } else {
+   return 0;
+   }
}
 
 	while (signatures[1])

@@ -42,23 +57,30 @@ int signature_extract_to_list(struct 
mailbox_transaction_context *t,
return 0;
 }
 
-const char *signature_extract(struct mailbox_transaction_context *t,

- struct mail *mail)
+int signature_extract(struct mailbox_transaction_context *t,
+ struct mail *mail, const char **signature)
 {
const char *const *signatures;
 
 	signatures = get_mail_headers(mail, signature_hdr);

if (!signatures || !signatures[0]) {
-   mail_storage_set_error(t-box-storage,
-  ME(NOTPOSSIBLE)
-  antispam signature not found);
-   return NULL;
+   if (!signature_nosig_ignore) {
+   mail_storage_set_error(t-box-storage,
+  ME(NOTPOSSIBLE)
+  antispam signature not found);
+   return -1;
+   } else {
+   *signature = NULL;
+   return 0;
+   }
}
 
 	while (signatures[1])

signatures++;
 
-	return signatures[0];

+   *signature = signatures[0];
+
+   return 0;
 }
 
 void signature_list_free(struct siglist **list)

diff --git a/signature.h b/signature.h
index e25d1b5..1384924 100644
--- a/signature.h
+++ 

Re: [Dovecot] antispam plugin claims antispam signature not found

2008-11-14 Thread Guillaume HILT

Ok, i updated the files by hand, and it's working like a charm :)
Thanks for the patch Johannes.

Guillaume HILT a écrit :

I have the same problem and i'm wondering how should i use this patch ?
I'm not familiar with the patch command.

Thanks.

PS: Sorry for the empty mail

Johannes Berg a écrit

On Tue, 2008-11-11 at 11:42 +0100, Johannes Berg wrote:

 

Not sure, I personally think that moving them silently makes errors
harder to diagnose. I'll add an option since then you can set this
option (antispam_missing_signature = [error|move]) to move after you've
tested and verified that it works just fine.



Try this patch please, I have only compiled it so far. (there might be
rejects in the signature-log.c file unless you update to the current git
tree but you don't care about that)

diff --git a/antispam.7 b/antispam.7
index d07c1d0..e26db69 100644
--- a/antispam.7
+++ b/antispam.7
@@ -108,6 +108,13 @@ plugin {
 # mail signature (used with any backend requiring a signature)
 antispam_signature = X-DSPAM-Signature
 
+# action to take on mails without signature

+# (used with any backend requiring a signature)
+# (we recommend only setting this to 'move' after verifying that 
the

+# whole setup is working)
+# antispam_signature_missing = move # move silently without 
training

+antispam_signature_missing = error
+
 # semicolon-separated list of Trash folders (default unset i.e. 
none)

 # antispam_trash =
 # antispam_trash = trash;Trash;Deleted Items
diff --git a/signature-log.c b/signature-log.c
index ab8cd6d..5b7b306 100644
--- a/signature-log.c
+++ b/signature-log.c
@@ -99,7 +99,12 @@ int backend_handle_mail(struct 
mailbox_transaction_context *t,

 return -1;
 }
 
-signature = signature_extract(t, mail);

+ret = signature_extract(t, mail, signature);
+if (ret)
+return ret;
+
+if (!signature)
+return 0;
 
 switch (wanted) {

 case CLASS_SPAM:
diff --git a/signature.c b/signature.c
index 7f9d83b..7ad29d6 100644
--- a/signature.c
+++ b/signature.c
@@ -5,6 +5,7 @@
 #include mail-storage-private.h
 
 const char *signature_hdr = X-DSPAM-Signature;

+static int signature_nosig_ignore = 0;
 
 void signature_init(void)

 {
@@ -12,6 +13,16 @@ void signature_init(void)
 if (tmp)
 signature_hdr = tmp;
 debug(signature header line is \%s\\n, signature_hdr);
+
+tmp = get_setting(SIGNATURE_MISSING);
+if (!tmp)
+tmp = error;
+if (strcmp(tmp, move) == 0) {
+signature_nosig_ignore = 1;
+debug(will silently move mails with missing signature\n);
+} else if (strcmp(tmp, error) != 0) {
+debug(invalid signature_missing setting '%s', ignoring\n, 
tmp);

+}
 }
 
 int signature_extract_to_list(struct mailbox_transaction_context *t,
@@ -23,10 +34,14 @@ int signature_extract_to_list(struct 
mailbox_transaction_context *t,
 
 signatures = get_mail_headers(mail, signature_hdr);

 if (!signatures || !signatures[0]) {
-mail_storage_set_error(t-box-storage,
-   ME(NOTPOSSIBLE)
-   antispam signature not found);
-return -1;
+if (!signature_nosig_ignore) {
+mail_storage_set_error(t-box-storage,
+   ME(NOTPOSSIBLE)
+   antispam signature not found);
+return -1;
+} else {
+return 0;
+}
 }
 
 while (signatures[1])
@@ -42,23 +57,30 @@ int signature_extract_to_list(struct 
mailbox_transaction_context *t,

 return 0;
 }
 
-const char *signature_extract(struct mailbox_transaction_context *t,

-  struct mail *mail)
+int signature_extract(struct mailbox_transaction_context *t,
+  struct mail *mail, const char **signature)
 {
 const char *const *signatures;
 
 signatures = get_mail_headers(mail, signature_hdr);

 if (!signatures || !signatures[0]) {
-mail_storage_set_error(t-box-storage,
-   ME(NOTPOSSIBLE)
-   antispam signature not found);
-return NULL;
+if (!signature_nosig_ignore) {
+mail_storage_set_error(t-box-storage,
+   ME(NOTPOSSIBLE)
+   antispam signature not found);
+return -1;
+} else {
+*signature = NULL;
+return 0;
+}
 }
 
 while (signatures[1])

 signatures++;
 
-return signatures[0];

+*signature = signatures[0];
+
+return 0;
 }
 
 void signature_list_free(struct siglist **list)

diff --git a/signature.h b/signature.h
index e25d1b5..1384924 100644
--- a/signature.h
+++ b/signature.h
@@ -16,8 +16,8 @@ void signature_init(void);
 int signature_extract_to_list(struct mailbox_transaction_context *t,
   struct mail *mail, struct siglist **list,
   enum classification wanted);
-const char *signature_extract(struct

Re: [Dovecot] antispam plugin claims antispam signature not found

2008-11-14 Thread Guillaume HILT

Not really, I haven't tried it with some new mails.
I had this problem with some old one I imported from my previous server 
(i used spamassassin and courier-imap).
I'll try to test the training and if it's not working, I'll revert to 
the svn version.
It's not a big deal anyway if I can't use some old mails to train the 
plugin.


Johannes Berg a écrit :

On Fri, 2008-11-14 at 16:53 +0100, Guillaume HILT wrote:
  

Ok, i updated the files by hand, and it's working like a charm :)
Thanks for the patch Johannes.



Umm, you realise that now it's not training at all, right? That's why
the docs there say don't use this patch unless you verified that it
works first. Unless you really had this problem only with some large
emails?

johannes
  


--
 Guillaume Hilt




[Dovecot] Problem with Dovecot 1.1.4 and dovecot-antispam 20080829

2008-10-30 Thread Guillaume Hilt

   Hi there,

I'm running a server under Gentoo 64 with postfix 2.5.5, Dovecot 
1.1.4-r1 and Dovecot-antispam 20080829 (all are the lastest versions 
availables under Portage).

I ran into a problem when I log in to my mailbox :

Oct 30 10:39:23 ks29138 dovecot: IMAP(hiltg): Loading modules from 
directory: /usr/lib64/dovecot/imap
Oct 30 10:39:23 ks29138 dovecot: IMAP(hiltg): Module is for different 
version 1.1.1: /usr/lib64/dovecot/imap/lib90_antispam_plugin.so
Oct 30 10:39:23 ks29138 dovecot: Fatal: IMAP(hiltg): Couldn't load 
required plugins


Is there another version for Dovecot 1.1.4 out there or must I go back 
to 1.1.1 ?


Thanks,

   Guillaume