Re: [Dovecot] Postfix : lda problem

2009-08-30 Thread Benny Pedersen

On Mon 17 Aug 2009 10:21:47 PM CEST, denis wrote


denis a écrit :

Ok, here is a configuration that works fine but without success to
retrieve the correct gid in the database.


In fact, aliases no longer work
In trying with alias_maps or virtual_alias_maps and in both cases the
following error: User unknown in virtual mailbox table

Any Ideas ?
Thanks
Denis

## /etc/postfix/main.cf

alias_maps =proxy:mysql:/etc/postfix/myalias.cf,
hash:/etc/aliases
virtual_mailbox_base = /var/alternc/mail
virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf
virtual_mailbox_domains = mysql:/etc/postfix/mydomain.cf
default_privs = www-data


dont give web server full email read access outside dovecot auth


virtual_uid_maps = static:33
virtual_gid_maps = static:33

virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

## /etc/postfix/myalias.cf

user = xyz
password = xyz
hosts = 10.0.112.1
dbname = alternc
table = mail_alias
select_field = alias
where_field = mail


now sync dovecot to use same db backend as postfix

so virtual_mailbox in postfix is equal to dovecot mailbox, make sure  
any alias in postfix is delivered to a mailbox not just another alias  
that is delivered to a alias in dovecot, else you get mailbox does not  
exists


--
xpoint



Re: [Dovecot] Postfix : lda problem

2009-08-17 Thread denis
denis a écrit :
 Ok, here is a configuration that works fine but without success to
 retrieve the correct gid in the database.
   
In fact, aliases no longer work
In trying with alias_maps or virtual_alias_maps and in both cases the
following error: User unknown in virtual mailbox table

Any Ideas ?
Thanks
Denis

## /etc/postfix/main.cf

alias_maps =proxy:mysql:/etc/postfix/myalias.cf,
hash:/etc/aliases
virtual_mailbox_base = /var/alternc/mail
virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf
virtual_mailbox_domains = mysql:/etc/postfix/mydomain.cf
default_privs = www-data   
virtual_uid_maps = static:33
virtual_gid_maps = static:33

virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

## /etc/postfix/myalias.cf

user = xyz
password = xyz
hosts = 10.0.112.1
dbname = alternc
table = mail_alias
select_field = alias
where_field = mail





Re: [Dovecot] Postfix : lda problem

2009-08-16 Thread denis
Thomas Leuxner a écrit :

 Am 15.08.2009 um 18:52 schrieb denis:
 virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf
 virtual_uid_maps = static:33
 You need to match the groups used by deliver in the master.cf
 (mail/mail) or change them there. Try

 virtual_gid_maps = static:8
 virtual_uid_maps = static:8
Ok, here is a configuration that works fine but without success to
retrieve the correct gid in the database.

The mails are stored under www-data:www-data in place of www-data:gid.
The parameter virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf has
no effect.

But it's working, thanks !!

Denis


# Main.cf

alias_maps =proxy:mysql:/etc/postfix/myalias.cf,
hash:/etc/aliases
virtual_mailbox_base = /var/alternc/mail
virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf
virtual_mailbox_domains = mysql:/etc/postfix/mydomain.cf
default_privs = www-data   
virtual_uid_maps = static:33
virtual_gid_maps = static:33

virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

# Master.cf

dovecot   unix  -   n   n   -   -   pipe
  flags=DRhu user=www-data:www-data argv=/usr/lib/dovecot/deliver -d
$(recipient)

