[Dovecot] doveadm-lda - segfault

2012-12-11 Thread Kamil Jońca

I have simple old message: 
--8---cut here---start-8---
X-Mozilla-Status: 0011
X-Mozilla-Status2: 
Date: Wed, 26 Jan 2000 13:38:41 +0100
From: Kamil Jonca kjonca@localhost.localdomain
To: Somebody X  x...@tiger.com.pl
Subject: Re: Opisy 
Message-ID: 2126133839.B2888@localhost.localdomain
References: pine.lnx.4.05.10001261335010.19250-100...@aa.bbb.ccc
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 8bit
X-Mailer: Mutt 0.95.5us
In-Reply-To: pine.lnx.4.05.10001261335010.19250-100...@xxx.yyy.cc; from 
Somebody X on Wed, Jan 26, 2000 at 01:37:52PM +
X-Operating-System: 'Linux localhost.localdomain 2.2.9-27mdk #1 Mon Jan 24 
15:49:34 CET 2000 i686 unknown'
X-Geek: GIT d s+:- a-- C++ UL P+ L++ E W N+ w- PS+ PE++ PGP t-- X-- R- tv- b+ 
D+ G e h-- r- z?
Lines: 30
X-KJONCA-Clamav-Status: No

jd;fladflsd;lc
dfgn;sdhgfad
abffhahgl
fadn;al
sdfnad;hfa
fna;lhfla
-- 
shfkah
--8---cut here---end---8---
 When I try to 

dovecot-lda  message.txt

(for sieve refiltering) I got segmentation fault.
Does it is bug in lda, or message does not keep standards?
KJ

-- 
http://modnebzdury.wordpress.com/2009/10/01/niewiarygodny-list-prof-majewskiej-wprowadzenie/
Sanity and insanity overlap a fine grey line.



Re: [Dovecot] Switch from MySQL/CourierMail to MySQL/Dovecot

2012-12-11 Thread Ricardo
2012/12/7 Robert Moskowitz r...@htt-consult.com:
 Hello, new here.

 I am a Centos/Fedora user, and for the past 3 years have been running my
 mail server using Postfix/MySQL/CourierMail/Squirrelmail on Fedora.  The
 current incantation of the tutorial is at:

 http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-centos-6.2-x86_64

 Well it is time to rebuild my mailserver; this time on Centos 6.3. My goal
 is to use supplied rpms, not to build my own (and rebuild everytime there is
 an important update).  So I am pulling quotas which has been a pain anyway,
 and I am investigating using Dovecot in place of CourierMail.  In Centos
 6.3, the version of Dovecot is: 2.0.9-2

 I am looking for a tutorial to assist in the setup, as I am nowhere an
 expert on any of this (I am a communications security expert in the IETF and
 IEEE 802).  There are a couple items that I have come to depend on in my
 current setup that are musts in anything new:

 Virtual user/domain

 That is, not only virtual domains, but also users defined by domain.  So in
 the MySQL user table, the email value is set to user@domain.  Thus a user
 can receive/send mail from multiple domains with the same addr and only
 those domains defined for the user in the user table.

 Obviously there is no coupling of Linux user accounts and email accounts.
 CourierMail is storing mail under /home/vmail/domain/user/...

 Encrypted passwords

 The passwords in the user table in MySQL are encrypted.  This will be used
 to auth the user for POPing or IMAPing and sending their mail.  I have
 encountered a few tutorials where it seems like passwords are stored in the
 clear?

 Anyway, not much else!  Well as far as the user interface is concerned.
 Postfix with clamav and spamassassin and maybe one or two extras.  And
 SquirrelMail for Webmail.  A better gui than phpMyAdmin for maintaining the
 tables would be nice, but I don't have a lot of users, so it works well
 enough.

 Can someone point me to a tutorial best suited to my needs?

 Also any firewall rules, as I don't want to turn off iptables (and
 ip6tables) and any SELinux policy rules to add.

 Oh, and IPv6 will be a must in the near future, so anything needed to ensure
 IPv6 working right as well.

 Thanks



Hola  a todos

disculpen por mi idioma español..

aqui eh llegado hacer andar mi servidor de correo,  aquí te paso un
link que esta muy bien explicado aver si te sirve


http://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/

con postfixadmin anduvo bárbaro. solo lo probé un rato, no lo tengo en
producción. si te animas a configurar y si te anduvo avísanos por aquí
o si te falta algo te paso mi archivo.conf


saludos

Ricardo


Re: [Dovecot] Switch from MySQL/CourierMail to MySQL/Dovecot

2012-12-11 Thread Robert Moskowitz


On 12/11/2012 08:25 AM, Ricardo wrote:

2012/12/7 Robert Moskowitz r...@htt-consult.com:

Hello, new here.

I am a Centos/Fedora user, and for the past 3 years have been running my
mail server using Postfix/MySQL/CourierMail/Squirrelmail on Fedora.  The
current incantation of the tutorial is at:

http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-centos-6.2-x86_64

