Re: [Dovecot] Sent Date/time vs Received Date/time

2008-08-21 Thread Timo Sirainen
On Wed, 2008-08-20 at 17:06 -0400, Charles Marcus wrote:

 The RFC for this apparently is 2060, but:

You should be looking at 3501 :)

  2.3.3.  Internal Date Message Attribute

 It sounds like this INTERNALDATE changes... I'd like something that is
 from the message headers - ie, that doesn't change - so that sorting
 will *always* be what I want/expect, even if I move messages from one
 IMAP server to another...

INTERNALDATE is stored in message's mtime with maildir. It's preserved
when COPYing a message to another mailbox. Whether it's preserved when a
client copies it between different IMAP accounts depends on the client -
APPEND command anyway supports INTERNALDATE parameter.

Evolution's Received field means the same as INTERNALDATE and I always
use it to order my messages. Works fine.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Authentication cache, failure to login after changed password

2008-08-21 Thread Tom Sommer

Timo Sirainen wrote:

On Tue, 2008-08-19 at 15:49 +0200, Tom Sommer wrote:

On Tue, August 19, 2008 15:44, Tom Sommer wrote:


Using version 1.1.1, MySQL userdb, with nopassword=Y.

Maybe it's due to nopassword?

Should add, this is my password_query:

password_query = SELECT username as user, NULL as password, Y as
nopassword FROM users WHERE ...


So how do you check the password validity?


Simple

SELECT username as user, NULL as password, Y as nopassword FROM users 
WHERE username = '%u' AND password = '[password]'


The reason why I need to do this, is because my password is 
unpractically encrypted


// Tom


Re: [Dovecot] Few problem with pop3

2008-08-21 Thread Roberto Tagliaferri - Tosnet srl

Timo Sirainen ha scritto:

On Wed, 2008-08-20 at 07:35 +0200, Roberto Tagliaferri - Tosnet srl
wrote:
  
Hi, i've upgraded from 1.0.5 to 1.1.2 on 2 server and work fine for user 
that grab email on client, but some customer (that leave the email on 
server) have 2 problems.


Some client can't read new mail:
dovecot: Aug 19 11:00:46 Info: pop3-login: Login: user=agenzia, 
method=PLAIN, rip=xxx, lip=91.102.48.12
dovecot: Aug 19 11:00:46 Info: POP3(agenzia): Disconnected: Logged out 
top=0/0, retr=0/0, del=0/21, size=126



All of these look like normal client QUITs, so I've no idea why the
client wouldn't see the new mails. If there's nothing in error logs
either (may be different from where the above messages are logged,
http://wiki.dovecot.org/Logging), the only possibility to debug this is
to look at what the client and Dovecot actually talk to each others and
how it differs from v1.0. Rawlog for example could be used for that:
http://wiki.dovecot.org/Debugging/Rawlog

  
Ok.. i've tested only one account because this server is a production 
server..

I've recreated this:
dovecot: Aug 21 08:38:54 Info: pop3-login: Login: user=agenzia, 
method=PLAIN, rip=213.203.182.90, lip=91.102.48.12
dovecot: Aug 21 08:38:54 Info: POP3(agenzia): Disconnected: Logged out 
top=0/0, retr=0/0, del=0/21, size=217625

in this check  the client have not download the message

dovecot: Aug 21 08:40:20 Info: pop3-login: Login: user=agenzia, 
method=PLAIN, rip=213.203.182.90, lip=91.102.48.12
dovecot: Aug 21 08:40:20 Info: POP3(agenzia): Disconnected: Logged out 
top=0/0, retr=1/2962, del=0/21, size=217625

In this check yes... (thunderbird 2.0.16)

For first check, in log:
STAT
LIST
UIDL
QUIT

Out log:
+OK 21 217625
+OK 21 messages:
1 3849
2 3845
3 4872
4 106997
5 11948
6 3624
7 29799
8 4868
9 4845
10 2525
11 3278
12 3103
13 4671
14 2487
15 2671
16 2694
17 3072
18 5224
19 8862
20 1447
21 2944
.
+OK
1 e103435e253a
2 e104435e253a
3 e11d435e253a
4 e12b435e253a
5 e13e435e253a
6 e13f435e253a
7 e186435e253a
8 e187435e253a
9 e188435e253a
10 e189435e253a
11 e18a435e253a
12 e18b435e253a
13 e18c435e253a
14 e18d435e253a
15 e18e435e253a
16 e18f435e253a
17 e190435e253a
18 e191435e253a
19 e192435e253a
20 e193435e253a
21 e194435e253a
.
+OK Logging out.



For second check, in log:

STAT
LIST
UIDL
RETR 21
QUIT


out log:

+OK 21 217625
+OK 21 messages:
1 3849
2 3845
3 4872
4 106997
5 11948
6 3624
7 29799
8 4868
9 4845
10 2525
11 3278
12 3103
13 4671
14 2487
15 2671
16 2694
17 3072
18 5224
19 8862
20 1447
21 2944
.
+OK
1 e103435e253a
2 e104435e253a
3 e11d435e253a
4 e12b435e253a
5 e13e435e253a
6 e13f435e253a
7 e186435e253a
8 e187435e253a
9 e188435e253a
10 e189435e253a
11 e18a435e253a
12 e18b435e253a
13 e18c435e253a
14 e18d435e253a
15 e18e435e253a
16 e18f435e253a
17 e190435e253a
18 e191435e253a
19 e192435e253a
20 e193435e253a
21 e194435e253a
.
+OK 2944 octets

(cut body of message)
+OK Logging out.




Update: i've downgraded to 1.0.9 and work fine (1.0.15 has the same 
problem of 1.1.2)



There shouldn't be much of a difference between 1.0.9 and 1.0.15..

  

But when i've reinstalled 1.0.9 dovecot work fine :(