# dovecot.conf

   socket listen {
 master {
   path = /var/run/dovecot/auth-master
   mode = 0660
   user = www-data
   }




Re: [Dovecot] Postfix : lda problem

2009-08-16 Thread denis
Charles Marcus a écrit :
 dovecot   unix  -   n   n   -   -   pipe
   flags=DRhu user=www-data:www-data argv=/usr/lib/dovecot/deliver -d
 $(recipient)
 

 Postfix is chrooted, dovecot LDA is not...

 I think you have other problems, but this is definitely a major one.
   
If i chroot dovecot, I have the following error:

 fatal: service dovecot requires privileged operation

Denis



Re: [Dovecot] Postfix : lda problem

2009-08-16 Thread Benny Pedersen
On Sat, August 15, 2009 15:48, Thomas Leuxner wrote:

 mydestination = $myhostname, localhost.$mydomain
 virtual_mailbox_domains = altern.domainepublic.net,
 vacarme.domainepublic.net, mail.domainepublic.net

i would not include $myhostname in mydestination, move this also to virtual if 
mail i still
wanted there

mydestination should not have domains that can be sent to from outside if 
postfixadmin need to
be in control

 Mailbox base does not look right too:
 virtual_mailbox_base = /var/mail/vmail (or whatever path you prefer)

only important if virtual_transport=virtual

eg dovecot does not use virtual_mailbox_base in postfix

-- 
xpoint






Re: [Dovecot] Postfix : lda problem

2009-08-16 Thread Benny Pedersen

On Sat, August 15, 2009 18:52, denis wrote:

 Fatal: setgid(33(www-data)) failed with euid=8(mail), gid=8(mail),
 egid=8(mail): Operation not permitted

postfix virtual and dovecot must be friends on the uid and gid, else permission 
denied

this one is not that hard to solve :)

id mail

set this uid/gid all places

-- 
xpoint



Re: [Dovecot] Postfix : lda problem

2009-08-16 Thread Benny Pedersen

On Sun, August 16, 2009 16:31, denis wrote:

 The mails are stored under www-data:www-data

if that is apache user then you have open file system for remote web users to 
all you mails
even if thay dont login !

dont save your mails with apache user

 in place of www-data:gid.
 The parameter virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf has
 no effect.

 But it's working, thanks !!

no i does not


 Denis


 # Main.cf

 alias_maps =proxy:mysql:/etc/postfix/myalias.cf,
 hash:/etc/aliases
 virtual_mailbox_base = /var/alternc/mail
 virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf
 virtual_mailbox_domains = mysql:/etc/postfix/mydomain.cf
 default_privs = www-data
 virtual_uid_maps = static:33
 virtual_gid_maps = static:33

 virtual_transport = dovecot
 dovecot_destination_recipient_limit = 1

 # Master.cf

 dovecot   unix  -   n   n   -   -   pipe
   flags=DRhu user=www-data:www-data argv=/usr/lib/dovecot/deliver -d
 $(recipient)

 # dovecot.conf