Well it is time to rebuild my mailserver; this time on Centos 6.3. My goal
is to use supplied rpms, not to build my own (and rebuild everytime there is
an important update).  So I am pulling quotas which has been a pain anyway,
and I am investigating using Dovecot in place of CourierMail.  In Centos
6.3, the version of Dovecot is: 2.0.9-2

I am looking for a tutorial to assist in the setup, as I am nowhere an
expert on any of this (I am a communications security expert in the IETF and
IEEE 802).  There are a couple items that I have come to depend on in my
current setup that are musts in anything new:

Virtual user/domain

That is, not only virtual domains, but also users defined by domain.  So in
the MySQL user table, the email value is set to user@domain.  Thus a user
can receive/send mail from multiple domains with the same addr and only
those domains defined for the user in the user table.

Obviously there is no coupling of Linux user accounts and email accounts.
CourierMail is storing mail under /home/vmail/domain/user/...

Encrypted passwords

The passwords in the user table in MySQL are encrypted.  This will be used
to auth the user for POPing or IMAPing and sending their mail.  I have
encountered a few tutorials where it seems like passwords are stored in the
clear?

Anyway, not much else!  Well as far as the user interface is concerned.
Postfix with clamav and spamassassin and maybe one or two extras.  And
SquirrelMail for Webmail.  A better gui than phpMyAdmin for maintaining the
tables would be nice, but I don't have a lot of users, so it works well
enough.

Can someone point me to a tutorial best suited to my needs?

Also any firewall rules, as I don't want to turn off iptables (and
ip6tables) and any SELinux policy rules to add.

Oh, and IPv6 will be a must in the near future, so anything needed to ensure
IPv6 working right as well.

Thanks



Hola  a todos

disculpen por mi idioma español..


Sorry, I am dyslexic and basically flunked High School Spanish some 45 
years ago...


(they really did not know what dyslexia was back then)

Really wish I COULD understand what you wrote.



aqui eh llegado hacer andar mi servidor de correo,  aquí te paso un
link que esta muy bien explicado aver si te sirve


http://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/


Someone else (in another conversation) sent me this link last night.  I 
am reading it and figuring out how to apply it to Centos.


I ASSuME that you are pointing me to this link as a tutorial  :)  !!



con postfixadmin anduvo bárbaro. solo lo probé un rato, no lo tengo en
producción. si te animas a configurar y si te anduvo avísanos por aquí
o si te falta algo te paso mi archivo.conf


saludos

Ricardo





Re: [Dovecot] Automatically Cleaning Kerberos Credential Cache Files

2012-12-11 Thread Ben Morrow
At  7PM -0500 on 10/12/12 you (Maura Dailey) wrote:
 On 12/10/2012 05:31 PM, Ben Morrow wrote:
  At  3PM -0500 on 10/12/12 you (Maura Dailey) wrote:
  I'm in a situation here at work where I'm trying to support a mixed
  network of OS X and RHEL desktop machines with a Postfix/Dovecot
  combination.
  - user account information is stored in LDAP
  - user credentials are in MIT Kerberos
  - server is running RHEL 6/Dovecot 2.0.9/Postfix 2.6.6
 
  I am currently using the PAM passdb module to authenticate my users (I
  began to have trouble with using GSSAPI directly). After I implemented
  it, a few weeks later, I noticed that some users were no longer getting
  their mail if they hadn't logged in during the past day. Postfix's mailq
  showed that hundreds of messages were backing up in the queue. I
  eventually tracked it down to leftover Kerberos credential cache files
  (/tmp/krb5cc_) sitting in /tmp on the mail server. The presence of
  expired credential files was preventing Postfix from delivering mail to
  those users' mail spools. If I delete the credential files manually,
  Postfix immediately delivers the queued emails.
  This is rather odd. Is krb5-authenticated NFS involved here, or does
  Postfix's delivery make any other use of Kerberos? The only other thing
  I can think of is that so many expired ccaches are accumulating that the
  user goes over their inode quota.
 
 Each user has one credential cache file in /tmp on the mail server after 
 logging into Dovecot. We aren't using randomized names, so everything is 
 in the standard format /tmp/krb5cc_uid. We do use KRB5 authenticated 
 (and encrypted) NFS, but we don't deliver mail to home directories. 
 Since all users are real users, and our office size is small, everyone 
 has a mail spool directory on the mail server.

Hmm. I don't have much experience with KrbNFS, and none at all on Linux,
but the implementations I've seen seem to be terribly flaky about
passing krb5 creds to the kernel. (What they ought to do is implement
AFS' aklog and setpag; they're irritating, but at least they're
well-understood...)

In any case, it's likely that the delivery process looks in the user's
home directory even if delivery is to a separate mail spool, unless
you've taken steps to prevent this. For instance, Postfix's local(8)
checks for ~/.forward by default, LDAs like procmail or maildrop look
for similar per-user RC files, and Dovecot's LDA looks for (at least)
~/.dovecot.sieve. Is it possible that the NFS code returns a different
error for 'no ccache present' vs 'ccache present but the creds have
expired', such that Postfix will carry on delvering if it gets the first
error but not the second?

