[Dovecot] mail extra field to override default mail_location for only certain users

2008-07-26 Thread Sahil Tandon
I am running version 1.1.1 with mail_location: maildir:~/Maildir.  This is 
working great as all our users have UNIX accounts with nologin shells.  New 
domains (and their users) are about to come online and we would like to 
migrate to a setup with virtual mailboxes/users.  From the wiki and comments 
within dovecot.conf, I see it is possible to do this piecemeal so both local 
and virtual users can co-exist during the transition.  My question is how to 
keep things working as they are for existing users/domains (which will be 
migrated later), and use the virtual mailboxes (and thus, a different 
mail_location) exclusively for the new users.  I understand that multiple 
userdbs and passdbs can be specified, and this will take care of 
authentication.  On http://wiki.dovecot.org/VirtualUsers#homedirs it is 
stated that "The userdb can return the mail extra field to override the 
default mail_location setting. Usually you shouldn't need this."  Where is 
this mail extra field defined?  In the userdb passwd-file or somewhere within 
dovecot.conf?  If the former, would something like this suffice (mind the 
wrapping):
   
[EMAIL PROTECTED]::5000:5000::/home/vhosts/domain.org/:/usr/sbin/nologin::mail=m
aildir:/home/vhosts/%d/%n  

Thanks,
-- 
Sahil Tandon <[EMAIL PROTECTED]>


Re: [Dovecot] stopping dovecot

2008-07-26 Thread David Ledger

At 23:42 +0200 25/7/08, Arkadiusz Miskiewicz wrote:

This may be a silly question but how to correctly stop dovecot and be sure
that it's possible to start it again?

kill -TERM `cat /var/run/dovecot/master.pid` doesn't work well.

I have imap-login processes staying arround and occupying port which leads to
Fatal: listen(0.0.0.0, 993) failed: Address already in use
when trying to start again 2s after stopping.


The key is '2s after stopping'. It'll take longer than that for a 
port to be released the default 'tidyup' way. This happens with all 
sorts of services on all sorts of Unixy systems. Maybe it's the fault 
of the app not tidying up as it terminates, but it's far from 
uncommon.


David


--
David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
[EMAIL PROTECTED]
www.ivdcs.co.uk


Re: [Dovecot] stopping dovecot

2008-07-26 Thread Timo Sirainen

On Jul 26, 2008, at 10:05 PM, Arkadiusz Miskiewicz wrote:


I think the imap-login processes will hang around if there are SSL or
proxy connections through them (but perhaps they shouldn't be
"listen"-ing for new connections?).


It would be good if existing clients were not disconnected but  
starting
dovecot would be possible. That's how daemons for other services  
behave.


This is how it should work, but for some reason netstat still shows  
the process as listening even after closing the listener file  
descriptors. I'll try to figure out later what the problem is. Perhaps  
some stupid mistake that I'm not noticing now, or perhaps it has  
something to do with the fd being opened by the master process and  
transferred to a forked child process..




PGP.sig
Description: This is a digitally signed message part


Re: [Dovecot] Error - Dovecot Permission denied

2008-07-26 Thread mouss

kbajwa wrote:

CentOS 5.2
Postfix 2.3.3 (Came Packed with CentOS)
Dovecot 1.1.1
Dovecot-Sieve 1.1.5

Did a complete new fresh install. When I send a message to:
[EMAIL PROTECTED], I get two error messages as listed in the
/var/log/maillog:

(1) (lost connection with mail.tibonline.net[12.179.81.11] while receiving
the initial server greeting)


your postfix cannot connect to mail.tiboline.net. check if anything is 
breaking the connection (firewall, pix, ..., etc).





(2) status=bounced (local configuration error. Command output: Fatal:
open(/etc/dovecot.conf) failed: Permission denied )




# ls -l / | grep /etc
# ls -l /etc/dovecot.conf

and if you have selinux, apparmor or such beasts, make sure they are not 
 preventing deliver from accessing /etc and/or to /etc/dovecot.conf.




Re: [Dovecot] stopping dovecot

2008-07-26 Thread Chris Wakelin



Arkadiusz Miskiewicz wrote:

What do you have for the "shutdown_clients" option?


shutdown_clients: no


I think the imap-login processes will hang around if there are SSL or
proxy connections through them (but perhaps they shouldn't be
"listen"-ing for new connections?).


It would be good if existing clients were not disconnected but starting 
dovecot would be possible. That's how daemons for other services behave.




It might be worth trying

login_process_per_connection = yes

That way, the login-processes have no need to be "listen"-ing once 
somebody has logged in.


Chris

--
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
Christopher Wakelin,   [EMAIL PROTECTED]
IT Services Centre, The University of Reading,  Tel: +44 (0)118 378 8439
Whiteknights, Reading, RG6 2AF, UK  Fax: +44 (0)118 975 3094


Re: [Dovecot] stopping dovecot

