dict host param and fqdn

2017-11-14 Thread Stéphane Cottin

Hi,

I would like to use a fqdn instead of an IP address as redis host

quota_clone_dict = redis:host=redis.host.name:port=6379

But only ip adresses are supported

	Error: quota_clone_dict: Failed to initialize 
'redis:host=redis.host.name:port=6379': dict redis: Invalid IP: 
redis.host.name


Why is name resolution not implemented here ? Is it for performance 
considerations ?



Stéphane


Re: antispam plugin pipe backend error when moving multiple emails

2016-04-18 Thread Stéphane Cottin

Hello,

I'm bumping this because it still occurs with dovecot 2.2.22.

my dovecot-antispam plugin configuration :

  antispam_allow_append_to_spam = no
  antispam_backend = pipe
  antispam_pipe_program = /usr/bin/rspamc
  antispam_pipe_program_args = -h;127.0.0.1:11334;-P;
  antispam_pipe_program_notspam_arg = learn_ham
  antispam_pipe_program_spam_arg = learn_spam
  antispam_pipe_tmpdir = /var/tmp
  antispam_spam = Junk
  antispam_trash = trash;Trash;Deleted Items;Deleted Messages

zlib enabled:
  zlib_save = gz
  zlib_save_level = 9


When moving 2 or more messages from inbox to the Junk folder:

"J47 NO [CANNOT] Failed to copy to temporary file (0.000 + 0.000 
secs).”. Command attempted: “J47 UID MOVE 106318:106319 Junk"


or sometimes

"J123 NO [CANNOT] Failed to read mail beginning (0.000 + 0.000 
secs).”. Command attempted: “J123 UID MOVE 170789:170790 Junk"


and still have the "Cached message size smaller..." in dovecot logs.

It occurs at least when header lines of an email contains Non-ASCII Text 
(rfc1342).

Batches of full ascii emails are not affected.

I can easily reproduce this from/to the Junk folder, but had unconfirmed 
reports of similar errors when batch moving mails across regular 
folders.


Stéphane


On 8 Nov 2015, at 11:50, Stéphane Cottin wrote:


Hi,

I've got some trouble with the dovecot antispam plugin and the pipe 
backend.


I'm using dovecot 2.2.18 with maildirs and zlib compression enabled.

When moving 2 or more emails at once from the Junk folder to another 
one, I always have the following error : "Failed to copy to temporary 
file"


In the server logs :

imap(v...@vvv.vvv): Error: 
read(zlib(/data/Maildir/.test/tmp/1446974366.M123890P936.vvv)) failed: 
Cached message size smaller than expected (13553 < 13562, box=test, 
UID=0)


The same operation with one email at a time, on the same emails, works 
as expected.


Stéphane


antispam plugin pipe backend error when moving multiple emails

2015-11-08 Thread Stéphane Cottin
Hi,

I've got some trouble with the dovecot antispam plugin and the pipe backend.

I'm using dovecot 2.2.18 with maildirs and zlib compression enabled.

When moving 2 or more emails at once from the Junk folder to another one, I 
always have the following error : "Failed to copy to temporary file"

In the server logs : 

imap(v...@vvv.vvv): Error: 
read(zlib(/data/Maildir/.test/tmp/1446974366.M123890P936.vvv)) failed: Cached 
message size smaller than expected (13553 < 13562, box=test, UID=0)

The same operation with one email at a time, on the same emails, works as 
expected.

Stéphane

Re: LDA input validation

2015-01-26 Thread Stéphane Cottin

> Le 26 janv. 2015 à 12:03, Joseph Tam  a écrit :
> 
> St?phane Cottin writes:
> 
>>> You're stilling going to lose contents.  If dspam fails, the mail
>>> is dumped, the LDA returns exit code 75, and the MTA will probably
>>> issue a bounce Email to the sender.
>> 
>> from dovecot-lda man page :
>> 
>> 75  A  temporary  failure.  This  is  returned  for  almost all failures. 
>> See the log file for
>>  details. (EX_TEMPFAIL)
>> 
>> The mta keep the mail and retry delivery later, which is what I need.
> 
> Ah, my mistake.  But ...
> 
>> I don't want to deliver email on dspam error, I prefer TEMPFAIL and
>> future retries, so I have a chance to fix the issue later without
>> loosing or deliver unprocessed mails
> 
> ... you only have a limited time to fix it.  Depending on the sending
> MTA's retry schedule, you might have only a few days or less to to deal
> with it before the sending MTA stops trying.

We hopfully are notified whitin a few minutes when something's wrong in mail 
delivery, having a few days to fix is far more than needed.

> 
> If it's important not to lose mail, then the deliver on failure strategy
> would be more appropriate.  You can even copy the input message that
> caused dpam to crash to an inspection queue for later perusal.

We do not have dspam crashes caused per email contents, they always are system( 
disk errors, oom kill,…) , clamav or database issues. 
Anyways, having a copy of the input message somewhere, whatever it's unrelated 
to the error is a good advice, we'll think about it.

> 
> Joseph Tam 


Re: LDA input validation

2015-01-26 Thread Stéphane Cottin