socket listen {
  master {
path = /var/run/dovecot/auth-master
mode = 0660
user = www-data
}




dont use www-data in dovecot

-- 
xpoint



Re: [Dovecot] Postfix : lda problem

2009-08-15 Thread Thomas Leuxner


Am 15.08.2009 um 15:22 schrieb denis:


mydestination = altern.domainepublic.net vacarme.domainepublic.net
mail.domainepublic.net, altern, localhost.localdomain, localhost


This is a pure Postfix configuration issue by first look. See: 
http://www.postfix.org/VIRTUAL_README.html

There it says: NEVER list a virtual alias domain name as a  
mydestination domain!



virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf
virtual_mailbox_base = /
virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf
virtual_minimum_uid = 1000
virtual_transport = dovecot
virtual_uid_maps = static:33


mydestination = $myhostname, localhost.$mydomain
virtual_mailbox_domains = altern.domainepublic.net,  
vacarme.domainepublic.net, mail.domainepublic.net


Mailbox base does not look right too:
virtual_mailbox_base = /var/mail/vmail (or whatever path you prefer)

Regards
Thomas




Re: [Dovecot] Postfix : lda problem

2009-08-15 Thread denis
Thomas Leuxner a écrit :

 Am 15.08.2009 um 15:22 schrieb denis:

 mydestination = altern.domainepublic.net vacarme.domainepublic.net
 mail.domainepublic.net, altern, localhost.localdomain, localhost

 This is a pure Postfix configuration issue by first look. See:
 http://www.postfix.org/VIRTUAL_README.html

 There it says: NEVER list a virtual alias domain name as a
 mydestination domain!

 virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf
 virtual_mailbox_base = /
 virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf
 virtual_minimum_uid = 1000
 virtual_transport = dovecot
 virtual_uid_maps = static:33

 mydestination = $myhostname, localhost.$mydomain
 virtual_mailbox_domains = altern.domainepublic.net,
 vacarme.domainepublic.net, mail.domainepublic.net

 Mailbox base does not look right too:
 virtual_mailbox_base = /var/mail/vmail (or whatever path you prefer)

I made the following changes but it does not solve my problem.

mydestination = $myhostname, localhost.$mydomain
virtual_mailbox_base = /var/alternc/mail

Thanks
Denis



Re: [Dovecot] Postfix : lda problem

2009-08-15 Thread Thomas Leuxner


Am 15.08.2009 um 16:51 schrieb denis:

I made the following changes but it does not solve my problem.

mydestination = $myhostname, localhost.$mydomain
virtual_mailbox_base = /var/alternc/mail


Did you also list your domains under: virtual_mailbox_domains ?


Re: [Dovecot] Postfix : lda problem

2009-08-15 Thread Sahil Tandon
On Sat, 15 Aug 2009, denis wrote:

 I come back with my problem:

Some notes are below, but because this is a purely Postfix problem, you
should NOT follow-up on this list.  If you continue to have problems, ask for
help on the Postfix mailing list.

 On debian lenny, using dovecot 1.1.13-2~bpo50+1 I try to configure my
 setup (with Postfix virtual
 domains) to use dovecot as lda but nothing happens, as if postfix not
 delegate to dovecot

This is because you never configured Postfix to delegate to Dovecot's LDA.

 I looked in the documentation and google, but I do not understand the
 problem.

It appears you did not look at the Postfix documentation.  According to
postconf(5), $virtual_transport specifies the default mail delivery transport
and next-hop destination for final delivery to domains listed with
$virtual_mailbox_domains.  I see you did not define this latter parameter
based on your 'postconf -n'.

-- 
Sahil Tandon sa...@tandon.net


Re: [Dovecot] Postfix : lda problem

2009-08-15 Thread denis
Thomas Leuxner a écrit :

 Am 15.08.2009 um 16:51 schrieb denis:
 I made the following changes but it does not solve my problem.

 mydestination = $myhostname, localhost.$mydomain
 virtual_mailbox_base = /var/alternc/mail

 Did you also list your domains under: virtual_mailbox_domains ?

Ok, by replacing virtual_maps = proxy:mysql:/etc/postfix/mydomain.cf to
virtual_mailbox_domains = mysql:/etc/postfix/mydomain.cf, it works !!!

But now, the problem is to set the good uid and gid which were defined
like this in postfix

virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf
virtual_uid_maps = static:33

With this configuration:

dovecot   unix  -   n   n   -   -   pipe
  flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -d $(recipient)

   socket listen {
 master {
   path = /var/run/dovecot/auth-master
   mode = 0660
   user = mail
   group = mail
   }

I get the following error message

Fatal: setgid(33(www-data)) failed with euid=8(mail), gid=8(mail),
egid=8(mail): Operation not permitted

Any ideas ?

Thanks
Denis



Re: [Dovecot] Postfix : lda problem

2009-08-15 Thread Charles Marcus
On 8/15/2009 9:22 AM, denis wrote:
 # ==
 # service type  private unpriv  chroot  wakeup  maxproc command + args
 #   (yes)   (yes)   (yes)   (never) (100)
 # ==
 smtp  inet  n   -   -   -   -   smtpd

snip

 dovecot   unix  -   n   n   -   -   pipe
   flags=DRhu user=www-data:www-data argv=/usr/lib/dovecot/deliver -d
 $(recipient)

Postfix is chrooted, dovecot LDA is not...

I think you have other problems, but this is definitely a major one.

-- 

Best regards,

Charles


Re: [Dovecot] Postfix : lda problem

2009-08-15 Thread Thomas Leuxner


Am 15.08.2009 um 18:52 schrieb denis:

virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf
virtual_uid_maps = static:33
You need to match the groups used by deliver in the master.cf (mail/ 
mail) or change them there. Try


virtual_gid_maps = static:8
virtual_uid_maps = static:8


dovecot   unix  -   n   n   -   -   pipe
 flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -d $ 
(recipient)



Fatal: setgid(33(www-data)) failed with euid=8(mail), gid=8(mail),
egid=8(mail): Operation not permitted