2008-07-26 Thread Arkadiusz Miskiewicz
On Saturday 26 July 2008, Chris Wakelin wrote:
> Arkadiusz Miskiewicz wrote:
> > On Saturday 26 July 2008, Timo Sirainen wrote:
> >> On Jul 26, 2008, at 5:31 PM, Kai Schaetzl wrote:
>  I have imap-login processes staying arround and occupying port
> >>>
> >>> Ah, well, that's a different question! Stopping dovecot won't kill the
> >>> processes with actual logins. -> killall imap-login
> >>
> >> It does kill everything.
> >
> > "It" means what?
> >
> > kill -TERM `cat /var/run/dovecot/master.pid` ? That doesn't kill
> > imap-login processes.
>
> What do you have for the "shutdown_clients" option?

shutdown_clients: no

>
> I think the imap-login processes will hang around if there are SSL or
> proxy connections through them (but perhaps they shouldn't be
> "listen"-ing for new connections?).

It would be good if existing clients were not disconnected but starting 
dovecot would be possible. That's how daemons for other services behave.

> Chris

-- 
Arkadiusz MiśkiewiczPLD/Linux Team
arekm / maven.plhttp://ftp.pld-linux.org/


Re: [Dovecot] stopping dovecot

2008-07-26 Thread Chris Wakelin

Arkadiusz Miskiewicz wrote:

On Saturday 26 July 2008, Timo Sirainen wrote:

On Jul 26, 2008, at 5:31 PM, Kai Schaetzl wrote:

I have imap-login processes staying arround and occupying port

Ah, well, that's a different question! Stopping dovecot won't kill the
processes with actual logins. -> killall imap-login
It does kill everything. 


"It" means what? 

kill -TERM `cat /var/run/dovecot/master.pid` ? That doesn't kill imap-login 
processes.


What do you have for the "shutdown_clients" option?

I think the imap-login processes will hang around if there are SSL or 
proxy connections through them (but perhaps they shouldn't be 
"listen"-ing for new connections?).


Chris

--
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
Christopher Wakelin,   [EMAIL PROTECTED]
IT Services Centre, The University of Reading,  Tel: +44 (0)118 378 8439
Whiteknights, Reading, RG6 2AF, UK  Fax: +44 (0)118 975 3094


Re: [Dovecot] stopping dovecot

2008-07-26 Thread Arkadiusz Miskiewicz
On Saturday 26 July 2008, Timo Sirainen wrote:
> On Jul 26, 2008, at 5:31 PM, Kai Schaetzl wrote:
> >> I have imap-login processes staying arround and occupying port
> >
> > Ah, well, that's a different question! Stopping dovecot won't kill the
> > processes with actual logins. -> killall imap-login
>
> It does kill everything. 

"It" means what? 

kill -TERM `cat /var/run/dovecot/master.pid` ? That doesn't kill imap-login 
processes.

> I don't know if there's anything that Dovecot 
> can do about the "Address already in use" problem. It seems that the
> OS is keeping the listener alive for some reason longer than the
> processes exist.

imap-login processes still exist so this behaviour is valid. 

I've checked few init.d/dovecot scripts and there is no imap-login killing in 
these, so I assumed that sending TERM to master causes master to kill it's 
childs but again - that's not the case here since dovecot process dies while 
imap-login is still alive.

-- 
Arkadiusz MiśkiewiczPLD/Linux Team
arekm / maven.plhttp://ftp.pld-linux.org/


Re: [Dovecot] stopping dovecot

2008-07-26 Thread Timo Sirainen

On Jul 26, 2008, at 5:31 PM, Kai Schaetzl wrote:


I have imap-login processes staying arround and occupying port


Ah, well, that's a different question! Stopping dovecot won't kill the
processes with actual logins. -> killall imap-login


It does kill everything. I don't know if there's anything that Dovecot  
can do about the "Address already in use" problem. It seems that the  
OS is keeping the listener alive for some reason longer than the  
processes exist. I've had the exact same problem with some simple test  
programs and haven't figured out how to avoid it (even cleanly closing  
all the connections didn't help. although I just thought that perhaps  
using shutdown() might have, guess I'll have to try the next time).  
Maybe google would find something about this problem, I haven't looked.




PGP.sig
Description: This is a digitally signed message part


[Dovecot] Error - Dovecot Permission denied

2008-07-26 Thread kbajwa
CentOS 5.2
Postfix 2.3.3 (Came Packed with CentOS)
Dovecot 1.1.1
Dovecot-Sieve 1.1.5

Did a complete new fresh install. When I send a message to:
[EMAIL PROTECTED], I get two error messages as listed in the
/var/log/maillog:

(1) (lost connection with mail.tibonline.net[12.179.81.11] while receiving
the initial server greeting)

(2) status=bounced (local configuration error. Command output: Fatal:
open(/etc/dovecot.conf) failed: Permission denied )



Attached are copies of (a) Postfix, (b) Dovecot, (c) Dovecot-Sieve in
'/home/test/' and (d) /var/log/maillog