> Le 26 janv. 2015 à 11:21, Reindl Harald  a écrit :
> 
> 
> Am 26.01.2015 um 10:52 schrieb Stéphane Cottin:
>>> Le 26 janv. 2015 à 10:09, Reindl Harald  a écrit :
>>>>> You're stilling going to lose contents.  If dspam fails, the mail
>>>>> is dumped, the LDA returns exit code 75, and the MTA will probably
>>>>> issue a bounce Email to the sender.
>>>> 
>>>> which would be OK, if "never loose email contents" means "no message is
>>>> discarded silently".
>>> 
>>> no, it is not OK to backscatter because the spamfilter fails
>>> 
>>> realize that 99% auf junk is using forged senders
>>> 
>>> recently i got each day some hundret such bounces from mailservers 
>>> configured by fools reply to spam with forged senders and if i could i 
>>> would have gone out for beat every responsible admin straight in the face
>> 
>> I may discard emails based on RBLs, but I don't want to discard emails based 
>> on statistical fllters, I prefer deliver them in the Junk folder and let the 
>> user have a chance to reclassify using dovecot_antispam.
>> And yes, bounce spams to (forged or not) sender is useless
> 
> you *must not* discard mails - in no context - period

right, s/discard/reject/

> 
> that's why milters exist to tag between let say 5.0 and 8.0 spam points and 
> REJECT pre-queue based on SpamAssassin and/or ClamAV
> 
> maybe dspam can't do that, but it's *abandonware* anyways
> http://comments.gmane.org/gmane.mail.spam.dspam.user/19136

dspam is fast and lightweight, ideal for low memory virtual servers, and AFAIK 
the only spamassasin alternative.


Re: LDA input validation

2015-01-26 Thread Stéphane Cottin

> Le 26 janv. 2015 à 10:09, Reindl Harald  a écrit :
> 
> 
> 
> Am 26.01.2015 um 08:52 schrieb Steffen Kaiser:
>> On Sun, 25 Jan 2015, Joseph Tam wrote:
>>> St?phane Cottin writes:
>> 
 dspam already send errors to syslog, the point here is to never loose
 email contents.  This was a wrong design, i'm now use a wrapper instead
 ( see my previous post for details ).
>> 
>>> You're stilling going to lose contents.  If dspam fails, the mail
>>> is dumped, the LDA returns exit code 75, and the MTA will probably
>>> issue a bounce Email to the sender.
>> 
>> which would be OK, if "never loose email contents" means "no message is
>> discarded silently".
> 
> no, it is not OK to backscatter because the spamfilter fails
> 
> realize that 99% auf junk is using forged senders
> 
> recently i got each day some hundret such bounces from mailservers configured 
> by fools reply to spam with forged senders and if i could i would have gone 
> out for beat every responsible admin straight in the face
> 

I may discard emails based on RBLs, but I don't want to discard emails based on 
statistical fllters, I prefer deliver them in the Junk folder and let the user 
have a chance to reclassify using dovecot_antispam.
And yes, bounce spams to (forged or not) sender is useless.


Re: LDA input validation

2015-01-26 Thread Stéphane Cottin

> Le 26 janv. 2015 à 05:31, Joseph Tam  a écrit :
> 
> St?phane Cottin writes:
> 
>> dspam already send errors to syslog, the point here is to never loose
>> email contents.  This was a wrong design, i'm now use a wrapper instead
>> ( see my previous post for details ).
> 
> You're stilling going to lose contents.  If dspam fails, the mail
> is dumped, the LDA returns exit code 75, and the MTA will probably
> issue a bounce Email to the sender.

from dovecot-lda man page :

75  A  temporary  failure.  This  is  returned  for  almost all failures. See 
the log file for
   details. (EX_TEMPFAIL)

The mta keep the mail and retry delivery later, which is what I need.

> 
> If you really don't want the recipient to lose Email, you should
> buffer the input into a file, run dspam on it, and if the output
> is not-null, pipe it to dovecot-lda, otherwise pipe the original
> input.

I don't want to deliver email on dspam error, I prefer TEMPFAIL and future 
retries, so I have a chance to fix the issue later without loosing or deliver 
unprocessed mails

> 
> Joseph Tam 


Re: LDA input validation

2015-01-24 Thread Stéphane Cottin

> Le 23 janv. 2015 à 23:52, Joseph Tam  a écrit :
> 
> St?phane Cottin writes:
> 
>> A typical .qmail file :
>> 
>> | /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" | 
>> /usr/bin/preline -f /usr/lib/dovecot/dovecot-lda -d "$EXT@$USER" -a 
>> "$EXT@$USER" -m "$EXT2"
>> 
>> When dspam segfault or is killed, preline receive an empty content and
>> only pass to dovecot-lda two headers ( Return-Path and Delivered-To ).
>> Then dovecot-lda delivers successfully and the original message
>> contents are lost.
> 
> Steffen Kaiser rightly points out:
> 
>> That's the problem of the used Unix pipe and broken by design. The right
>> member of the pipe (preline) runs independendly of dspam and recieves no
>> content via pipe. Why should preline or dovecot-lda believe there is an
>> error? [... and suggests a wrapper script that aborts delivery on empty
>> dspam output.]
> 
> I'm not sure if it's appropriate under your circumstances, but you can also
> pass stderr to stdout as well, and the recipient will get some diagnostic
> message, which may or may not be helpful.
> 
>   | /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" 2>&1 | 
> ...
> 
> Joseph Tam 

dspam already send errors to syslog, the point here is to never loose email 
contents.
This was a wrong design, i'm now use a wrapper instead ( see my previous post 
for details ).

Stéphane


Re: LDA input validation

2015-01-24 Thread Stéphane Cottin
Hello,

