[Dovecot] multiple auth-client sockets

2009-08-09 Thread LEVAI Daniel
Hi!

I'm gonna need to use dovecot's auth-client socket in an authentication 
program. Now the auth-client socket is only used by my MTA, which is postfix. 
Because postfix's smtpd process (which uses the auth-client socket) runs 
chrooted under postfix's spool directory, I must create the auth-client socket 
under that spool directory. However, to reach that socket from another 
chrooted program is impossible. Can I create multiple instances of auth-client 
sockets? I tried to define another client {} stanza in socket listen {} in 
dovecot.conf, but only the last client socket got created.
I need only a true or false response from dovecot regarding the 
authentication, and I thought that this is exactly what auth-client socket 
will do. However, if I can not reach it, is there any alternative to this? 
What's up with the auth-master or auth-worker sockets? Are they capable of 
respond to an auth request too?

btw, I'm running dovecot-1.2.3


Thanks!


Daniel

-- 
LÉVAI Dániel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1



[Dovecot] Wiki entry for expire plugin, PostgreSQL trigger needs update

2009-08-09 Thread Stefan Förster
The wiki entry at http://wiki.dovecot.org/Plugins/Expire needs an
update for Dovecot 1.2 and PostgreSQL:

-- v1.2+:
CREATE OR REPLACE FUNCTION merge_expires() RETURNS TRIGGER AS $$
BEGIN
  IF exists(SELECT 1 FROM expires WHERE username = NEW.username AND mailbox = 
NEW.mailbox) THEN
UPDATE expires SET expire_stamp = NEW.expire_stamp
  WHERE username = NEW.username AND mailbox = NEW.mailbox;
RETURN NULL;
  ELSE
RETURN NEW;
  END IF;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER mergeexpires BEFORE INSERT ON expires
   FOR EACH ROW EXECUTE PROCEDURE merge_expires();

At least that's what I think after looking at the code:

iter = dict_iterate_init(dict, DICT_EXPIRE_PREFIX,
DICT_ITERATE_FLAG_RECURSE |
DICT_ITERATE_FLAG_SORT_BY_VALUE);