snip
  Well, I don't use RH (I use FreeBSD), but I use and would recommend Russ
  Allbery's pam_krb5.so, which may or may not be the same as the normal
  pam_krb5.so provided by your system. It has options to control whether
  and where ccaches are created; assuming Dovecot doesn't need krb5 creds
  (say, for NFS), you would probably be better off telling it not to
  create a permanent ccache at all.
 
  http://www.eyrie.org/~eagle/software/pam-krb5/
 I haven't had to configure pam_krb5.so directly before (we use the Red 
 Hat/Fedora configured default, pam_sss.so, which claims to be a one stop 
 shop for LDAP/Kerberos/NIS,etc.), but it does seem to have more options. 
 We certainly don't need credential caches to stick around for email 
 users. All the mail spools are stored on locally mounted storage on the 
 mail server.

Where do users' private IMAP folders live? Are they in the mail spool as
well, or are they in the user's home directory? Once a user has logged
in Dovecot will change directory to their home directory (as returned by
the userdb), so you may find you *do* need ccaches if they are on KrbNFS.

  This certainly does all sound related. What are the ccache files called:
  are they just /tmp/krb5cc_UID or is there a random portion as well? Are
  they being created with the correct permissions, and are there any
  security policies (SELinux or ACLs of some kind) set up which might
  interfere with their creation or destruction?
 No random portion (the only application we have configured with random 
 ccache names is SSH), just the usual /tmp/krb5cc_uid.

(I assume you're aware of the potential DoS here, given that /tmp is
world-writable and sticky? I'm not sure if there's anything you can do
about it if you're using KrbNFS, though.)

 Permissions appear 
 correct, they belong to the appropriate user and group accounts. The 
 SELinux permissions are set to: system_u:object_r:user_tmp_t:s0. This is 
 different from the machine's credential cache 
 (system_u:object_r:gssd_tmp_t:s0), but I've disabled and re-enabled 
 SELinux during different parts of my testing and didn't notice any errors.

I know nothing whatever about SELinux, but this might be relevant. gssd
handles client-side credentials for NFS, so if it ends up unable to

Re: [Dovecot] Switch from MySQL/CourierMail to MySQL/Dovecot

2012-12-11 Thread Ricardo
2012/12/11 Robert Moskowitz r...@htt-consult.com:

 On 12/11/2012 08:25 AM, Ricardo wrote:

 2012/12/7 Robert Moskowitz r...@htt-consult.com:

 Hello, new here.

 I am a Centos/Fedora user, and for the past 3 years have been running my
 mail server using Postfix/MySQL/CourierMail/Squirrelmail on Fedora.  The
 current incantation of the tutorial is at:


 http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-centos-6.2-x86_64

 Well it is time to rebuild my mailserver; this time on Centos 6.3. My
 goal
 is to use supplied rpms, not to build my own (and rebuild everytime there
 is
 an important update).  So I am pulling quotas which has been a pain
 anyway,
 and I am investigating using Dovecot in place of CourierMail.  In Centos
 6.3, the version of Dovecot is: 2.0.9-2

 I am looking for a tutorial to assist in the setup, as I am nowhere an
 expert on any of this (I am a communications security expert in the IETF
 and
 IEEE 802).  There are a couple items that I have come to depend on in my
 current setup that are musts in anything new:

 Virtual user/domain

 That is, not only virtual domains, but also users defined by domain.  So
 in
 the MySQL user table, the email value is set to user@domain.  Thus a user
 can receive/send mail from multiple domains with the same addr and only
 those domains defined for the user in the user table.

 Obviously there is no coupling of Linux user accounts and email accounts.
 CourierMail is storing mail under /home/vmail/domain/user/...

 Encrypted passwords

 The passwords in the user table in MySQL are encrypted.  This will be
 used
 to auth the user for POPing or IMAPing and sending their mail.  I have
 encountered a few tutorials where it seems like passwords are stored in
 the
 clear?

 Anyway, not much else!  Well as far as the user interface is concerned.
 Postfix with clamav and spamassassin and maybe one or two extras.  And
 SquirrelMail for Webmail.  A better gui than phpMyAdmin for maintaining
 the
 tables would be nice, but I don't have a lot of users, so it works well
 enough.

 Can someone point me to a tutorial best suited to my needs?

 Also any firewall rules, as I don't want to turn off iptables (and
 ip6tables) and any SELinux policy rules to add.

 Oh, and IPv6 will be a must in the near future, so anything needed to
 ensure
 IPv6 working right as well.

 Thanks


 Hola  a todos

 disculpen por mi idioma español..


 Sorry, I am dyslexic and basically flunked High School Spanish some 45 years
 ago...

 (they really did not know what dyslexia was back then)

 Really wish I COULD understand what you wrote.



 aqui eh llegado hacer andar mi servidor de correo,  aquí te paso un
 link que esta muy bien explicado aver si te sirve



 http://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/


 Someone else (in another conversation) sent me this link last night.  I am
 reading it and figuring out how to apply it to Centos.

 I ASSuME that you are pointing me to this link as a tutorial  :)  !!



 con postfixadmin anduvo bárbaro. solo lo probé un rato, no lo tengo en
 producción. si te animas a configurar y si te anduvo avísanos por aquí
 o si te falta algo te paso mi archivo.conf


 saludos

 Ricardo