--
Roberto Tagliaferri
Responsabile Progettazione  Produzione
TosNet s.r.l. - Internet Service Provider
[EMAIL PROTECTED]
www.tosnet.it



Re: [Dovecot] TECRA-A9 -- devcot LDA/sendmail

2008-08-21 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 20 Aug 2008, [EMAIL PROTECTED] wrote:

I haven't found in the thread, why you don't use Deliver as local LDA?

I use:

dnl -f $g -- sender
dnl -d $u -- destination user account name
dnl -m $h -- mailbox to deliver to (+detail part of address)
dnl -n-- don't create new mailbox
FEATURE(`local_procmail', `/etc/mail/smrsh/dovecot-deliver', 
`/etc/mail/smrsh/dovecot-deliver -f $g -d $u -m $h')dnl


BTW: You've defined  local_lmtp, why?

Bye,

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIrR3JVJMDrex4hCIRAopSAKCleU2mlV4+UhiB6yPzNZYC1PlIBwCgknRO
DE1CTYoizIChUUwJzURirtQ=
=/iGw
-END PGP SIGNATURE-


Re: [Dovecot] Sent Date/time vs Received Date/time

2008-08-21 Thread mouss

Charles Marcus wrote:

Hey mouss,


OT


Still waiting on your comments on the new vacation.pl for postfixadmin -
had a chance to take a look yet?



not yet. sorry.
/OT


On 8/20/2008, mouss ([EMAIL PROTECTED]) wrote:

So, where does this 'Order Received' column in TBird get its info from?
I'm guessing it is a TBird thing, like an internal index number?



the order of putting the message in the folder. this has nothing to
do with dates contained in the message. if you manually move an old
message to another folder, you'll see it last in the new folder.


If you sort them by 'Order Received'. If you sort them by the standard
'Date' column (I'm talking TBird-speak here), then they are sorted by
the Date/time that the Senders CLIENT thought it was when they sent
their message. I am on more than a few lists where people have their
clocks screwed up - most often its a DST issue, but sometimes its a
time-zone issue - and more rare, their clock is off by weeks or more -
and these messages get sorted OUT of order.



same problem with spam sent with ratware. I rarely use sort by date. 
on list folders, I generally use a threading view.


Anyway, I don't find this to be a critical problem, so I don't really care.


When I enable the 'Order Received' column, that will fix those issues,
but then - as you pointed out - messages that have been moved from one
folder to another are now out of order.



yes. I didn't check other MUAs.


Again... this is why I mentioned using the actual date/time that MY
MAILSERVER received the message (of course this requires that its clock
be correct, but it always is, so not an issue for me).


Parsing Received headers is not a science. so this would create
unnecessary (IMHO) problems for MUA developpers. the delivery time
is sufficient (if all mail goes to the same fielsystem).


For the reasons I outlined above, I disagree...

I think having an MUA with the ability to parse the actual Received
date/time would be very handy...



you are saying so because you use postfix which Received headers are 
easy to parse. Now take a look at the spamassassin code that parses 
received headers and you'll see what nightmare it is. not something a 
developper would expose to users (we're talking about TB, which is 
intended for the general public).




[snip]

It sounds like this INTERNALDATE changes... I'd like something that is
from the message headers - ie, that doesn't change - so that sorting
will *always* be what I want/expect, even if I move messages from one
IMAP server to another...



If I'm not wrong, TB (and maybe other MUAs) implements move by 
creating a new  copy (so a new and unrelated file is created) and then 
deleting the old one. This explains why one sometimes gets out of quota 
(or disk space) when trying to delete mail (move to Trash). anyway, 
this causes a new filename, which breaks the order (even if you do ls in 
your cur/ subdir).


Re: [Dovecot] Few problem with pop3

2008-08-21 Thread Timo Sirainen
On Thu, 2008-08-21 at 09:14 +0200, Roberto Tagliaferri - Tosnet srl wrote:
  All of these look like normal client QUITs, so I've no idea why the
  client wouldn't see the new mails. If there's nothing in error logs
  either (may be different from where the above messages are logged,
  http://wiki.dovecot.org/Logging), the only possibility to debug this is
  to look at what the client and Dovecot actually talk to each others and
  how it differs from v1.0. Rawlog for example could be used for that:
  http://wiki.dovecot.org/Debugging/Rawlog
  

 Ok.. i've tested only one account because this server is a production 
 server..
 I've recreated this:
 dovecot: Aug 21 08:38:54 Info: pop3-login: Login: user=agenzia, 
 method=PLAIN, rip=213.203.182.90, lip=91.102.48.12
 dovecot: Aug 21 08:38:54 Info: POP3(agenzia): Disconnected: Logged out 
 top=0/0, retr=0/0, del=0/21, size=217625
 in this check  the client have not download the message
 
 dovecot: Aug 21 08:40:20 Info: pop3-login: Login: user=agenzia, 
 method=PLAIN, rip=213.203.182.90, lip=91.102.48.12
 dovecot: Aug 21 08:40:20 Info: POP3(agenzia): Disconnected: Logged out 
 top=0/0, retr=1/2962, del=0/21, size=217625
 In this check yes... (thunderbird 2.0.16)

Were both of these using the same Dovecot version or was the second one
different?

 For first check, in log:
 STAT
 LIST
 UIDL

In both of the cases Dovecot's replies to these 3 commands were
identical. So why did the client decide to do RETR only in the second
session?.. I don't really have any ideas what could be the problem.

If you can easily test this, I guess the best way would be to find one
which Dovecot v1.0.x version exactly broke this for you (and after that
which hg commit change broke it).


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] dovecot-antispam has some kind of bug

2008-08-21 Thread Johannes Berg
On Thu, 2008-08-21 at 12:25 +0200, Mikael Jenkler wrote:
 Hi Johannes!
 
 it seams that you pluggin is doing something wrong with the imap connection
 
 i get this:
 
 Aug 21 12:21:54 firestorm dovecot: child 21443 (imap) killed with signal 11
 
 both with squirrelmail and mutt mail clients, but only when the pluggin 
 is enabled in dovecot
 iam using dovecot-1.1.1
 
 have you seen this error before?

Only with older versions of my plugin. Are you using the latests dovecot
1.1 and my plugin? We'll need you to compile both dovecot and the plugin
with debugging information and provide a backtrace.

johannes


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] TECRA-A9 -- devcot LDA/sendmail

2008-08-21 Thread dovecot
On Wed, Aug 20, 2008 at 10:01:21PM -0700, SM wrote:
 At 18:17 20-08-2008, [EMAIL PROTECTED] wrote:
 In a prviooous thread you suggested that we use
 define(`confDONT_PROBE_INTERFACES',`True')dnl.  When that line didn't
 produce any positive results we removed it.  Just before generating
 this reply we ran a few more test after removing the only entry
 guice.ath.cx from 'local-host-names'.
 
 In my previous messages, I mentioned the reason for the issue.  I 
 assumed that you were following the steps and the results you 
 produced were based on that.  I already mentioned that the domain 
 should not be listed in local-host-names if you are using the 
 instructions at http://wiki.dovecot.org/LDA/Sendmail
 
 This is a clean install of FreeBSD and packages.  No *configuration*
 files were merged in any way; /root, /usr/home/* and /var/mail/* were
 restored from a previous install.
 
 It is going to be very interesting to see what is causing this issue.
 
 #
 # Sendmail continues to use 'Mailer(local)'
 # local-host-names is an empty file
 # We have tried both using and removing the following line from
 'hostname,mc'
 # define(`confDONT_PROBE_INTERFACES',`True')dnl
 
 ## These are the active lines in my 'hostname.mc'
 divert(0)
 VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.30.2.4
 2007/11/22 16:20:01 gs
 OSTYPE(freebsd6)
 DOMAIN(generic)
 
 FEATURE(access_db, `hash -o -TTMPF /etc/mail/access')
 FEATURE(blacklist_recipients)
 FEATURE(local_lmtp)
 FEATURE(mailertable, `hash -o /etc/mail/mailertable')
 FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')
 dnl define(`confCW_FILE', `-o /etc/mail/sendmail.cw')
 define(`confCW_FILE', `-o /etc/mail/local-host-names')
 
 DAEMON_OPTIONS(`Name=IPv4, Family=inet')
 DAEMON_OPTIONS(`Name=IPv6, Family=inet6, Modifiers=O')
 
 define(`confBIND_OPTS', `WorkAroundBroken')
 define(`confNO_RCPT_ACTION', `add-to-undisclosed')
 define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')
 
 define(`confDONT_PROBE_INTERFACES',`True')dnl
 dnl MAILER(local)
 MAILER(smtp)
 MAILER(dovecot)
 dnl MAILER(procmail)dnl
 
 dnl set SASL options
 TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
 define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
 
 
 The following is the output with the above 'hostname.mc' in effect
 and 'Mailer(local) is still the LDA. :=\
 
 WORKSTATION# echo '$=w' | /usr/sbin/sendmail -bt
 ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
 Enter ruleset address
  [72.225.169.69]
 guice.ath.cx
 localhost
 WORKSTATION.guice.ath.cx
 
 ---
 ## Here are the log files after sending test emails to the devcot
 machine.
 
 Aug 20 20:04:05 WORKSTATION sm-mta[5921]: m7L045E7005921:
 from=[EMAIL PROTECTED], size=1765, class=0, nrcpts=1,
 msgid=[EMAIL PROTECTED],
 proto=ESMTP, daemon=IPv4, relay=rv-out-0506.google.com
 [209.85.198.239]
 Aug 20 20:04:05 WORKSTATION sm-mta[5922]: m7L045E7005921:
 to=[EMAIL PROTECTED], delay=00:00:00, xdelay=00:00:00,
 mailer=local, pri=32008, relay=local, dsn=2.0.0, stat=Sent

I'm replying to two (2) messages herein ...

In response to 'Steffen Kaiser': I haven't found in the thread, why 
you don't use Deliver as local LDA?

MY_Reply 1): we're following a dovecot.org article; trying to figure 
out if its something we are doing incorrectly, or if there is an 
installation, or some other such issue.


'Steffen Kaiser'-- BTW: You've defined  local_lmtp, why?
My_Reply 1a): It, local_lmtp, was already in the default file and things were 
working.

- In reply to 'SM resistor.net -
 
 If guice.ath.cx is listed in /etc/hosts, remove it from there and 
 restart sendmail to test.


WORKSTATION# cat /etc/mail/local-host-names

WORKSTATION# cat /etc/hosts | grep -i workstation
WORKSTATION# cat /etc/hosts | grep -i guice
WORKSTATION# cat /etc/hosts | grep -i ath
WORKSTATION# cat /etc/hosts | grep -i cx
- Nothing that resembles 'workstation', 'guice', 'ath', 'cx'

---
hostname.mc contains
--
divert(-1)

divert(0)
VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.30.2.4 
2007/11/22 16:20:01 gs
OSTYPE(freebsd6)
DOMAIN(generic)

FEATURE(access_db, `hash -o -TTMPF /etc/mail/access')
FEATURE(blacklist_recipients)
FEATURE(local_lmtp)
FEATURE(mailertable, `hash -o /etc/mail/mailertable')
FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')

define(`confCW_FILE', `-o /etc/mail/local-host-names')

DAEMON_OPTIONS(`Name=IPv4, Family=inet')
DAEMON_OPTIONS(`Name=IPv6, Family=inet6, Modifiers=O')

define(`confBIND_OPTS', `WorkAroundBroken')
define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')

MAILER(dovecot)
MAILER(local)
MAILER(smtp)
MAILER(procmail)dnl

TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl


-Sending a test email to the dovecot 

Re: [Dovecot] TECRA-A9 -- devcot LDA/sendmail

2008-08-21 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 21 Aug 2008, [EMAIL PROTECTED] wrote:

Do you have some Cw lines in sendmail.cf? Maybe OSTYPE(freebsd) adds them. 
For instance, there is always a Cwlocalhost line in my .cf file.


Bye,

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIrXKUVJMDrex4hCIRAkYcAJ47Rm94c60WywISEsN2kllCt/ZwVACeLk36
25XwIRP8i4LKGcCPGl/4rLA=
=u4C8
-END PGP SIGNATURE-


Re: [Dovecot] dovecot-antispam has some kind of bug

2008-08-21 Thread Johannes Berg

 My dspam users has the email as username [EMAIL PROTECTED] and in 
 dovecot.conf i need to specify the user when training, is there a
 way to get the resiptient address in the dovecot.conf? i am only able to 
 get %u ie the username ;-(
 
 Could you patch the antispam plugin to be able to take then resiptient 
 as dspam user? ie  the mail address , you can have a option in dovecot 
 that says use resiptient address as user or something
 
 it would be great if you had time to check this out ;-)

TBH, I don't, and I also don't see why you'd need the recipient address,
can't you just build it like [EMAIL PROTECTED] or [EMAIL PROTECTED] or 
something?

johannes


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] dovecot-antispam has some kind of bug

2008-08-21 Thread Mikael Jenkler
Needed to be a member, now its done, sorry for remailing this again 
(need to be in list)


Mikael Jenkler wrote:

Yeah!

My problem is gone. needed:
latest dovecot-antispam plugin
and dovecot-1.1.2 minimum

Thanks Johannes


about my other  question:


My dspam users has the email as username [EMAIL PROTECTED] and in 
dovecot.conf i need to specify the user when training, is there a
way to get the resiptient address in the dovecot.conf? i am only able 
to get %u ie the username ;-(


Could you patch the antispam plugin to be able to take then resiptient 
as dspam user? ie  the mail address , you can have a option in dovecot 
that says use resiptient address as user or something


it would be great if you had time to check this out ;-)






/J3nkl3r


On Mon, 2008-08-18 at 10:04 +0200, Mikael Jenkler wrote:


 Hi All!
  There is a issue with dovecot-antispam and the new dovecot-1.1.x 
 (dovecot-1.1.1)
  


The antispam plugin requires 1.1.2

johannes





Johannes Berg wrote:

On Thu, 2008-08-21 at 12:25 +0200, Mikael Jenkler wrote:
 

Hi Johannes!

it seams that you pluggin is doing something wrong with the imap 
connection


i get this:

Aug 21 12:21:54 firestorm dovecot: child 21443 (imap) killed with 
signal 11


both with squirrelmail and mutt mail clients, but only when the 
pluggin is enabled in dovecot

iam using dovecot-1.1.1

have you seen this error before?



Only with older versions of my plugin. Are you using the latests dovecot
1.1 and my plugin? We'll need you to compile both dovecot and the plugin
with debugging information and provide a backtrace.

johannes
  







Re: [Dovecot] dovecot-antispam has some kind of bug

2008-08-21 Thread Johannes Berg
On Thu, 2008-08-21 at 16:15 +0200, Mikael Jenkler wrote:
 The problem is that my %u is a user not the mail address and i train on 
 the mail address from master.cf
 I modded your old script to support (for dovecot 1.0.x) it but when 
 1.1.x came it didnot work anymore
 
 i have a diffrent username for auth then for resiveing  mail  so  it 
 impossible to  train on that
 You could have a option called train on resiptient or something
 
 i got the recipient address in the script then added this:
 
 execl(DSPAM, --source=error, --stdout, --user, recipient, 
 class_arg, sign_arg, NULL);

So how did you get the recipient? What if the To: header isn't right?
Did you use the envelope recipient? How did you get it?

I'd rather not open that can of worms. If you can send me a clean patch,
I might integrate it, but I'm surely not going to work on it.

johannes


signature.asc
Description: This is a digitally signed message part


[Dovecot] LDA qmail - vpopmail

2008-08-21 Thread Ron Culler
I am trying to setup LDA with qmail/vpopmail to use the expire plugin
and I am getting errors about auth-master

(Can't connect to auth server at /usr/local/var/run/dovecot/auth-master:
No such file or directory)

The auth default section of the dovecot.conf is set to use
vpopmail(mysql) and that works great for IMAP access.

Can anyone share a config for using the expire plugin with
qmail/vpopmail?   I was wanting to put the preline commands in the
.qmail-default files on a per-domain basis.

/home/vpopmail/domains/domain1.com/.qmail-default

But to start I tried just putting it into the .qmail file for an
individual user.

Thanks
 
 
Ron Culler


Re: [Dovecot] dovecot-antispam has some kind of bug

2008-08-21 Thread Mikael Jenkler
The problem is that i dont have it working for the new antispam but here 
is your old script with the recipient fixed

This is 100% your code so you should be able to understand what i have done

You have changed 1000 things in your antispam plugin so it relly hard 
for me to patch it
atleast take a look at it, if its possible to do the same thing with the 
new plugin, please


I think that more people then me would like this feature, if the to is 
wrong  then  its wrong  but it would be great if this feature  existed  
= me happy ;-)


Look att the attached lib_dspam.c
/J3nkl3r 



Johannes Berg wrote:

On Thu, 2008-08-21 at 16:15 +0200, Mikael Jenkler wrote:
  
The problem is that my %u is a user not the mail address and i train on 
the mail address from master.cf
I modded your old script to support (for dovecot 1.0.x) it but when 
1.1.x came it didnot work anymore


i have a diffrent username for auth then for resiveing  mail  so  it 
impossible to  train on that

You could have a option called train on resiptient or something

i got the recipient address in the script then added this:

execl(DSPAM, --source=error, --stdout, --user, recipient, 
class_arg, sign_arg, NULL);



So how did you get the recipient? What if the To: header isn't right?
Did you use the envelope recipient? How did you get it?

I'd rather not open that can of worms. If you can send me a clean patch,
I might integrate it, but I'm surely not going to work on it.

johannes
  


/*
  To use this plugin, you need to configure dspam to
* deliver spam into the SPAM folder for each user
* add a X-DSPAM-Signature header line with the signature. Body or
  attachment signatures do not work, as dovecot is programmed to
  extract the signature. It should be trivial to change this,
  but it seemed cleaner this way. If you want (or already have)
  a different header line name, then just change
  the #define on top of the file.

  To compile:
  make plugins directory right beside src in the dovecot source tree,
  copy this into there and run

  cc -fPIC -shared -Wall -I../src/ -I../src/lib -I.. -I../src/lib-storage \
  -I../src/lib-mail -I../src/lib-imap -I../src/imap/ -DHAVE_CONFIG_H \
  lib_dspam.c -o lib30_dspam.so

  Add -DDEBUG_DSPAM for debug

  Install the plugin in the usual dovecot module location.
  copy the plugin to /usr/lib/dovecot/imap folder

  If you need to ignore a trash folder, define a trash folder
  name as follows, or alternatively give -DIGNORE_TRASH_NAME=\Trash\ on
  the cc command line.
*/