> Le 23 janv. 2015 à 16:14, Steffen Kaiser  a 
> écrit :
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On Fri, 23 Jan 2015, Stéphane Cottin wrote:
> 
>> I'm using qmail + dspam + dovecot-lda.
>> 
>> A typical .qmail file :
>> 
>> | /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" | 
>> /usr/bin/preline -f /usr/lib/dovecot/dovecot-lda -d "$EXT@$USER" -a 
>> "$EXT@$USER" -m "$EXT2"
>> 
>> When dspam segfault or is killed, preline receive an empty content and only 
>> pass to dovecot-lda two headers ( Return-Path and Delivered-To ).
> 
> Those two lines are generated by dovecot-lda or preline.

preline

> 
>> Then dovecot-lda delivers successfully and the original message contents are 
>> lost.
>> 
>> Should dovecot-lda returns an error in such conditions ( invalid contents ) 
>> ? Qmail will keep it in the queue and retry delivery later.
> 
> That's the problem of the used Unix pipe and broken by design. The right 
> member of the pipe (preline) runs independendly of dspam and recieves no 
> content via pipe. Why should preline or dovecot-lda believe there is an error?


You're right about my mistake using pipes, but there may be some cases where 
validating input make sense.

Anyway, many thanks for your wrapper, I've improved it to fail safely on dspam 
errors.


#!/bin/sh

tmpf="/var/tmp/wrapper.$$.log"
trap 'rc=$?; rm -f $tmpf; exit $rc' EXIT

/usr/bin/dspam --client --deliver=stdout --user "$1" >$tmpf

if [ $? -eq 0 ] ; then
test -s $tmpf && /usr/bin/preline -f \
/usr/lib/dovecot/dovecot-lda -d "$1" -a "$1" -m "$2" <$tmpf
else
rm -f $tmpf
exit 75
fi


Stéphane

> 
> If preline does not have no nifty option to prevent this, replace the pipe by 
> a shell script:
> 
> | /usr/local/bin/dspam-lda-wrapper.sh "$EXT@$USER" "$EXT2"
> 
> = /usr/local/bin/dspam-lda-wrapper.sh
> #!/bin/bash
> 
> tmpf="/tmp/wrapper.$$.log"
> trap 'rc=$?; rm -f $tmpf; exit $rc' EXIT
> 
> if /usr/bin/dspam --client --deliver=stdout --user "$1" >$tmpf; then
>   test -s $tmpf && /usr/bin/preline -f \
>   /usr/lib/dovecot/dovecot-lda -d "$1" -a "$1" -m "$2" <$tmpf
> fi
> ==
> 
> - -- Steffen Kaiser
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> 
> iQEVAwUBVMJlQnz1H7kL/d9rAQK90Af9Fs+uZ6P0VxQL0r8PpR30hYt1MnExozpz
> QXbhKMCrXv5fZwAZ6paAbQQ999Emjj0fyBEBKodgYoi3rQm5claJwb1/NzSotgxx
> Kayc0WpPP2cPMR1QZBA1FmR6+XPyEQO1h8B6aYxNNVNELCMxzotQ5hBPsqrR8ajO
> 86TL7FYaz6EM5nqW7w/VwwqsPDiM3mlkgckQudMzxeupP/jGZiRAkWODznSRg4Wr
> yHx257i8jWj3mV2vcew16tyBuwmc3g1renPSwjaUZoLsb2A9vyJjnr0qmBdfrkDz
> LE6WICAJcZuxQtyy8naTExEGKyQUhBc0nOLVljZ6ZnVC15b8gHWYRw==
> =WdEr
> -END PGP SIGNATURE-


LDA input validation

2015-01-23 Thread Stéphane Cottin
Hi,

I'm using qmail + dspam + dovecot-lda.

A typical .qmail file :

| /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" | 
/usr/bin/preline -f /usr/lib/dovecot/dovecot-lda -d "$EXT@$USER" -a 
"$EXT@$USER" -m "$EXT2"

When dspam segfault or is killed, preline receive an empty content and only 
pass to dovecot-lda two headers ( Return-Path and Delivered-To ).
Then dovecot-lda delivers successfully and the original message contents are 
lost. 

Should dovecot-lda returns an error in such conditions ( invalid contents ) ? 
Qmail will keep it in the queue and retry delivery later.

Stéphane

[Dovecot] stats error

2014-06-03 Thread Stéphane Cottin
Hello,

Errors still present after upgrading to 2.2.13 :

stats: Error: Mail server input error: UPDATE-SESSION t...@example.com imap: 
stats shrank: mlpath 378 < 379
stats: Error: Mail server input error: UPDATE-SESSION t...@example.com imap: 
stats shrank: mlpath 1 < 2
stats: Error: Mail server input error: UPDATE-SESSION t...@example.com pop3: 
stats shrank: mlpath 4 < 8
stats: Error: Mail server input error: UPDATE-SESSION t...@example.com imap: 
stats shrank: mrbytes 6028260 < 7487934
stats: Error: Mail server input error: UPDATE-SESSION t...@example.com imap: 
stats shrank: mrbytes 11134652 < 13009233
[…]

doveconf -n : 

# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.53-xenU-8869-x86_64 x86_64 Debian 7.4
auth_mechanisms = plain login cram-md5
default_client_limit = 3003
lda_mailbox_autocreate = yes
mail_plugins = " quota stats zlib"
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date ihave duplicate 
vacation-seconds
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  antispam_backend = dspam
  antispam_dspam_args = --source=error;--user;%u;--deliver=
  antispam_dspam_binary = /usr/bin/dspamc
  antispam_dspam_notspam = --class=innocent
  antispam_dspam_result_header = X-DSPAM-Result
  antispam_dspam_spam = --class=spam
  antispam_signature = X-DSPAM-Signature
  antispam_signature_missing = move
  antispam_spam = Junk
  antispam_spam_pattern_ignorecase = Junk;Junk.*
  antispam_trash = trash;Trash;Deleted Items;Deleted Messages
  fts = lucene
  fts_lucene = whitespace_chars=@.
  quota = maildir:User quota
  quota_rule2 = Trash:storage=+100M
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
  sieve_extensions = +vacation-seconds
  sieve_vacation_default_period = 3h
  sieve_vacation_max_period = 30d
  sieve_vacation_min_period = 3m
  stats_refresh = 30 secs
  zlib_save = gz
  zlib_save_level = 9
}
protocols = " imap sieve pop3"
recipient_delimiter = -
service imap-login {
  service_count = 0
  vsz_limit = 256 M
}
service quota-warning {
  executable = script /usr/bin/quota-warning.sh
  unix_listener quota-warning {
user = vpopmail
  }
  user = vpopmail
}
service stats {
  fifo_listener stats-mail {
mode = 0600
user = vpopmail
  }
}
ssl_cert = 

Re: [Dovecot] Mail server input error: UPDATE-SESSION

2014-03-13 Thread Stéphane Cottin
More info, may be related to antispam plugin 

imap(x...@xyz.xyz): Error: Cached message size smaller than expected (4293 < 
8192)
imap(x...@xyz.xyz): Error: Corrupted index cache file 
/xyz/Maildir/.Junk/dovecot.index.cache: Broken physical size for mail UID 0
imap(x...@xyz.xyz): Error: 
read(zlib(/xyz/Maildir/.Junk/tmp/1394709643.M419216P12667.xyz)) failed: Invalid 
argument (uid=0)


Le 12 mars 2014 à 18:51, Stéphane Cottin  a écrit :

> Hello,
> 
> After upgrading to 2.2.12 and adding stats plugin, got a lot of errors like 
> this : 
> stats: Error: Mail server input error: UPDATE-SESSION x...@xyz.xyz imap: 
> stats shrank: mcache 900988905 < 1039472051
> 
> Stéphane
> 
> 
> 
> 


[Dovecot] Mail server input error: UPDATE-SESSION

2014-03-12 Thread Stéphane Cottin
Hello,

After upgrading to 2.2.12 and adding stats plugin, got a lot of errors like 
this : 
stats: Error: Mail server input error: UPDATE-SESSION x...@xyz.xyz imap: stats 
shrank: mcache 900988905 < 1039472051

Stéphane



dovecot.conf
Description: Binary data





Re: [Dovecot] zlib plugin trouble

2010-02-16 Thread Stéphane Cottin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Le 16 févr. 2010 à 16:55, Timo Sirainen a écrit :

> On 16.2.2010, at 17.39, Stéphane Cottin wrote:
> 
>>>> mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): gzread() 
>>>> failed: DATA_ERROR_MAGIC
> 
>> I made a simple script to gzip uncompressed messages and convert bzip2 to 
>> gzip (I can share it if anyone cares), There is no bzip2 compressed files 
>> left.
> 
> The above error message string is coming from bzip2 library.
> 
> % grep DATA_ERROR_MAGIC /usr/lib/libz.so  
> % grep DATA_ERROR_MAGIC /usr/lib/libbz2.so
> Binary file /usr/lib/libbz2.so matches
> 
> So I think you do have some bzip2 compressed files left.

Argh, you're right !

Sorry for the noise and many thanks for your time.
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)

iEYEARECAAYFAkt6wmIACgkQUeIu/wInUezxIQCfZ3rhPwuro1LUCVasi0dI5ZjE
dvcAnA007JVvBjXs9rav1cnLsjfL9jpi
=+VaW
-END PGP SIGNATURE-


Re: [Dovecot] zlib plugin trouble

2010-02-16 Thread Stéphane Cottin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Le 16 févr. 2010 à 16:28, Leonardo Rodrigues a écrit :

> Em 16/02/2010 12:30, Stéphane Cottin escreveu:
>> Hi,
>> 
>> I have error with dovecot 1.2.10 + compress on deliver patch and zlib plugin.
>> 
>> logfile sample:
>> 
>> [...]
>> mail.err: Feb 16 14:22:25 dovecot: IMAP(hid...@domain.com): 
>> zlib_istream.seek() failed: Invalid argument
>> mail.err: Feb 16 14:22:25 dovecot: IMAP(hid...@domain.com): FETCH for 
>> mailbox Meursault UID 101 failed to read message input: Invalid argument
>> mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): gzread() failed: 
>> DATA_ERROR_MAGIC
>> mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): 
>> zlib_istream.seek() failed: Invalid argument
>> mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): FETCH for 
>> mailbox Meursault UID 101 failed to read message input: Invalid argument
>> mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): gzread() failed: 
>> DATA_ERROR_MAGIC
>> [...]
>>   
> 
>i have already reported some similar errors when messages are compressed 
> with bzip. I couldnt reproduce with gzip, which you appears to be using:
> 
> zlib_save: gz
> 
>do you used some script for compressing your existing messages, those who 
> were delivered before you getting LDA to do that automatically ? If yes, is 
> there any chance that you used bzip2 instead of gzip on that script ?
> 

I was testing bzip2, but as timo said, it's broken in 1.2.