Hello

My English language can be bad by translate Google know how to apologize.

If you pass as a tutorial but some things will not go well so I had to
change. I lacking of webmail, was thinking do with Rouncube, me quede
alli without installing. I encourage you to improve this tutotial to
it or update it, you decide to contribute with something?

I tried them on Ubuntu server 12.04 x 32 works perfect... I miss the
DNS and MX not is how to configure that part you have any idea how to
configure?

And also install Debian 6.06 ne but the dovecot dovecot-mysql - core
dovecot-pop3d imapd not installed by dependency problems...

If you arrive to run well you can share your settings!

Best regards

Ricardo


Re: [Dovecot] Automatically Cleaning Kerberos Credential Cache Files

2012-12-11 Thread Maura Dailey

On 12/11/2012 08:52 AM, Ben Morrow wrote:

At  7PM -0500 on 10/12/12 you (Maura Dailey) wrote:

On 12/10/2012 05:31 PM, Ben Morrow wrote:

At  3PM -0500 on 10/12/12 you (Maura Dailey) wrote:

I'm in a situation here at work where I'm trying to support a mixed
network of OS X and RHEL desktop machines with a Postfix/Dovecot
combination.
 - user account information is stored in LDAP
 - user credentials are in MIT Kerberos
 - server is running RHEL 6/Dovecot 2.0.9/Postfix 2.6.6

I am currently using the PAM passdb module to authenticate my users (I
began to have trouble with using GSSAPI directly). After I implemented
it, a few weeks later, I noticed that some users were no longer getting
their mail if they hadn't logged in during the past day. Postfix's mailq
showed that hundreds of messages were backing up in the queue. I
eventually tracked it down to leftover Kerberos credential cache files
(/tmp/krb5cc_) sitting in /tmp on the mail server. The presence of
expired credential files was preventing Postfix from delivering mail to
those users' mail spools. If I delete the credential files manually,
Postfix immediately delivers the queued emails.

This is rather odd. Is krb5-authenticated NFS involved here, or does
Postfix's delivery make any other use of Kerberos? The only other thing
I can think of is that so many expired ccaches are accumulating that the
user goes over their inode quota.

Each user has one credential cache file in /tmp on the mail server after
logging into Dovecot. We aren't using randomized names, so everything is
in the standard format /tmp/krb5cc_uid. We do use KRB5 authenticated
(and encrypted) NFS, but we don't deliver mail to home directories.
Since all users are real users, and our office size is small, everyone
has a mail spool directory on the mail server.

Hmm. I don't have much experience with KrbNFS, and none at all on Linux,
but the implementations I've seen seem to be terribly flaky about
passing krb5 creds to the kernel. (What they ought to do is implement
AFS' aklog and setpag; they're irritating, but at least they're
well-understood...)


Flaky is an understatement. Especially when you have to support Mac OS X 
users. After months of intermittent RPC errors, I had to revert them to 
NFS3. At least the RHEL users can use NFS4 and get the speed bump.



In any case, it's likely that the delivery process looks in the user's
home directory even if delivery is to a separate mail spool, unless
you've taken steps to prevent this. For instance, Postfix's local(8)
checks for ~/.forward by default, LDAs like procmail or maildrop look
for similar per-user RC files, and Dovecot's LDA looks for (at least)
~/.dovecot.sieve. Is it possible that the NFS code returns a different
error for 'no ccache present' vs 'ccache present but the creds have
expired', such that Postfix will carry on delvering if it gets the first
error but not the second?


That is a very good point. We're using Postfix's local, which probably 
doesn't even know it needs credentials. It looks like I can change the 
forward_path, or set allow_mail_to_commands and allow_mail_to_files to 
disallow forwarding. As I said, we're a small office, so I doubt anyone 
will complain. I've set up forwarding for users on travel before in 
/etc/aliases.



snip

Well, I don't use RH (I use FreeBSD), but I use and would recommend Russ
Allbery's pam_krb5.so, which may or may not be the same as the normal
pam_krb5.so provided by your system. It has options to control whether
and where ccaches are created; assuming Dovecot doesn't need krb5 creds
(say, for NFS), you would probably be better off telling it not to
create a permanent ccache at all.

http://www.eyrie.org/~eagle/software/pam-krb5/

I haven't had to configure pam_krb5.so directly before (we use the Red
Hat/Fedora configured default, pam_sss.so, which claims to be a one stop
shop for LDAP/Kerberos/NIS,etc.), but it does seem to have more options.
We certainly don't need credential caches to stick around for email
users. All the mail spools are stored on locally mounted storage on the
mail server.