#include common.h
#include str.h
#include strfuncs.h
#include commands.h
#include imap-search.h
#include lib-storage/mail-storage.h
#include lib/mempool.h
#include mail-storage.h
#include unistd.h
#include sys/wait.h
#include stdlib.h
#include stdio.h
#include errno.h
#include fcntl.h
#ifdef DEBUG_DSPAM
#include syslog.h
#endif

#define IGNORE_TRASH_NAME INBOX.Trash
#define MAXSIGLEN 100
#define RECIPIENT Delivered-To
#define SIGHEADERLINE X-DSPAM-Signature

#ifndef DSPAM
#define DSPAM /usr/bin/dspam
#endif /* DSPAM */

static int
call_dspam(const char* signature, int is_spam, const char* recipient)
{
pid_t pid;
int s;
char class_arg[16+2];
char sign_arg[MAXSIGLEN+2];
int pipes[2];

s = snprintf(sign_arg, 101, --signature=%s, signature);
if ( s  MAXSIGLEN || s = 0) return -1;

snprintf(class_arg, 17, --class=%s, is_spam ? spam : innocent);

pipe(pipes); /* for dspam stderr */

pid = fork();
if (pid  0) return -1;

if (pid) {
int status;
/* well. dspam doesn't report an error if it has an error,
   but instead only prints stuff to stderr. Usually, it
   won't print anything, so we treat it having output as
   an error condition */

char buf[1024];
int readsize;
close(pipes[1]);

do {
readsize = read(pipes[0], buf, 1024);
if (readsize  0) {
readsize = -1;
if (errno == EINTR) readsize = -2;
}
} while (readsize == -2);

if (readsize != 0) {
close(pipes[0]);
return -1;
}

waitpid (pid, status, 0);
if (!WIFEXITED(status)) {
close(pipes[0]);
return -1;
}

readsize = read(pipes[0], buf, 1024);
if (readsize != 0) {
close(pipes[0]);
return -1;
}

close(pipes[0]);
return WEXITSTATUS(status);
} else {
int fd = open(/dev/null, O_RDONLY);
close(0); close(1); close(2);
/* see above */
close(pipes[0]);

if (dup2(pipes[1], 2) != 2) {
exit(1);
}
if (dup2(pipes[1], 1) != 1) {
exit(1);
}
close(pipes[1]);

if (dup2(fd, 0) != 0) {
exit(1);
}
close(fd);

#ifdef DEBUG_DSPAM
syslog(LOG_MAIL, DSPAM  --source=error --stdout --user %s %s %s, 

Re: [Dovecot] dovecot bug - kevent(EV_DELETE, 9)

2008-08-21 Thread Mail.ru
Здравствуйте, Timo.

Вы писали 21 августа 2008 г., 8:42:24:

 On Wed, 2008-08-20 at 22:43 +0400, Mail.ru wrote:
  dovecot works fine with AD! but i have this in logs (This not nice,
  but no more):
  Aug 14 02:21:03 somecomp dovecot: auth(default): LDAP: Connection
  lost to LDAP server, reconnecting
  Aug 14 02:21:03 somecomp dovecot: auth(default):
  kevent(EV_DELETE, 9) failed: Bad file descriptor 

 These should help for the Bad file descriptor error:

 http://hg.dovecot.org/dovecot-1.1/rev/0930aa699486
 http://hg.dovecot.org/dovecot-1.1/rev/155d4e597397

 I understand. Windows 2003 close idle connections every 15
 minutes (that policy set by default
 in any windows 2003 server) and dovecot reconnects with this error.
 
 Unfortunately dovecot haven't keep-alive parameter to keep
 connection to LDAP alive (not idle). :(
 And only that parameter can resolve my problem.

 What keep-alive parameter? If you mean for TCP connections, it is
 already set and it doesn't help here. Does LDAP have a keep-alive option
 too? I think the two timeout options I see are about client-side timeout
 handling. One thing Dovecot could do is to send a dummy LDAP request
 every few minutes, but that seems pretty ugly.

Thank you very much!!! The patch is working fine. I haven't errors in
logs any more.

About keep-alive parameter - I mean keep-alive option in config (like
you said: to send a dummy LDAP request every few minutes).
And i don't think that this seems pretty ugly.
When connection idle dovecot will reconnect to the LDAP every N
minutes. Time interval (N minutes) sets by idle_timeout option in OpenLDAP (or
by GPO in AD).

In logs it's look like (without error):
Aug 14 03:36:06 somecomp dovecot: auth(default): LDAP: Connection lost to LDAP 
server, reconnecting
Aug 14 03:51:06 somecomp dovecot: auth(default): LDAP: Connection lost to LDAP 
server, reconnecting
Aug 14 04:06:06 somecomp dovecot: auth(default): LDAP: Connection lost to LDAP 
server, reconnecting

It's only IMHO:
If you can add this option in new version of dovecot (only for LDAP), i will be
happy (and not only me). :)

P.S.
Thanks for patch again!



Re: [Dovecot] How Can I Tell How Dovecot Was Installed?

2008-08-21 Thread Scott Silva

on 8-20-2008 2:47 PM Kenneth Porter spake the following:
--On Wednesday, August 20, 2008 7:35 AM -0400 Blake Carver 
[EMAIL PROTECTED] wrote:



I guess I'm not quite sure how to interpret this to help me figure out
my problem, there are changes rpm reports, does this mean that an RPM
was installed but so was a source package?

rpm -V -v dovecot
 c /etc/dovecot.conf


This is a config file, as denoted by the c. The row of dots means the 
file is pristine (hasn't been modified since it was installed).



S.5T c /etc/rc.d/init.d/dovecot


This config file is different from the package. I don't recall what all 
the flags mean but the 5 means an MD5 checksum mismatch. As a rule, 
initscripts shouldn't be modified unless you're doing something tricky, 
so this was likely replaced from a tarball install.



prelink: /usr/libexec/dovecot/dict: at least one of file's
dependencies has changed since prelinking
S.?.   /usr/libexec/dovecot/dict
prelink: /usr/libexec/dovecot/dovecot-auth: at least one of file's
dependencies has changed since prelinking
S.?.   /usr/libexec/dovecot/dovecot-auth


All of these prelink errors suggest that your binaries were overwritten 
from a tarball installation. The easy fix is to erase (rpm -e) the 
package and re-install it, likely upgrading to a newer package at the 
same time.
But a rpm install will not overwrite the tarball install since tarball 
installs usually go to /usr/local or under /opt while rpm installs will go 
into /usr directly. I don't know if the tarball has a make uninstall command, 
but the previous admin should have left the unpacked source around from the 
install somewhere in either /root or in his home directory. That can give more 
clues.





 d /usr/share/doc/dovecot-1.0/REDHAT-FAQ.txt


d files are documentation, and if you're tight on disk space, you can 
suppress installation of documentation when the package is installed.





--
MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't



signature.asc
Description: OpenPGP digital signature


Re: [Dovecot] How Can I Tell How Dovecot Was Installed?

2008-08-21 Thread mouss

Scott Silva wrote:

on 8-20-2008 2:47 PM Kenneth Porter spake the following:


All of these prelink errors suggest that your binaries were 
overwritten from a tarball installation. The easy fix is to erase 
(rpm -e) the package and re-install it, likely upgrading to a newer 
package at the same time.
But a rpm install will not overwrite the tarball install since tarball 
installs usually go to /usr/local or under /opt while rpm installs will 
go into /usr directly.


sure, but
- if you intend to always build from sources, you don't really care 
about packages. it's only once you get a problem that you start becoming 
more careful.
- however you do it, init scripts generally go under /etc (at least 
under Linux).


I don't know if the tarball has a make uninstall 


This almost never exists. it is not easy to implement (because you don't 
want to remove files installed otherwise) without implementing a package 
manager. an install.log would be nice though...


command, but the previous admin should have left the unpacked source 
around from the install somewhere in either /root or in his home 
directory. That can give more clues.




well, he could should, but he generally would never :-)

OP can try to find the distribution that was installed from source and 
use it to determine which files it installs, or he could ignore it and 
only remove the files that create problems with a new version. if he is 
motivated enough, reinstalling the whole system may be worth the pain.





 d /usr/share/doc/dovecot-1.0/REDHAT-FAQ.txt


d files are documentation, and if you're tight on disk space, you 
can suppress installation of documentation when the package is installed.


or buy more disk ;-p



[Dovecot] Problem with multiple Dovecot Instances

2008-08-21 Thread Manuel Maurer
Hello,

first i want to say that i never used a mailing list before, so if i made
something wrong do not hesitate to contact me via e-mail.

I try to set up multiple Dovecot instances running at the same time. Goal
is to provide IMAPS with a valid SSL Certificate on selected IP Addresses.
To reach this i want to set it up as follows:

1 Dovecot Daemon listening on localhost (for webmail), providing LDA and
Authentification (over MySQL)
4 Dovecot Daemons listening on each IP Address, querying the localhost
daemon for authentification

Just for your Information:
I replaced all real data with placeholders, like the IP Address of my
Server with MY_IP. Also i removed some absolutely non relevant lines from
the configuration output (like settings for logging)

This is my localhost config-output:

# 1.1.2: /opt/dovecot/etc/dovecot.conf
base_dir: /var/run/dovecot
protocols: pop3 imap
listen(default): 127.0.0.1:143
listen(imap): 127.0.0.1:143
listen(pop3): 127.0.0.1:110
ssl_disable: yes
login_dir: /var/run/dovecot/login
login_executable(default): /opt/dovecot/libexec/dovecot/imap-login
login_executable(imap): /opt/dovecot/libexec/dovecot/imap-login
login_executable(pop3): /opt/dovecot/libexec/dovecot/pop3-login
login_chroot: no
first_valid_uid: 5000
last_valid_uid: 5000
mail_location: mbox:/home/vmail/%d/%u
mail_executable(default): /opt/dovecot/libexec/dovecot/imap
mail_executable(imap): /opt/dovecot/libexec/dovecot/imap
mail_executable(pop3): /opt/dovecot/libexec/dovecot/pop3
mail_plugin_dir(default): /opt/dovecot/lib/dovecot/imap
mail_plugin_dir(imap): /opt/dovecot/lib/dovecot/imap
mail_plugin_dir(pop3): /opt/dovecot/lib/dovecot/pop3
auth default:
  mechanisms: plain login
  user: nobody
  passdb:
driver: sql
args: /opt/dovecot/etc/dovecot-sql.conf
  userdb:
driver: sql
args: /opt/dovecot/etc/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: dovecot
  group: dovecot

deliver and webmail works fine when i start this Daemon. Now i made a
second conf-file:

# 1.1.2: /opt/dovecot/etc/dovecot_main.conf
base_dir: /var/run/dovecot_main
protocols: pop3s imaps
ssl_listen(default): MY_IP:993
ssl_listen(imap): MY_IP:993
ssl_listen(pop3): MY_IP:995
ssl_cert_file: /opt/certs/example.crt
ssl_key_file: /opt/certs/example.key
ssl_cipher_list: ALL:!LOW:!SSLv2
login_dir: /var/run/dovecot/login
login_executable(default): /opt/dovecot/libexec/dovecot/imap-login
login_executable(imap): /opt/dovecot/libexec/dovecot/imap-login
login_executable(pop3): /opt/dovecot/libexec/dovecot/pop3-login
login_chroot: no
first_valid_uid: 5000
last_valid_uid: 5000
mail_location: mbox:/home/vmail/%d/%u
mail_executable(default): /opt/dovecot/libexec/dovecot/imap
mail_executable(imap): /opt/dovecot/libexec/dovecot/imap
mail_executable(pop3): /opt/dovecot/libexec/dovecot/pop3
mail_plugin_dir(default): /opt/dovecot/lib/dovecot/imap
mail_plugin_dir(imap): /opt/dovecot/lib/dovecot/imap
mail_plugin_dir(pop3): /opt/dovecot/lib/dovecot/pop3
auth extern:
  socket:
type: connect
master:
  path: /var/run/dovecot/auth-master
  mode: 384

Starting up the second Daemon is also no problem, it listen to the correct
IP, Logfiles does not show any errors. When i try to connect with
Thunderbird to this Daemon using IMAPS, i got the following errors logged:

Logfile for dovecot_main:

dovecot: “2008-08-21 19:16:47 ”Info: imap-login: Internal login failure
(auth failed, 1 attempts): user=MY_USERNAME, method=PLAIN, rip=REMOTE_IP,
lip=LOCAL_IP, TLS

Logfile for dovecot_local:

dovecot: Info: auth(default): client in: AUTH 1   PLAIN  
service=imapsecured lip=LOCAL_IPrip=REMOTE_IP  lport=993   
rport=3107
dovecot: Info: auth(default): client out: CONT1
dovecot: Info: auth(default): client in: CONThidden
dovecot: Info: auth-worker(default): sql(MY_EMAIL,REMOTE_IP): query: SELECT
email AS user, NULL AS password, 1 AS nopassword, 
'/home/vmail/MY_DOMAIN/MY_USERNAME' AS userdb_home,
'mbox:/home/vmail/MY_DOMAIN/MY_USERNAME' AS userdb_mail, 5000 AS
userdb_uid, 5000 AS userdb_gid FROM users WHERE email = 'MY_EMAIL' AND
password = MD5('MY_PASSWORD') AND locked = 0 AND inactive = 0
dovecot: Info: auth(default): client out: OK  1   user=MY_EMAIL
dovecot: Info: auth(default): master in: REQUEST  1   54161
dovecot: Error: auth(default): Master requested auth for nonexisting client
5416

I understand what this error message means, when i run top during login i
can see one imap-login process (running under the Daemon main) is
disappearing and coming up again a few seconds later.
What is causing this behaviour?

Thanks in advance.

Manuel



[Dovecot] POP3 UID file problem

2008-08-21 Thread naslov naslov
Hello.

I upgraded from RHRL4 to RHEL5 and my dovecot version changed from
dovecot-0.99.11-8.EL4  to dovecot-1.0.7-2.el5.

I also transferred all /home directories of users. The problem is that users
have POP3 mail client set that it leaves mail on mailserver for 30 days.
When they try to download messages from new server, client (Thinderbird)
want to download all messages for those 30 days (he of course already has
all those messages..). I suspect UID POP3 database index file format has
changed..

How to convert dovecot 0.99 POP3 UID files to those used in newer version
or how to go around that?

Thanks for answering,

naslov


[EMAIL PROTECTED] INBOX]# dovecot -n
# 1.0.7: /etc/dovecot.conf
protocols: imap pop3 pop3s
ssl_cert_file: /etc/httpd/conf/ssl.crt/server.crt
ssl_key_file: /etc/httpd/conf/ssl.key/server.key
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
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/pop3
auth default:
  passdb:
driver: pam
  userdb:
driver: passwd


[Dovecot] assertion failed

2008-08-21 Thread CJ Keist
I haven't heard anything on this bug.  Is this a bug?  I'm using dovecot 
1.1.2 with the following patch applied:


http://hg.dovecot.org/dovecot-1.1/rev/d674c05d725d

Another section from my logs. I know the backtrace is just numbers, let 
me know how to compile to get more useful information if you need it. 
So far no one is beating down my door, so I don't think users are seeing 
any ill effects.  But I would sleep better knowing why it's happening.


Aug 21 16:19:17 goku dovecot: [ID 107833 mail.crit] Panic: IMAP(rhjohn): 
file index-sync.c: line 39 (index_mailbox_set_recent_uid): assertion 
failed: (seq_range_exists(ibox-recent_flags, uid))Aug 21 16:19:17 goku 
dovecot: [ID 107833 mail.error] IMAP(rhjohn): Raw backtrace: 0x95f98 - 
0x959f8 - 0x6278c - 0x627d0 - 0x48d14 - 0x4981c - 0x41db0 - 
0x72378 - 0x637d8 - 0x66200 - 0x22594 - 0x266f8 - 0x277ec - 
0x277a8 - 0x27b04 - 0x27d04 - 0x9d3f4 - 0x9ccd4 - 0x2ff58 - 0x21398
Aug 21 16:19:17 goku dovecot: [ID 684838 mail.error] child 4805 (imap) 
killed with signal 6
Aug 21 16:19:17 goku postfix/smtpd[3421]: [ID 197553 mail.info] connect 
from unknown[190.152.60.9]
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] auth(default): 
client in: AUTH  1   PLAIN   service=imapsecured 
lip=129.82.224.16   rip=129.82.53.12lport=993   rport=49269
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] auth(default): 
client out: CONT 1
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] auth(default): 
client in: CONThidden
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] 
auth-worker(default): pam(rhjohn,129.82.53.12): lookup service=dovecot
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] 
auth-worker(default): pam(rhjohn,129.82.53.12): #1/1 style=1 msg=Password:
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] auth(default): 
client out: OK   1   user=rhjohn
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] auth(default): 
master in: REQUEST   45963   65201
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] 
auth-worker(default): passwd(rhjohn,129.82.53.12): lookup
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] auth(default): 
master out: USER 45963   rhjohn  system_user=rhjohn  uid=19615 
 gid=21  home=/top/academic/Atmos/people/rhjohn/home
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] imap-login: Login: 
user=rhjohn, method=PLAIN, rip=129.82.53.12, lip=129.82.224.16, TLS
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] auth(default): 
client in: AUTH  1   PLAIN   service=imaplip=129.82.224.16 
 rip=67.223.73.37lport=143   rport=54470 resp=hidden
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] 
auth-worker(default): pam(dvivanco,67.223.73.37): lookup service=dovecot
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] 
auth-worker(default): pam(dvivanco,67.223.73.37): #1/1 style=1 msg=Password:
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] IMAP(rhjohn): 
Effective uid=19615, gid=21, home=/top/academic/Atmos/people/rhjohn/home
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] IMAP(rhjohn): mbox: 
data=/top/academic/Atmos/people/rhjohn/home/:INBOX=/userM/mail/rhjohn
Aug 21 16:19:17 goku dovecot: [ID 107833 mail.info] IMAP(rhjohn): fs: 
root=/top/academic/Atmos/people/rhjohn/home, index=, control=, 
inbox=/userM/mail/rhjohn


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I just switched over to dovecot 1.1.2 on our live system last night. I'm
seeing the following errors in the logs:

Aug 19 10:01:03 goku dovecot: [ID 107833 mail.crit] Panic: IMAP(elevin):
file in
dex-sync.c: line 39 (index_mailbox_set_recent_uid): assertion failed:
(seq_range
_exists(ibox-recent_flags, uid))

I did apply the assertion fix that Timo sent out.

# 1.1.2: /userM/mail-services/dovecot/etc/dovecot.conf
Warning: fd limit 256 is lower than what Dovecot can use under full load
(more than 3072). Either grow the limit or change
login_max_processes_count and max_mail_processes settings
base_dir: /userM/mail-services/dovecot/var/run/dovecot/
protocols: imap imaps pop3 pop3s
ssl_cert_file: /userM/mail-services/dovecot/etc/ssl/dovecot.pem
ssl_key_file: /userM/mail-services/dovecot/etc/ssl/privkey.pem
ssl_parameters_regenerate: 0
ssl_cipher_list: MEDIUM:!LOW
disable_plaintext_auth: no
login_dir: /userM/mail-services/dovecot/var/run/dovecot/login
login_executable(default):
/userM/mail-services/dovecot/libexec/dovecot/imap-login
login_executable(imap):
/userM/mail-services/dovecot/libexec/dovecot/imap-login
login_executable(pop3):
/userM/mail-services/dovecot/libexec/dovecot/pop3-login
login_greeting: Cyrus ready.
login_max_processes_count: 1024
max_mail_processes: 1024
mail_location: mbox:~/:INBOX=/userM/mail/%u
mail_debug: yes
mmap_disable: yes
mail_nfs_index: yes
mail_executable(default): /userM/mail-services/dovecot/libexec/dovecot/imap
mail_executable(imap): /userM/mail-services/dovecot/libexec/dovecot/imap
mail_executable(pop3): 

Re: [Dovecot] dovecot panic after upgrade 1.0.15 to 1.1.2

2008-08-21 Thread Eric Rostetter

Quoting Timo Sirainen [EMAIL PROTECTED]:


I saw that, but the line just comment out that line is kind of
confusing as to which line (or lines) I should comment out.  Is
it just the assert (and leave the return), or is it the whole conditional
around the assert, or something else?


I meant the assert itself (or change it to an i_error(recent flag
bug)). Although few clients really use recent flags, so it probably
doesn't matter much what you do. :)


I changed the i_assert to an i_error (so I can track when it happens,
and who it happens to, still).


Anyway I'll try to look into why it's crashing. But it doesn't look like
I can reproduce this with my imaptest tool, since it's been running for
2,5 hours now without this crash.


Let me know if there is anything I can do to help.


You could also see if this patch happens to help (probably not):
http://hg.dovecot.org/dovecot-1.1/rev/7f5cc9e805ec


I applied it, but it doesn't appear to help judging by the number of
i_error log entries from my patch...

Hopefully this will clear things up for the users (so they don't notice
any problems).  I'll let you know if not. :)

--
Eric Rostetter
The Department of Physics
The University of Texas at Austin

Go Longhorns!