I made a simple script to gzip uncompressed messages and convert bzip2 to gzip 
(I can share it if anyone cares), There is no bzip2 compressed files left.

I will activate mail_debug to get more details and be certain the bug occurs 
with a good gzipped file.


> 
> 
> 
> -- 
> 
> 
>   Atenciosamente / Sincerily,
>   Leonardo Rodrigues
>   Solutti Tecnologia
>   http://www.solutti.com.br
> 
>   Minha armadilha de SPAM, NÃO mandem email
>   gertru...@solutti.com.br
>   My SPAMTRAP, do not email it
> 
> 
> 
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)

iEYEARECAAYFAkt6vCMACgkQUeIu/wInUezHBACfV2VM2Nwcolj0LMOQjmq5NqgL
GCIAniRICtoOHuIfCj2uJ++/cgxqpqQK
=LQGB
-END PGP SIGNATURE-


Re: [Dovecot] zlib plugin trouble

2010-02-16 Thread Stéphane Cottin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Le 16 févr. 2010 à 16:27, Timo Sirainen a écrit :

> On Tue, 2010-02-16 at 15:30 +0100, Stéphane Cottin wrote:
>> Hi,
>> 
>> I have error with dovecot 1.2.10 + compress on deliver patch and zlib plugin.
>> 
>> logfile sample:
>> 
>> [...]
>> mail.err: Feb 16 14:22:25 dovecot: IMAP(hid...@domain.com): 
>> zlib_istream.seek() failed: Invalid argument
>> mail.err: Feb 16 14:22:25 dovecot: IMAP(hid...@domain.com): FETCH for 
>> mailbox Meursault UID 101 failed to read message input: Invalid argument
>> mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): gzread() failed: 
>> DATA_ERROR_MAGIC
> 
> Yeah, bzip2 code is broken in v1.2. I fixed it in v2.0 by basically
> rewriting the whole thing. Maybe I should just disable bzip2 support in
> v1.2.
> 

I've first tried bzip2 but these are errors with gzip.
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)

iEYEARECAAYFAkt6uswACgkQUeIu/wInUewfbgCffU7QKSaZ/cirfmuJZdCTi8Vx
QMAAn0X+oKT/Kp0nwEwAdHbm3Wb+z8B3
=3/7y
-END PGP SIGNATURE-


[Dovecot] zlib plugin trouble

2010-02-16 Thread Stéphane Cottin
Hi,

I have error with dovecot 1.2.10 + compress on deliver patch and zlib plugin.

logfile sample:

[...]
mail.err: Feb 16 14:22:25 dovecot: IMAP(hid...@domain.com): zlib_istream.seek() 
failed: Invalid argument
mail.err: Feb 16 14:22:25 dovecot: IMAP(hid...@domain.com): FETCH for mailbox 
Meursault UID 101 failed to read message input: Invalid argument
mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): gzread() failed: 
DATA_ERROR_MAGIC
mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): zlib_istream.seek() 
failed: Invalid argument
mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): FETCH for mailbox 
Meursault UID 101 failed to read message input: Invalid argument
mail.err: Feb 16 14:22:26 dovecot: IMAP(hid...@domain.com): gzread() failed: 
DATA_ERROR_MAGIC
[...]
mail.err: Feb 16 14:36:24 dovecot: IMAP(hidd...@domain.com): gzread() failed: 
UNEXPECTED_EOF
mail.err: Feb 16 14:36:24 dovecot: IMAP(hidd...@domain.com): FETCH for mailbox 
Sent.MARKETING.DAG ALLEMAAL UID 1 failed to read message input: Invalid argument
mail.err: Feb 16 14:59:18 dovecot: IMAP(hidd...@domain.com): gzread() failed: 
UNEXPECTED_EOF
[...]
mail.info: Feb 16 14:08:35 dovecot: IMAP(hidd...@domain.com): Disconnected: 
BUG: Unknown internal error bytes=1099335/4103
mail.info: Feb 16 14:16:40 dovecot: IMAP(hid...@domain.com): Disconnected: BUG: 
Unknown internal error bytes=15193/2552616
mail.info: Feb 16 14:16:41 dovecot: IMAP(hid...@domain.com): Disconnected: BUG: 
Unknown internal error bytes=295/6715
mail.info: Feb 16 14:16:41 dovecot: IMAP(hid...@domain.com): Disconnected: BUG: 
Unknown internal error bytes=295/6715
mail.info: Feb 16 14:16:42 dovecot: IMAP(hid...@domain.com): Disconnected: BUG: 
Unknown internal error bytes=295/6715
mail.info: Feb 16 14:16:42 dovecot: IMAP(hid...@domain.com): Disconnected: BUG: 
Unknown internal error bytes=295/6715
[...]


dovecot -n  :

# 1.2.10: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-6-xen-vserver-amd64 x86_64 Debian 5.0.4 
log_timestamp: %Y-%m-%d %H:%M:%S 
protocols: imap imaps pop3 pop3s managesieve
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
login_greeting: Dovecot ready.
login_process_per_connection: no
mail_max_userip_connections(default): 30
mail_max_userip_connections(imap): 30
mail_max_userip_connections(pop3): 10
mail_max_userip_connections(managesieve): 10
mail_privileged_group: mail
maildir_copy_preserve_filename: yes
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugins(default): zlib antispam quota imap_quota fts fts_squat
mail_plugins(imap): zlib antispam quota imap_quota fts fts_squat
mail_plugins(pop3): zlib quota
mail_plugins(managesieve): 
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
lda:
  postmaster_address: hid...@noc.com
  mail_plugins: autocreate quota sieve fts fts_squat zlib
  quota_full_tempfail: yes
  sieve_global_dir: /etc/dovecot/sieve/