Where do users' private IMAP folders live? Are they in the mail spool as
well, or are they in the user's home directory? Once a user has logged
in Dovecot will change directory to their home directory (as returned by
the userdb), so you may find you *do* need ccaches if they are on KrbNFS.


User's IMAP folders live in their mail spools. I've been watching the 
maillogs all morning, and I've noticed that my test users (who are using 
GSSAPI without leaving credential files behind) are getting the error 
message Error: chdir(/home/user/) failed: Permission denied 
(euid=1000(user) egid=2002(group) missing +x perm: /home, euid is not 
dir owner), so your premise that the credential files might have been 
reused for Kerberos seems to be correct. However, I'd much rather 
prevent Dovecot AND Postfix from looking in /home. I will try your tip 
that you gave at the end of 

Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Pascal Volk
On 12/11/2012 11:18 AM Kamil Jońca wrote:
  When I try to 
 
 dovecot-lda  message.txt
 
 (for sieve refiltering) I got segmentation fault.
 Does it is bug in lda, or message does not keep standards?
 KJ

I've saved your example message and delivered it twice (Dovecot 2.1.11
and 2.0.21). I'm unable to reproduce the crash.

Please read http://dovecot.org/bugreport.html and provide the necessary
details.


Regards,
Pascal
-- 
The trapper recommends today: 5e1f1e55.1234...@localdomain.org


Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Kamil Jońca
Pascal Volk user+dove...@localhost.localdomain.org writes:

 On 12/11/2012 11:18 AM Kamil Jońca wrote:
  When I try to 
 
 dovecot-lda  message.txt
 
 (for sieve refiltering) I got segmentation fault.
 Does it is bug in lda, or message does not keep standards?
 KJ

 I've saved your example message and delivered it twice (Dovecot 2.1.11
 and 2.0.21). I'm unable to reproduce the crash.

 Please read http://dovecot.org/bugreport.html and provide the necessary
 details.

dovecot -n
--8---cut here---start-8---
# 2.1.12 (f13f2725882e): /etc/dovecot/dovecot.conf
# OS: Linux 3.6.7+1 x86_64 Debian wheezy/sid 
auth_debug = yes
auth_mechanisms = plain digest-md5 cram-md5 login
auth_username_format = %n
auth_verbose = yes
log_path = /var/log/dovecot
namespace {
  hidden = no
  inbox = yes
  list = yes
  location = maildir:~/Mail/0:LAYOUT=fs:INBOX=~/Mail/0/INBOX
  prefix = 
  separator = /
  subscriptions = yes
  type = private
}
passdb {
  args = scheme=PLAIN /etc/security/dovecot.pwd
  driver = passwd-file
}
plugin {
  mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename 
flag_change save
  mail_log_fields = uid box msgid size from flags
  sieve = ~/.dovecot.sieve
  sieve_execute_bin_dir = %h/sieve/bin
  sieve_execute_exec_timeout = 86400s
  sieve_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute +vnd.dovecot.filter
  sieve_filter_bin_dir = %h/sieve/bin
  sieve_filter_exec_timeout = 86400s
  sieve_pipe_bin_dir = %h/sieve/bin
  sieve_pipe_exec_timeout = 86400s
  sieve_plugins = sieve_extprograms
}
protocols =  imap lmtp
service auth {
  user = root
}
ssl_cert = /etc/dovecot/dovecot.pem
ssl_key = /etc/dovecot/private/dovecot.pem
userdb {
  driver = passwd
}
protocol lmtp {
  mail_plugins =  sieve
}
protocol lda {
  deliver_log_format = msgid=%m: %$
  log_path = ~/log/deliver.log
  mail_plugins =  sieve
  postmaster_address = root@localhost
}
protocol imap {
  mail_max_userip_connections = 20
  mail_plugins = zlib imap_zlib  mail_log notify acl
}
--8---cut here---end---8---

Dovecot taken from deb http://xi.rename-it.nl/debian/ testing-auto/dovecot-2.1 
main
+ manually compiled sieve exptrograms plugin.

Maybe its worth noticing that 
adding line 

--8---cut here---start-8---
Return-path: a@b.c
--8---cut here---end---8---
to example message makes dovecot-lda working.

-- 
http://modnebzdury.wordpress.com/2009/10/01/niewiarygodny-list-prof-majewskiej-wprowadzenie/
You can no more win a war than you can win an earthquake.
-- Jeannette Rankin



Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Ben Morrow
At 10PM +0100 on 11/12/12 Kamil Jońca wrote:

 Dovecot taken from deb http://xi.rename-it.nl/debian/ 
 testing-auto/dovecot-2.1 main
 + manually compiled sieve exptrograms plugin.
 
 Maybe its worth noticing that 
 adding line 
 
 --8---cut here---start-8---
 Return-path: a@b.c
 --8---cut here---end---8---
 to example message makes dovecot-lda working.