--
[EMAIL PROTECTED] ~]# postconf -n 
alias_database = hash:/etc/aliases 
alias_maps = hash:/etc/aliases 
broken_sasl_auth_clients = yes 
command_directory = /usr/sbin 
config_directory = /etc/postfix 
daemon_directory = /usr/libexec/postfix 
debug_peer_level = 2 
home_mailbox = Maildir/ 
html_directory = no 
inet_interfaces = all 
mail_owner = postfix 
mailbox_command = /usr/libexec/dovecot/deliver 
mailq_path = /usr/bin/mailq.postfix 
manpage_directory = /usr/share/man 
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain 
mydomain = wildpeacockstudios.com 
myhostname = mail.wildpeacockstudios.com 
mynetworks = 127.0.0.0/8 
myorigin = $mydomain 
newaliases_path = /usr/bin/newaliases.postfix 
queue_directory = /var/spool/postfix 
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES 
relay_domains = 
relayhost = 
sample_directory = /usr/share/doc/postfix-2.3.3/samples 
sendmail_path = /usr/sbin/sendmail.postfix 
setgid_group = postdrop 
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,
reject_unauth_destination 
smtpd_sasl_auth_enable = yes 
smtpd_sasl_path = private/auth 
smtpd_sasl_type = dovecot 
unknown_local_recipient_reject_code = 550 
[EMAIL PROTECTED] ~]# 
[EMAIL PROTECTED] ~]# 

--
[EMAIL PROTECTED] ~]# dovecot -n 
# 1.1.2: /etc/dovecot.conf 
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_location: maildir:~/Maildir 
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 
imap_client_workarounds(default): delay-newmail outlook-idle netscape-eoh 
imap_client_workarounds(imap): delay-newmail outlook-idle netscape-eoh 
imap_client_workarounds(pop3): 
pop3_client_workarounds(default): 
pop3_client_workarounds(imap): 
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh 
auth default: 
  mechanisms: plain login 
  passdb: 
driver: pam 
  userdb: 
driver: passwd 
  socket: 
type: listen 
client: 
  path: /var/spool/postfix/private/auth 
  mode: 432 
  user: postfix 
  group: postfix 
[EMAIL PROTECTED] ~]# 

--
/home/test/.dovecot-sieve

require ["fileinto", "vacation"];
# Move spam to spam folder
if exists "X-Spam-Flag" {
  fileinto "spam";
  # Stop here so that we do not reply on spams
  stop;
}
vacation
  # Reply at most once a day to a same sender
  :days 1
  :subject "Out of office reply"
  # List of recipient addresses which are included in the auto replying.
  # If a mail's recipient is not on this list, no vacation reply is sent for
it.
  :addresses ["[EMAIL PROTECTED]"]
"I'm out of office, please contact Joan Doe instead.
Best regards
John Doe";

--
/var/log/maillog

Jul 26 09:39:28 www dovecot: Dovecot v1.1.2 starting up
Jul 26 09:39:29 www postfix/postfix-script: starting the Postfix mail system
Jul 26 09:39:29 www postfix/master[4963]: daemon started -- version 2.3.3,
configuration /etc/postfix
Jul 26 09:39:29 www postfix/qmgr[4969]: 6EBA241C0007:
from=<[EMAIL PROTECTED]>, size=722, nrcpt=1 (queue active)

Jul 26 09:39:31 www postfix/smtp[4996]: 6EBA241C0007:
to=<[EMAIL PROTECTED]>, relay=mail.tibonline.net[12.179.81.11]:25,
delay=1011, delays=1009/0.15/2.3/0, dsn=4.4.2, status=deferred (lost
connection with mail.tibonline.net[12.179.81.11] while receiving the initial
server greeting)

Jul 26 09:41:07 www dovecot: pop3-login: Login: user=, method=PLAIN,
rip=192.168.0.64, lip=65.103.190.107
Jul 26 09:41:08 www dovecot: POP3(test): Disconnected: Logged out top=0/0,
retr=0/0, del=0/0, size=0
Jul 26 09:41:17 www postfix/smtpd[5583]: connect from unknown[192.168.0.64]
Jul 26 09:41:17 www postfix/smtpd[5583]: D7F3F41C001C:
client=unknown[192.168.0.64], sasl_method=PLAIN, sasl_username=kirtib
Jul 26 09:41:17 www postfix/cleanup[5587]: D7F3F41C001C:
message-id=<[EMAIL PROTECTED]>
Jul 26 09:41:17 www postfix/qmgr[4969]: D7F3F41C001C:
from=<[EMAIL PROTECTED]>, size=720, nrcpt=1 (queue active)
Jul 26 09:41:17 www postfix/smtpd[5583]: disconnect from
unknown[192.168.0.64]
Jul 26 09:41:1

Re: [Dovecot] stopping dovecot

2008-07-26 Thread Kai Schaetzl
Arkadiusz Miskiewicz wrote on Fri, 25 Jul 2008 23:42:09 +0200:

> This may be a silly question but how to correctly stop dovecot and be sure 
> that it's possible to start it again?

depends on your operating system. /etc/init.d/dovecot stop should work on 
most Linuxes.

> I have imap-login processes staying arround and occupying port

Ah, well, that's a different question! Stopping dovecot won't kill the 
processes with actual logins. -> killall imap-login

Kai

-- 
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com