Postoffice with virtual mailbox and a Maildrop issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Postoffice with virtual mailbox and a Maildrop issue

Scappatura Rocco
Hello,

I'm setting up a postoffice platform based on
Postfix+Courier-authlib-Courier-IMAP-Maildrop.

Here my postfix parameters:

# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
append_at_myorigin = no
append_dot_mydomain = no
bounce_size_limit = 1
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
disable_vrfy_command = yes
html_directory = no
local_recipient_maps = $alias_maps, unix:passwd.byname
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 35840000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = posta.domain.tld
myhostname = posta.domain.tld
mynetworks = xxx.yyy.zzz.uuu/27, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
proxy_read_maps = $virtual_mailbox_domains $virtual_alias_maps
$virtual_mailbox_maps proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
proxy:mysql:/etc/postfix/mysql-virtual-alias.cf
proxy:mysql:/etc/postfix/mysql-virtual-mailbox.cf
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_etrn_restrictions = reject
smtpd_helo_required = yes
smtpd_sasl_auth_enable = no
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual-alias.cf
virtual_gid_maps = static:1021
virtual_mailbox_base = /home/virtual
virtual_mailbox_domains =
proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual-mailbox.cf
virtual_transport = maildrop
virtual_uid_maps = static:1021

I have the problem that mail destined to local virtual mailbox is not
delivered locally, even if all looks up succesfully confirm tha the
message have to be delivered locally:

# postmap -q  [hidden email]
proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
receiver.tld

# postmap -q  test@ receiver.tld
proxy:mysql:/etc/postfix/mysql-virtual-alias.cf
test@ receiver.tld

# postmap -q  [hidden email]
proxy:mysql:/etc/postfix/mysql-virtual-mailbox.cf
receiver.tld /test@ receiver.tld/

Indeed it could  be a matter of maildrop filter:

maildrop  unix  -       n       n       -       -       pipe
        flags=Ru user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

But I have also tried to disable it (commenting the lines above in
/etc/postfix/master.cf and commenting the interested lines in
/etc/postfix/main.cf).

Where is the mistake?

Thanks

rocsca
Reply | Threaded
Open this post in threaded view
|

Re: Postoffice with virtual mailbox and a Maildrop issue

Magnus Bäck
On Friday, March 06, 2009 at 18:15 CET,
     Rocco Scappatura <[hidden email]> wrote:

[...]

> append_at_myorigin = no

This is not supported by Postfix. Use it at your own peril.

[...]

> I have the problem that mail destined to local virtual mailbox is not
> delivered locally, even if all looks up succesfully confirm tha the
> message have to be delivered locally:

So what does happen to the messages?

> # postmap -q  [hidden email]
> proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
> receiver.tld

virtual_mailbox_domains is looked up with the domain name as the key,
not the email address. Show the output from the right command.

[...]

> Indeed it could  be a matter of maildrop filter:
>
> maildrop  unix  -       n       n       -       -       pipe
>         flags=Ru user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
>
> But I have also tried to disable it (commenting the lines above
> in /etc/postfix/master.cf and commenting the interested lines in
> /etc/postfix/main.cf).

Disabling an unused service seldom makes any difference.

--
Magnus Bäck
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Postoffice with virtual mailbox and a Maildrop issue

Scappatura Rocco
Thanks Magnus,

>> append_at_myorigin = no

deleted.

>> I have the problem that mail destined to local virtual mailbox is not
>> delivered locally, even if all looks up succesfully confirm tha the
>> message have to be delivered locally:
>
> So what does happen to the messages?

At the moment, I'm configuring the platform, so the messages tries to go
to the mail server pointed out by the MX for the domain "receiver.tld":