auth default:
  mechanisms: plain login cram-md5
  cache_size: 1024
  passdb:
driver: vpopmail
  userdb:
driver: vpopmail
  socket:
type: listen
master:
  path: /var/run/dovecot/auth-master
  mode: 438
  group: vchkpw
plugin:
  quota: maildir:User quota
  quota_rule: Trash:ignore
  quota_rule2: Junk:ignore
  quota_rule3: &AMk-l&AOk-ments supprim&AOk-s:ignore
  quota_rule4: Deleted Items:ignore
  quota_rule5: Deleted Messages:ignore
  quota_warning: storage=95%% /usr/local/bin/quota-warning.sh 95
  quota_warning2: storage=80%% /usr/local/bin/quota-warning.sh 80
  antispam_signature: X-DSPAM-Signature
  antispam_signature_missing: error
  antispam_trash: trash;Trash;Deleted Items;Deleted Messages;&AMk-l&AOk-ments 
supprim&AOk-s
  antispam_spam: Junk
  antispam_dspam_args: --mode=teft;;--user;%u
  fts: squat
  fts_squat: partial=4 full=10
  sieve: ~/.dovecot.sieve
  sieve_storage: ~/sieve
  zlib_save_level: 9
  zlib_save: gz




PGP.sig
Description: Ceci est une signature électronique PGP


[Dovecot] lda deliver + vpopmail

2009-11-18 Thread Stéphane Cottin
Hi all,

I'm enjoying using dovecot deliver with qmail+vpopmail+dspam.
It works mostly fine, I like the indexing and sieve features with dovecot 
deliver.

I would like to get more details on trouble, the log entry is just :

"
2009-11-18_20:38:55.64778 delivery 50833: deferral:
"

As you see, there no reason for the deferral. How can I make deliver more 
verbose ?

I also have a vpopmail alias issue.
Because some domains (sadly) needs a catchall, and to keep using the useful 
vpopmail alias features, I'm using the following ugly script :

"
#!/bin/sh
email=`/usr/sbin/valias -- $1 2>/dev/null | cut -d" " -f3`
if [ -z "$email" ];then
email=$1
t=`/usr/sbin/vuserinfo -n -- $1 2>&1>/dev/null`
t=$?
if [ "$t" == "255" ];then
domain=`echo "${1}" | cut -d'@' -f 2`
dir=`/usr/sbin/vdominfo -d $domain 2> /dev/null| head -1`
email=`cat ${dir}/.qmail-default | head -1 | awk -F# '{ print 
$2 }'`
if [ "$email" == "bounce-no-mailbox" ];then
email=$1
fi
fi
fi
echo $email
"


my .qmail-default file contains  :

"
#bounce-no-mailbox
| /usr/bin/dspam --client --deliver=innocent,spam --user `/usr/sbin/vrealemails 
$...@$user` --stdout | /usr/bin/preline -f /usr/lib/dovecot/deliver -d 
`/usr/sbin/vrealemails $...@$user`
"

or if using a catchall :

"
#catch...@domain.com
| /usr/bin/dspam --client --deliver=innocent,spam --user `/usr/sbin/vrealemails 
$...@$user` --stdout | /usr/bin/preline -f /usr/lib/dovecot/deliver -d 
`/usr/sbin/vrealemails $...@$user`
"

I don't like this way for design and security reasons and would prefer a more 
consistent approach. The vpopmail alias lookup should be made internally by 
deliver, and unlike my script, handle one to many aliasing.

The catchall feature is (sadly) also needed, my implementation is ugly, in 
practice it works, but is limited as the catchall address must be on the same 
host.
I'm thinking about adding a specific option to the deliver command line, but 
I'm not sure that's the better way to do it.

Help needed please

Stéphane




Re: [Dovecot] sieve vacation messages trouble

2009-06-30 Thread Stéphane Cottin


Le 30 juin 09 à 16:26, Steffen Kaiser a écrit :


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 30 Jun 2009, Stéphane Cottin wrote:

sieve vacation replies are rejected by gmail with a "555 5.5.2  
Syntax error".


This looks like a SMTP error. What does your local SMTP server logs?
Sieve uses the local "sendmail" binary to transmit the message.

The return path is set to "<>", I think this is why this error is  
triggered by gmail.


Hmm, you mean gmail as in Google Mail server?
If so, I doubt it. <> is the RFC null sender for DSNs to prevent  
mail looping. However, many MTAs block DSNs to non-local recipients  
right away.


Anyway, <> should not cause a syntax error.


In my case it was <"<>"@hostname.domainname>

Fixed in qmail-inject, ask me in private for the hack if interested as  
it's a bit off-topic.


Bye



Bye,

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

iQEVAwUBSkogsnWSIuGy1ktrAQI1qggApvFU8SteLSa9Vln2iYo6FfrvjVQTRZup
okUXP+FiWOyTBpCgR695bcB0+kq4Q5BHXtelXek6O5+mkcdZGrXX64gP4LseBZEa
N+rwRzFIME0JrfX+04O4zgIPA2ZsRJhDO/5TWSZJNVpLnu6KPBDBG3x+RBQqIgR0
ldawLYz/7AYgWbLXUocyFmJLPBwE+5SYr8lu03dm2gPHtkcJxCUeH685R4vaCzEb
Nqi3wCwM0AxlTUon5yy1YawZGMoG86fDOUFrqqesEfstQcTlK1eRkHmce2cnb8a9
nA0dLTJm9dS0zG80W0upGAgnYp8qk6GnLgUwDbOL4rqtpOmN4KZhqw==
=N2u3
-END PGP SIGNATURE-