Which revision of the extprograms plugin are you using? As of changeset
47 the Return-Path manipulation has been removed, so if there was a bug
in that code rebuilding with the latest version may make it go away.

Otherwise, can you get a backtrace? It would be more use if you can
rebuild with debug symbols, but even without it should give some useful
information.

Ben



Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Kamil Jońca
Ben Morrow b...@morrow.me.uk writes:

 At 10PM +0100 on 11/12/12 Kamil Jońca wrote:

 Dovecot taken from deb http://xi.rename-it.nl/debian/ 
 testing-auto/dovecot-2.1 main
 + manually compiled sieve exptrograms plugin.
 
 Maybe its worth noticing that 
 adding line 
 
 --8---cut here---start-8---
 Return-path: a@b.c
 --8---cut here---end---8---
 to example message makes dovecot-lda working.

 Which revision of the extprograms plugin are you using? As of changeset
 47 the Return-Path manipulation has been removed, so if there was a bug
 in that code rebuilding with the latest version may make it go away.

I think that is most recent which can I get with 
--8---cut here---start-8---
hg clone http://hg.rename-it.nl/pigeonhole-0.3-sieve-extprograms/
--8---cut here---end---8---

If I understand hg commands hg branches -v   gives me: 
--8---cut here---start-8---
default   47:3bd6ed27ae26
--8---cut here---end---8---

 Otherwise, can you get a backtrace? It would be more use if you can
 rebuild with debug symbols, but even without it should give some useful
 information.

I don't know if I did it properly  (how to compile it with debug
symbols?)


--8---cut here---start-8---
gdb -c ~/core /usr/lib/dovecot/dovecot-lda
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/lib/dovecot/dovecot-lda...(no debugging symbols 
found)...done.
[New LWP 25303]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
Core was generated by `/usr/lib/dovecot//dovecot-lda'.
Program terminated with signal 11, Segmentation fault.
#0  0x7f99d591fe6f in mail_storage_copy () from 
/usr/lib/dovecot/libdovecot-storage.so.0
(gdb) bt full
#0  0x7f99d591fe6f in mail_storage_copy () from 
/usr/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#1  0x7f99d58f1561 in maildir_copy () from 
/usr/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#2  0x7f99d592723b in mailbox_copy () from 
/usr/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#3  0x7f99d377c0c1 in ?? () from /usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#4  0x7f99d37724bb in ?? () from /usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#5  0x7f99d377385f in sieve_result_execute () from 
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#6  0x7f99d3782f65 in sieve_execute () from 
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#7  0x7f99d39c4112 in ?? () from 
/usr/lib/dovecot/modules/lib90_sieve_plugin.so
No symbol table info available.
#8  0x7f99d5bb98d5 in mail_deliver () from 
/usr/lib/dovecot/libdovecot-lda.so.0
No symbol table info available.
#9  0x0040295a in main ()
No symbol table info available.
--8---cut here---end---8---

-- 
http://blogdebart.pl/2009/12/22/mamy-chorych-dzieci/
They have been at a great feast of languages, and stolen the scraps.
-- William Shakespeare, Love's Labour's Lost



Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Kamil Jońca
kjo...@o2.pl (Kamil Jońca) writes:


 I don't know if I did it properly  (how to compile it with debug
 symbols?)

After sending previous post I realized that debug symbols should be in
dovecot-dbg package.
Below backtrace:

gdb -c ~/core /usr/lib/dovecot/dovecot-lda
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/lib/dovecot/dovecot-lda...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/dovecot-lda...done.
done.
[New LWP 25303]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
Core was generated by `/usr/lib/dovecot//dovecot-lda'.
Program terminated with signal 11, Segmentation fault.
#0  0x7f99d591fe6f in mail_storage_try_copy (mail=0x198dbb0, 
_ctx=0x7fff8914fc28) at mail-copy.c:56
56  mail-copy.c: No such file or directory.
(gdb) bt full
#0  0x7f99d591fe6f in mail_storage_try_copy (mail=0x198dbb0, 
_ctx=0x7fff8914fc28) at mail-copy.c:56
ctx = 0x19a6610
pmail = 0x198dbb0
from_envelope = 0x0
input = optimized out
guid = optimized out
received_date = -1
#1  mail_storage_copy (ctx=ctx@entry=0x19a6610, mail=mail@entry=0x198dbb0) at 
mail-copy.c:93
No locals.
#2  0x7f99d58f1561 in maildir_copy (ctx=0x19a6610, mail=0x198dbb0) at 
maildir-copy.c:148
_t = optimized out
mbox = optimized out
__FUNCTION__ = maildir_copy
#3  0x7f99d592723b in mailbox_copy (_ctx=_ctx@entry=0x7fff8914fd30, 
mail=mail@entry=0x198dbb0) at mail-storage.c:1721
ctx = 0x19a6610
box = 0x19942c0
keywords = 0x0
ret = optimized out
#4  0x7f99d377c0c1 in act_store_execute (action=optimized out, 
aenv=0x1980960, tr_context=0x1980a88) at sieve-actions.c:551
trans = 0x1980a88
mail = 0x198dbb0
real_mail = optimized out
save_ctx = 0x0
keywords = 0x0
result = true
#5  0x7f99d37724bb in _sieve_result_implicit_keep 
(result=result@entry=0x1980930, rollback=optimized out) at sieve-result.c:996
rac = optimized out
success = true
rsef = optimized out
rsef_first = 0x0
tr_context = 0x1980a88
act_keep = {def = 0x7f99d39b9500, ext = 0x0, location = 0x0, context = 
0x0, mail = 0x198dbb0, executed = false}
#6  0x7f99d377385f in sieve_result_execute (result=0x1980930, 
keep=keep@entry=0x0) at sieve-result.c:1230
implicit_keep = true
success = true
commit_ok = true
rac = 0x0
first_action = 0x1
#7  0x7f99d3782f65 in sieve_execute (sbin=optimized out, 
msgdata=optimized out, senv=optimized out, 
ehandler=ehandler@entry=0x1975140, 
flags=flags@entry=SIEVE_RUNTIME_FLAG_NOGLOBAL, 
keep=keep@entry=0x0) at sieve.c:508
result = 0x1980930
ret = 1
#8  0x7f99d39c4112 in lda_sieve_singlescript_execute (srctx=0x7fff8914ffa0) 
at lda-sieve-plugin.c:436
sbin = 0x19782a0
rtflags = SIEVE_RUNTIME_FLAG_NOGLOBAL
debug = false
svinst = 0x1971440
script = 0x1974d30
user_script = optimized out
cpflags = SIEVE_COMPILE_FLAG_NOGLOBAL
ret = optimized out
ehandler = 0x1975140
error = optimized out
#9  lda_sieve_deliver_mail (mdctx=0x7fff891501b0, storage_r=0x7fff89150140) at 
lda-sieve-plugin.c:812
count = optimized out
i = optimized out
_data_stack_cur_id = 2
srctx = {svinst = 0x1971440, mdctx = 0x7fff891501b0, scripts = 
0x1944ff0, script_count = 1, user_script = 0x1974d30, main_script = 0x1974d30, 
msgdata = 0x7fff8914ff70, scriptenv = 0x7fff8915, 
  user_ehandler = 0x1975140, master_ehandler = 0x1974c20, userlog = 
0x1945070 /home/kjonca/.dovecot.sieve.log}
svenv = {hostname = 0x194f2e0 alfa.kjonca, base_dir = 0x195be78 
/var/run/dovecot, username = 0x195b440 kjonca, home_dir = 0x195c4a8 
/home/kjonca, flags = SIEVE_FLAG_HOME_RELATIVE}
svinst = 0x1971440
msgdata = {mail = 0x196b010, return_path = 0x0, orig_envelope_to = 
0x1944c90 kjonca@alfa.kjonca, final_envelope_to = 0x1944c90 
kjonca@alfa.kjonca, auth_user = 0x195b440 kjonca, 
  id = 0x196d660 2126133839.B2888@localhost.localdomain}