Mar  7 10:06:01 mail1 postfix/smtpd[14046]: connect from
gw.tld[xxx.yyy.zzz.uuu]
Mar  7 10:06:01 mail1 postfix/smtpd[14046]: EF43674001:
client=gw.tld[xxx.yyy.zzz.uuu]
Mar  7 10:06:01 mail1 postfix/cleanup[14049]: EF43674001:
message-id=<[hidden email]>
Mar  7 10:06:02 mail1 postfix/smtpd[14046]: disconnect from
gw.tld[xxx.yyy.zzz.uuu]
Mar  7 10:06:02 mail1 postfix/qmgr[13967]: EF43674001:
from=<[hidden email]>, size=2893, nrcpt=1 (queue active)
Mar  7 10:06:02 mail1 postfix/pickup[13966]: 2A6A174002: uid=7011
from=<[hidden email]>
Mar  7 10:06:02 mail1 postfix/cleanup[14049]: 2A6A174002:
message-id=<[hidden email]>
Mar  7 10:06:02 mail1 postfix/pipe[14050]: EF43674001: to=<Mar  7 10:06:01
mail1 postfix/smtpd[14046]: connect from gw.tld[xxx.yyy.zzz.uuu]
Mar  7 10:06:01 mail1 postfix/smtpd[14046]: EF43674001:
client=gw.tld[xxx.yyy.zzz.uuu]
Mar  7 10:06:01 mail1 postfix/cleanup[14049]: EF43674001:
message-id=<[hidden email]>
Mar  7 10:06:02 mail1 postfix/smtpd[14046]: disconnect from
gw.tld[xxx.yyy.zzz.uuu]
Mar  7 10:06:02 mail1 postfix/qmgr[13967]: EF43674001:
from=<[hidden email]>, size=2893, nrcpt=1 (queue active)
Mar  7 10:06:02 mail1 postfix/pickup[13966]: 2A6A174002: uid=7011
from=<[hidden email]>
Mar  7 10:06:02 mail1 postfix/cleanup[14049]: 2A6A174002:
message-id=<[hidden email]>
Mar  7 10:06:02 mail1 postfix/pipe[14050]: EF43674001:
to=<[hidden email]>, relay=filter, delay=0.2, delays=0.04/0/0/0.16,
dsn=2.0.0, status=sent (delivered via filter service)
Mar  7 10:06:02 mail1 postfix/qmgr[13967]: EF43674001: removed
Mar  7 10:06:02 mail1 postfix/qmgr[13967]: 2A6A174002:
from=<[hidden email]>, size=3006, nrcpt=1 (queue active)
Mar  7 10:06:05 mail1 postfix/smtp[14061]: connect to
mx1.for.domain.tld[xxx1.yyy.zzz.uuu]:25: No route to host
Mar  7 10:06:08 mail1 postfix/smtp[14061]: connect to
mx2.for.domain.tld[xxx2.yyy.zzz.uuu]:25: No route to host
Mar  7 10:06:08 mail1 postfix/smtp[14061]: 2A6A174002:
to=<[hidden email]>, relay=none, delay=6.1, delays=0.08/0/6/0, dsn=4.4.1,
status=deferred (connect to mx1.for.domain.tld[xxx1.yyy.zzz.uuu]:25: No
route to host)
>, relay=filter, delay=0.2, delays=0.04/0/0/0.16, dsn=2.0.0, status=sent
(delivered via filter service)
Mar  7 10:06:02 mail1 postfix/qmgr[13967]: EF43674001: removed
Mar  7 10:06:02 mail1 postfix/qmgr[13967]: 2A6A174002:
from=<[hidden email]>, size=3006, nrcpt=1 (queue active)
Mar  7 10:06:05 mail1 postfix/smtp[14061]: connect to
mx1.for.domain.tld[xxx1.yyy.zzz.uuu]:25: No route to host
Mar  7 10:06:08 mail1 postfix/smtp[14061]: connect to
mx2.for.domain.tld[xxx2.yyy.zzz.uuu]:25: No route to host
Mar  7 10:06:08 mail1 postfix/smtp[14061]: 2A6A174002:
to=<[hidden email]>, relay=none, delay=6.1, delays=0.08/0/6/0, dsn=4.4.1,
status=deferred (connect to mx1.for.domain.tld[xxx1.yyy.zzz.uuu]:25: No
route to host)

Indeed, I'm using a vacation filter too. But, as there is no vacation
configured for recipient [hidden email], the message should be delivered
in (local) virtual mailbox after vacation filter. Instead, I suspect that
the dns is looked up and the message is tried to be delivered to the
responsible MX for domain "domain.tld" (mx1.for.domain.tld and
mx2.for.domain.tld, which is not reacheable from the network on which I
setting up the postoffice).

Why the message is not delivered immediately to the virtual mailbox after
vacation filter?

>> # postmap -q  [hidden email]
>> proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
>> receiver.tld
>
> virtual_mailbox_domains is looked up with the domain name as the key,
> not the email address. Show the output from the right command.

# postmap -q domain.tld proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
#