Re: [Dovecot] sieve vacation messages trouble

2009-06-30 Thread Stéphane Cottin
After looking at the source, I saw that the return path is not set by  
dovecot.

Seems to be a qmail related issue, sorry for the noise.

Le 30 juin 09 à 16:06, Stéphane Cottin a écrit :


Hi,

sieve vacation replies are rejected by gmail with a "555 5.5.2  
Syntax error".
The return path is set to "<>", I think this is why this error is  
triggered by gmail.

The rest of the vacation message seems ok.

I'm using dovecot 1.1.11 (waiting for final 1.2 to upgrade) ,  
delivering with "/usr/lib/dovecot/deliver -d em...@domain"


Stéphane Cottin





[Dovecot] sieve vacation messages trouble

2009-06-30 Thread Stéphane Cottin

Hi,

sieve vacation replies are rejected by gmail with a "555 5.5.2 Syntax  
error".
The return path is set to "<>", I think this is why this error is  
triggered by gmail.

The rest of the vacation message seems ok.

I'm using dovecot 1.1.11 (waiting for final 1.2 to upgrade) ,  
delivering with "/usr/lib/dovecot/deliver -d em...@domain"


Stéphane Cottin



[Dovecot] dovecot 1.1.11 errors

2009-02-27 Thread Stéphane Cottin

Hi,

I sometimes got the following log entries with dovecot 1.1.11 :


mail.err: Feb 27 10:06:54 dovecot: IMAP(hid...@email.com):  
write(dnotify pipe) failed: Bad file descriptor
mail.err: Feb 27 10:06:54 dovecot: IMAP(hid...@email.com):  
close(dnotify pipe[0]) failed: Bad file descriptor
mail.err: Feb 27 10:06:54 dovecot: IMAP(hid...@email.com):  
close(dnotify pipe[1]) failed: Bad file descriptor

[...]
mail.err: Feb 27 10:17:55 dovecot: child 18656 (imap) returned error  
82 (Internal logging error)


any thougths ?

Stéphane Cottin

[Dovecot] lda catchall

2009-02-23 Thread Stéphane Cottin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I'm using dovecot lda in a qmail / vpopmail testing environnement.

I would like to replace vpopmail lda with dovecot's one , because of
quotas , sieve filers, indexing while delivering ...

Everything is working great, except the catchall.

If I want to bounce, a first line like "# bounce-no-mailbox" in the
.qmail file works, without this line, emails to unknown addresses are
deferred and stay in the queue, because they are deliverable for qmail,
but not for dovecot lda.

How can I set a catchall email address for dovecot lda ?


thx

Stéphane Cottin

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmixCcACgkQNgQUYqHIqqvttQCfcNBLd9Qo06g5nMcrfZAwVlpv
WegAnj7jIA/XFJWmt/2jkg1sxRYKRaI7
=JTTV
-END PGP SIGNATURE-
begin:vcard
fn;quoted-printable:St=C3=A9phane Cottin
n;quoted-printable:Cottin;St=C3=A9phane
org:VIXNS
adr:;;172 avenue de toulon;Marseille;;13010;France
email;internet:stephane.cot...@vixns.com
x-mozilla-html:FALSE
url:http://www.vixns.com
version:2.1
end:vcard



Re: [Dovecot] over quota + antispam crash

2009-02-20 Thread Stéphane Cottin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Johannes Berg a écrit :
> Thanks for the patch, can you check whether it works with just the if
> (dest_mail)?
> 

It doesn't work

the "return -1" is inspired from the end of quota_save_init function (in
src/plugins/quota/quota-storage.c)

the if(dest_mail) is not in quota_save_init.
it may be unnecessary.

Stéphane

> johannes

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkme5AcACgkQNgQUYqHIqqs7vACgjNp27Pf+Hc+9v2GK0NKRXyKC
BjUAn0MApH6xBjw+FHCOCT693rhGYduT
=kAgf
-END PGP SIGNATURE-
begin:vcard
fn;quoted-printable:St=C3=A9phane Cottin
n;quoted-printable:Cottin;St=C3=A9phane
org:VIXNS
adr:;;172 avenue de toulon;Marseille;;13010;France
email;internet:stephane.cot...@vixns.com
x-mozilla-html:FALSE
url:http://www.vixns.com
version:2.1
end:vcard



Re: [Dovecot] over quota + antispam crash

2009-02-19 Thread Stéphane Cottin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Stéphane Cottin a écrit :
> Hi,
>
> I am using dovecot 1.1.11 , quota, imap_quota & antispam plugins.
>
> Dovecot crashes when saving a message to the Sent maildir and the
> account is over quota.
>
> gdb trace attached.
>
>
> Stéphane Cottin


Hi,

The attached patch seems to fix my bug.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmdSSUACgkQNgQUYqHIqqt+WgCeOfxt3CiMVs4cQLYVHFl932pM
H1gAni6WIB3V+qUr/hwScxMSWVjAvq1s
=2zbd
-END PGP SIGNATURE-
diff --git a/antispam-storage-1.1.c b/antispam-storage-1.1.c
index 348ae9d..bc370ad 100644
--- a/antispam-storage-1.1.c
+++ b/antispam-storage-1.1.c
@@ -167,7 +167,11 @@ static int antispam_save_init(struct mailbox_transaction_context *t,
 		timezone_offset, from_envelope,
 		input, dest_mail, ctx_r);
 