/* We'll get the oldest values (timestamps) first */
while (dict_iterate(iter, key, value)  0) {
   /* key = DICT_EXPIRE_PREFIXuser/mailbox */
   userp = key + strlen(DICT_EXPIRE_PREFIX);
[...]
T_BEGIN {
 username = t_strdup_until(userp, p);

If this code does somehow iterate usernames which are not present in
the dict, I apologize.


Cheers
Stefan


[Dovecot] autocreate plugin fails to subscribe mailbox in public namespace

2009-08-09 Thread Stefan Förster
Hi,

I'm one step away from replacing a 7 years old qmail/uw-imapd setup
with some state of the art soft- and hardware. We got migration
scripts and test almost done - just one thing that keeps failing:

The autocreate plugin is supposed to subscribe new users to different
mailboxes, one of them being in namespace Public. - this
subscription to Public.announcements fails.

Below is a dovecot -n - and no, there are no error messages in the
logs.


# 1.2.2: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.30-bpo.1-amd64 x86_64 Debian 5.0.2 
log_timestamp: %Y-%m-%d %H:%M:%S 
protocols: imap imaps managesieve
listen(default): *:143
listen(imap): *:143
listen(managesieve): *
ssl_listen(default): *:993
ssl_listen(imap): *:993
ssl_listen(managesieve): 
ssl_cert_file: /etc/ssl/owncerts/snakeoil.crt
ssl_key_file: /etc/ssl/private/snakeoil.key
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
verbose_proctitle: yes
mail_privileged_group: vmail
mail_location: maildir:~/Maildir
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_process_size: 384
mail_plugins(default): quota imap_quota fts fts_squat acl autocreate expire 
trash
mail_plugins(imap): quota imap_quota fts fts_squat acl autocreate expire trash
mail_plugins(managesieve): 
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
namespace:
  type: private
  separator: .
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: public
  separator: .
  prefix: Public.
  location: maildir:/export/vmailboxes/public:INDEX=~/Maildir/public
  list: yes
lda:
  postmaster_address: postmas...@test.cite.lan
  hostname: testvm06.test.cite.lan
  mail_plugins: quota sieve expire trash
  auth_socket_path: /var/run/dovecot/auth-master
auth default:
  mechanisms: plain login cram-md5
  passdb:
driver: ldap
args: /etc/dovecot/dovecot-ldap.conf
  userdb:
driver: ldap
args: /etc/dovecot/dovecot-ldap.conf
  socket:
type: listen
client:
  path: /var/spool/postfix/private/auth
  mode: 432
  user: postfix
  group: sasl
master:
  path: /var/run/dovecot/auth-master
  mode: 384
  user: vmail
  group: vmail
plugin:
  quota: maildir:User quota
  quota_warning:  storage=90%% /usr/local/bin/quota-warning.sh 90
  quota_warning2: storage=95%% /usr/local/bin/quota-warning.sh 95
  sieve: ~/.dovecot.sieve
  sieve_storage: ~/sieve
  sieve_extensions: +imapflags
  fts: squat
  fts_squat: partial=4 full=10
  acl: vfile
  autocreate: Trash
  autocreate2: Drafts
  autocreate3: Sent
  autocreate4: learn-spam
  autosubscribe: Trash
  autosubscribe2: Drafts
  autosubscribe3: Sent
  autosubscribe4: learn-spam
  autosubscribe5: Public.announcements
  autosubscribe6: INBOX
  expire: Trash 60 Trash/* 60
  expire_dict: proxy::expire
  trash: /etc/dovecot/dovecot-trash.conf
dict:
  expire: pgsql:/etc/dovecot/dovecot-dict-expire.conf

Any hints are really appreciated.


Cheers
Stefan

BTW: If anybody is interested, I could provide load and usage
statistics of our old and new software once step 1 of our migration
(new hardware is step 2) is done. Only ~1000 users, but still...


Re: [Dovecot] Mail not begin processed

2009-08-09 Thread Timo Sirainen
On Sat, 2009-08-08 at 14:57 +0200, André Labuschagné wrote:
 Aug  8 14:55:02 li73-31 postfix/qmgr[20163]: warning: connect to 
 transport private/dovecot: Connection refused

What does master.cf contain? Or postconf -n? This is anyway Postfix
configuration problem, nothing really to do with Dovecot (your transport
name just happens to be dovecot).



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


Re: [Dovecot] User Auth

2009-08-09 Thread Timo Sirainen
On Sat, 2009-08-08 at 17:40 +0100, Richard Harwood wrote:

 /var/spool/mail/vhosts/domain.tld/name

 mail_location: 
 mbox:/var/spool/mail/vhosts/%d:INBOX=/var/spool/mail/vhosts/%d/%n

With above configuration all users within the domain share all their
non-INBOX mailboxes. Is this really what you wanted?

   passdb:
 driver: passwd-file
 args: /etc/passwd.dovecot
   userdb:
 driver: passwd
 --
 
 Password excepted, my passwd.dovecot file containing a single virtual
 user looks like:
 
 richard:{plain}password:504:505::/home/vmail

Then you should configure dovecot to use userdb passwd-file { .. }
instead of using userdb passwd (which uses your /etc/passwd).

Also don't make home directory shared across users. Instead I'd do
something like:

home = /var/spool/mail/vhosts/domain.tld/name

mail_location = mbox:~/mail


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


[Dovecot] http://wiki.dovecot.org/LDA typo

2009-08-09 Thread LEVAI Daniel
-Note that dovecot.conf file must be world readable to enable deliver process 
read it, while running with user priviledges.
+Note that dovecot.conf file must be world readable to enable deliver process 
read it, while running with user privileges.

-- 
LÉVAI Dániel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1



Re: [Dovecot] http://wiki.dovecot.org/LDA typo

2009-08-09 Thread LEVAI Daniel
On Sunday 09 August 2009 21.45.17 Timo Sirainen wrote:
 On Sun, 2009-08-09 at 21:30 +0200, LEVAI Daniel wrote:
  -Note that dovecot.conf file must be world readable to enable deliver
  process read it, while running with user priviledges.
  +Note that dovecot.conf file must be world readable to enable deliver
  process read it, while running with user privileges.

 Changed, although it begin a wiki you could have done it yourself too.
Oh sorry, I thought only You have write access :\


Daniel
-- 
LÉVAI Dániel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1



[Dovecot] More effective mailbox fetching over high RTT link

2009-08-09 Thread Andrzej Adam Filip
Could you offer some suggestion how to fetch mailbox content over 
high RTT link (with negligible packet loss)?

Currently I use IMAP+IDLE *but* it fails to use full available bandwidth
due to high RTT and send command wait for response nature of POP3 and
IMAP4 protocols.

-- 
[plen: Andrew] Andrzej Adam Filip : a...@onet.eu
Learning without thought is labor lost;
thought without learning is perilous.
  -- Confucius


Re: [Dovecot] More effective mailbox fetching over high RTT link

2009-08-09 Thread Timo Sirainen
On Sun, 2009-08-09 at 22:20 +0200, Andrzej Adam Filip wrote:
 Could you offer some suggestion how to fetch mailbox content over 
 high RTT link (with negligible packet loss)?
 
 Currently I use IMAP+IDLE *but* it fails to use full available bandwidth
 due to high RTT and send command wait for response nature of POP3 and
 IMAP4 protocols.

I'm not entirely sure what you want. Download all new messages
automatically whenever they show up? And by mailbox do you mean user
or folder? So would you want to download all new mails in all folders?
And is it ok to create your own software to do the downloading?

If all of them were yes, the best you could right now would be to set
up a virtual all mailbox containing all mailboxes. Then in IDLE you'd
see whenever new messages pop up and then issue FETCH n:* BODY.PEEK[] or
whatever. There's also IMAP NOTIFY extension that would allow your
client to ask server to immediately send the message body instead of the
client having to ask for it. But Dovecot doesn't currently support that.

Or if you just always wanted to download all mails, again a virtual
mailbox and FETCH 1:* BODY.PEEK[] gives you all mails.


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