:-(

But:

# cat /etc/postfix/mysql-virtual-domain.cf
.
.
query = select domain from domain where domain = '%d' and active = 1

return me correctly:

+----------------+
| domain         |
+----------------+
| domain.tld     |
+----------------+

mmmhhh!?!?!?

rocsca

Reply | Threaded
Open this post in threaded view
|

Re: Postoffice with virtual mailbox and a Maildrop issue

mouss-4
Rocco Scappatura a écrit :
> [snip]
> Why the message is not delivered immediately to the virtual mailbox after
> vacation filter?
>

because the domain is not listed as a virtual mailbox domain

>>> # postmap -q  [hidden email]
>>> proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
>>> receiver.tld
>> virtual_mailbox_domains is looked up with the domain name as the key,
>> not the email address. Show the output from the right command.
>
> # postmap -q domain.tld proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
> #
>
> :-(
>
> But:
>
> # cat /etc/postfix/mysql-virtual-domain.cf
> .
> .
> query = select domain from domain where domain = '%d' and active = 1
>
> return me correctly:
>
> +----------------+
> | domain         |
> +----------------+
> | domain.tld     |
> +----------------+
>
> mmmhhh!?!?!?

you'll need to make sure you run the right sql queries when testing and
that your .cf has the right hosts, user, ... etc.

Reply | Threaded
Open this post in threaded view
|

RE: Postoffice with virtual mailbox and a Maildrop issue

Scappatura Rocco
Thanks mouss,
 
> Rocco Scappatura a écrit :
> > [snip]
> > Why the message is not delivered immediately to the virtual mailbox
> after
> > vacation filter?
> >
>
> because the domain is not listed as a virtual mailbox domain

At first glance, I shoud say as above too, but I swear that the query is exactly the one I have reported.
 

> >>> # postmap -q  [hidden email]
> >>> proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
> >>> receiver.tld
> >> virtual_mailbox_domains is looked up with the domain name as the
> key,
> >> not the email address. Show the output from the right command.
> >
> > # postmap -q domain.tld proxy:mysql:/etc/postfix/mysql-virtual-
> domain.cf
> > #
> >
> > :-(
> >
> > But:
> >
> > # cat /etc/postfix/mysql-virtual-domain.cf
> > .
> > .
> > query = select domain from domain where domain = '%d' and active = 1
> >
> > return me correctly:
> >
> > +----------------+
> > | domain         |
> > +----------------+
> > | domain.tld     |
> > +----------------+
> >
> > mmmhhh!?!?!?
>
> you'll need to make sure you run the right sql queries when testing and
> that your .cf has the right hosts, user, ... etc.

Also the db configuration parameter in postfix configuration files are correct..

What you suggestme to check?

PS: I have tried also to check maildrop:

mail1:~ # maildrop -V9 -d [hidden email]
maildrop: authlib: groupid=1021
maildrop: authlib: userid=1021
maildrop: authlib: logname= [hidden email], home=/home/virtual/, mail= receiver.tld /[hidden email]/
maildrop: Changing to /home/virtual/
Message start at 0 bytes, envelope sender=@receiver.tld
Tokenized logfile
Tokenized string: "/var/log/maildrop.log"
Tokenized ;
Tokenized string: "$HOME/$DEFAULT"
Tokenized ;
Tokenized exception
Tokenized {
Tokenized ;
Tokenized string: "TO"
Tokenized string: "$HOME$DEFAULT"
Tokenized ;
Tokenized }
Tokenized ;
Tokenized log
Tokenized string: "/usr/local/bin/maildirmake $HOME$DEFAULT"
Tokenized ;
Tokenized string: `/usr/local/bin/maildirmake $HOME$DEFAULT`
Tokenized ;
Tokenized log
Tokenized string: "/usr/local/bin/maildirmake -q $MAILDIRQUOTA $HOME$DEFAULT"
Tokenized ;
Tokenized string: `/usr/local/bin/maildirmake -q $MAILDIRQUOTA $HOME$DEFAULT`
Tokenized ;
Tokenized string: "TO"
Tokenized string: "$HOME$DEFAULT"
Tokenized ;
Tokenized eof
/etc/maildroprc(1): Opening logfile /var/log/maildrop.log
/etc/maildroprc(3): Trapping exceptions.
/etc/maildroprc(3): Exception trapping removed.
maildrop: Filtering through `/usr/local/bin/maildirmake $HOME$DEFAULT`
maildirmake: /home/virtual/receiver.tld/[hidden email]/: File exists
maildrop: Filtering through `/usr/local/bin/maildirmake -q $MAILDIRQUOTA $HOME$DEFAULT`
maildrop: Attempting .mailfilter

It's seems that all works fine..

Thanks,

rocsca
Reply | Threaded
Open this post in threaded view
|

RE: Postoffice with virtual mailbox and a Maildrop issue [SOLVED]

Scappatura Rocco
Hello,

> > Rocco Scappatura a écrit :
> > > [snip]
> > > Why the message is not delivered immediately to the virtual mailbox
> > after
> > > vacation filter?
> > >
> >
> > because the domain is not listed as a virtual mailbox domain
>
> At first glance, I shoud say as above too, but I swear that the query
> is exactly the one I have reported.
>
> > >>> # postmap -q  [hidden email]
> > >>> proxy:mysql:/etc/postfix/mysql-virtual-domain.cf
> > >>> receiver.tld
> > >> virtual_mailbox_domains is looked up with the domain name as the
> > key,
> > >> not the email address. Show the output from the right command.
> > >
> > > # postmap -q domain.tld proxy:mysql:/etc/postfix/mysql-virtual-
> > domain.cf
> > > #
> > >
> > > :-(
> > >
> > > But:
> > >
> > > # cat /etc/postfix/mysql-virtual-domain.cf
> > > .
> > > .
> > > query = select domain from domain where domain = '%d' and active =
> 1
> > >
> > > return me correctly:
> > >
> > > +----------------+
> > > | domain         |
> > > +----------------+
> > > | domain.tld     |
> > > +----------------+
> > >
> > > mmmhhh!?!?!?
> >
> > you'll need to make sure you run the right sql queries when testing
> and
> > that your .cf has the right hosts, user, ... etc.
>
> Also the db configuration parameter in postfix configuration files are
> correct..

Not completely.. Infact, I have read carefully mysql_table man and I see that the right query is:

query = select domain from domain where domain = '%s' and active = 1

because postfix evidently passes the domain part of the recipient for lookup.. while I erroneously thought the the entire recipient was looked up..

I'm sorry,

rocsca