-	(*ctx_r)->dest_mail = dest_mail;
+	if(ret < 0)
+		return -1;
+
+	if (dest_mail != NULL)
+		(*ctx_r)->dest_mail = dest_mail;
 
 	return ret;
 }

begin:vcard
fn;quoted-printable:St=C3=A9phane Cottin
n;quoted-printable:Cottin;St=C3=A9phane
org:VIXNS
adr:;;172 avenue de toulon;Marseille;;13010;France
email;internet:stephane.cot...@vixns.com
x-mozilla-html:FALSE
url:http://www.vixns.com
version:2.1
end:vcard



[Dovecot] over quota + antispam crash

2009-02-18 Thread Stéphane Cottin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I am using dovecot 1.1.11 , quota, imap_quota & antispam plugins.

Dovecot crashes when saving a message to the Sent maildir and the
account is over quota.

gdb trace attached.


Stéphane Cottin
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmcQ1IACgkQNgQUYqHIqqsHYgCfdhLHt1KRQeoEOC5ddgFbD2mh
8UMAoIgXbD3ACqcKcftxUHeoPsgByp83
=V6Ch
-END PGP SIGNATURE-
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...Using host libthread_db library 
"/lib/libthread_db.so.1".

Attaching to program: /usr/lib/dovecot/imap, process 8619
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib/dovecot/modules/imap/lib10_quota_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/imap/lib10_quota_plugin.so
Reading symbols from 
/usr/lib/dovecot/modules/imap/lib11_imap_quota_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/imap/lib11_imap_quota_plugin.so
Reading symbols from 
/usr/lib/dovecot/modules/imap/lib90_antispam_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/imap/lib90_antispam_plugin.so
0x2af01c9af9ac in epoll_wait () from /lib/libc.so.6
(gdb) SignalStopPrint   Pass to program Description
SIGPIPE   NoYes Yes Broken pipe
(gdb) SignalStopPrint   Pass to program Description
SIGALRM   NoNo  Yes Alarm clock
(gdb) SignalStopPrint   Pass to program Description
SIG32 NoYes Yes Real-time event 32
(gdb) Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x2af01cd36a63 in antispam_save_init (t=0x5fe0c0, flags=MAIL_SEEN, 
keywords=0x0, received_date=-1, timezone_offset=0, from_envelope=0x0, 
input=0x601390, dest_mail=0x6014f8, ctx_r=0x5d92f0)
at antispam-storage-1.1.c:170
170 (*ctx_r)->dest_mail = dest_mail;
(gdb) #0  0x2af01cd36a63 in antispam_save_init (t=0x5fe0c0, 
flags=MAIL_SEEN, 
keywords=0x0, received_date=-1, timezone_offset=0, from_envelope=0x0, 
input=0x601390, dest_mail=0x6014f8, ctx_r=0x5d92f0)
at antispam-storage-1.1.c:170
ast = (struct antispam_internal_context *) 0x5fea60
asbox = (struct antispam_mailbox *) 0x5dff20
ret = -1
#1  0x00457ce5 in mailbox_save_init (t=0x605cfa, flags=481489778, 
keywords=0x0, received_date=0, timezone_offset=1818845549, 
from_envelope=0x7265737520726f66 , input=0x601390, dest_mail=0x0, ctx_r=0x5d92f0) at mail-storage.c:728
No locals.
#2  0x00416289 in cmd_append_continue_parsing (cmd=0x5d9238)
at cmd-append.c:330
uid2 = 
msg = 
sync_flags = 
imap_flags = 
uid_validity = 
uid1 = 
client = (struct client *) 0x5d8ec0
ctx = (struct cmd_append_context *) 0x5d92b0
args = (const struct imap_arg *) 0x5febb0
flags_list = 
flags = MAIL_SEEN
keywords_list = (const char * const *) 0x0
keywords = (struct mail_keywords *) 0x0
internal_date_str = 0x0
internal_date = -1
ret = 
timezone_offset = 0
nonsync = true
__PRETTY_FUNCTION__ = "cmd_append_continue_parsing"
#3  0x00416492 in cmd_append (cmd=0x5d9238) at cmd-append.c:502
storage = (struct mail_storage *) 0x5d87e8
box = 
client = (struct client *) 0x5d8ec0
ctx = (struct cmd_append_context *) 0x5d92b0
mailbox = 0x5dd410 "Sent"
#4  0x0041b45c in client_command_input (cmd=0x5d9238) at client.c:580
client = (struct client *) 0x5d8ec0
command = 
__PRETTY_FUNCTION__ = "client_command_input"
#5  0x0041b512 in client_command_input (cmd=0x5d9238) at client.c:629
client = (struct client *) 0x5d8ec0
command = (struct command *) 0x0
__PRETTY_FUNCTION__ = "client_command_input"
#6  0x0041bccf in client_handle_input (client=0x5d8ec0)
at client.c:670
_data_stack_cur_id = 3
ret = 
remove_io = 
handled_commands = false
#7  0x0041bef3 in client_input (client=0x5d8ec0) at client.c:725
cmd = 
output = (struct ostream *) 0x5d9158
bytes = 488
__P