scriptenv = {action_log_format = 0x194f358 msgid=%m: %$, user = 
0x195b380, default_mailbox = 0x403583 INBOX, postmaster_address = 0x194f2d0 
root@localhost, mailbox_autocreate = false, 
  mailbox_autosubscribe = false, script_context = 0x7fff891501b0, 
smtp_open = 

Re: [Dovecot] Maildir hardlinks with sieve

2012-12-11 Thread Stephan Bosch

On 12/9/2012 10:12 PM, Benedetto Vassallo wrote:


Def. Quota Benedetto Vassallo benedetto.vassa...@unipa.it:

Hi all,
As I had no response, I suppose there is no way to have maildir 
hardlinks work if I set up sieve.

Is that correct?


Apparently, not at this time. I think it should be fixable, but that 
will require some investigation. I won't have time for this until this 
weekend.


Regards,

Stephan.




Re: [Dovecot] Automatically Cleaning Kerberos Credential Cache Files

2012-12-11 Thread Joseph Tam

Ben Morrow writes:


In any case, it's likely that the delivery process looks in the user's
home directory even if delivery is to a separate mail spool, unless
you've taken steps to prevent this.


I can confirm this.  I think the reason is that dovecot changes to the
user's home directory so that it has a place to dump core.  This causes
problem for my setup since I user per-user NFS mounts, so a delivery to an
internal mailing list caused hundreds of NFS automounts.

I patched this behaviour out, but there is probably a more elegant solution
(unset MAIL_STORAGE_SERVICE_FLAG_ENABLE_CORE_DUMPS? How?).

Joseph Tam jtam.h...@gmail.com

--- ./src/lib-storage/mail-storage-service.c~   Sat May 19 08:42:12 2012
+++ ./src/lib-storage/mail-storage-service.cMon Jun 25 22:00:57 2012
@@ -615,21 +615,21 @@

-   if ((user-flags  MAIL_STORAGE_SERVICE_FLAG_TEMP_PRIV_DROP) != 0 
-   (user-flags  MAIL_STORAGE_SERVICE_FLAG_ENABLE_CORE_DUMPS) == 0) {
-   /* we don't want to write core files to any users' home
-  directories since they could contain information about other
-  users' mails as well. so do no chdiring to home. */
-   } else if (*home != '\0' 
-  (user-flags  MAIL_STORAGE_SERVICE_FLAG_NO_CHDIR) == 0) {
-   /* If possible chdir to home directory, so that core file
-  could be written in case we crash. */
-   if (chdir(home)  0) {
-   if (errno == EACCES) {
-   i_error(%s, eacces_error_get(chdir,
-   t_strconcat(home, /, NULL)));
-   } if (errno != ENOENT)
-   i_error(chdir(%s) failed: %m, home);
-   else if (mail_set-mail_debug)
-   i_debug(Home dir not found: %s, home);
-   }
-   }
+// if ((user-flags  MAIL_STORAGE_SERVICE_FLAG_TEMP_PRIV_DROP) != 0 
+// (user-flags  MAIL_STORAGE_SERVICE_FLAG_ENABLE_CORE_DUMPS) == 0) {
+// /* we don't want to write core files to any users' home
+//directories since they could contain information about other
+//users' mails as well. so do no chdiring to home. */
+// } else if (*home != '\0' 
+//(user-flags  MAIL_STORAGE_SERVICE_FLAG_NO_CHDIR) == 0) {
+// /* If possible chdir to home directory, so that core file
+//could be written in case we crash. */
+// if (chdir(home)  0) {
+// if (errno == EACCES) {
+// i_error(%s, eacces_error_get(chdir,
+// t_strconcat(home, /, NULL)));
+// } if (errno != ENOENT)
+// i_error(chdir(%s) failed: %m, home);
+// else if (mail_set-mail_debug)
+// i_debug(Home dir not found: %s, home);
+// }
+// }



[Dovecot] dovcot+offlineimap+gmail: INBOX empty, mail doubled

2012-12-11 Thread Uwe Brauer
Hello

I have used for years 
offlineimap-6.2.0
dovecot-imapd 1:1.2.9
in Kubuntu 10.04

Together with a imap server of my university. Yesterday we
switched to google, which I know, is not a real imap server.

I have 2 problems and the first I think has to do with
either an old version of offlineimap or a bad configuration file:

-  All folders are downloaded+ Gmail[All Mail] so
   doubling my mail.

-  My INBOX folder is empty, however this is the only
   folder for which offlinemap gives the following
   warning:

Syncing INBOX: Gmail - MappedIMAP
WARNING: UID validity problem for folder INBOX (repo
UniLocal) (saved 1309334376; got 1355232397); skipping it 


So maybe this is also a offlineimap fault. 

In any case I have googled around and found out that I am not
the only person suffering this problem. I have attached my
configuration file in the hope that may be somebody could
give me a hint.

Thanks in advance

Uwe Brauer 

--8schnipp-8---
[general]
accounts = Uni
ui = Noninteractive.Basic
maxsyncaccounts = 1


[Account Uni]
localrepository = UniLocal
remoterepository = UniRemote

[Repository UniLocal]
type = IMAP
ssl = no
remotehost = localhost
remoteuser = myuser
remotepass = mypasswd
maxconnections = 2

[Repository UniRemote]
type = Gmail
# ssl =no
ssl =yes
#remotehost = ucimap.ucm.es
remotehost = imap.gmail.com
remoteuser = myuser
remotepass = mypasswd
#  nametrans = lambda foldername: re.sub ('^\[gmail\]', 'bak',
# re.sub ('sent_mail', 'sent',
# re.sub ('starred', 'flagged',
# re.sub (' ', '_', foldername.lower()
folderfilter = lambda foldername: foldername in ['INBOX']
idlefolders = ['INBOX']
folderfilter = lambda foldername: foldername not in '[Gmail]/All Mail'
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
maxconnections = 1
realdelete = yes
# Don't sync shared folders
# folderfilter = lambda foldername: not re.search('Shared Folders', foldername)

# automatic stuff
maxsyncaccounts = 1
quick = 10
autorefresh = 5
keepalive = 60
holdconnectionopen = yes
# This will suppress anything but errors
ui = quiet
--8schnapp-8---


--8schnipp-8---
version_ignore=yes
first_valid_uid = 1
log_path = /var/log/dovecot.log
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem
# mail_location = maildir:/var/spool/mail/%u
# not sure about the following
mail_location = maildir:/var/spool/mail/%u:INBOX=/var/spool/mail/%u
maildir_copy_with_hardlinks = yes

protocol imap {
  listen = 127.0.0.1:143
  ssl_listen = 127.0.0.1:943
}
  
auth default {
  mechanisms = plain
  # defines users/passwords
  passdb passwd-file {
args = /etc/dovecot/passwd
  }

  userdb static {
args = uid=mail gid=mail home=/var/spool/mail/%u
  }
}

--8schnapp-8---