Re: relocation of virtual_transport settings to master.cf service

2012-03-19 Thread mouss
Le 14/03/2012 03:53, b...@bitrate.net a écrit :
 On Mar 13, 2012, at 17.01, mouss wrote:
 
 Le 13/03/2012 19:07, b...@bitrate.net a écrit :
 i've been experimenting with delivery for the virtual domain class to 
 dovecot via lmtp - e.g.

 postconf virtual_transport
 virtual_transport = lmtp:[localhost]:lmtp-deliver

 this works fine.

 out of curiosity, i wondered if the particulars could be somehow moved into 
 a service definition in master.cf - e.g.

 virtual_transport = dovecot

 yes, you can define a transport in master.cf and use it in main.cf. so
 you can define

 joerunsfast ... smtp
  -o var=val
  ...

 and use that in main.cf:

 foo_transport = joerunsfast

 you can even define parameters for that transport:


 joerunsfast_variable = value

 in your main.cf, as far as variable applies to a transport (transports
 inherit from: smtp, lmtp, pipe, ... )


 $ cat master.cf
 ...
 # Dovecot LDA
 dovecot unix-   n   n   -   -  pipe
   flags=DRhu user=_mailbox
   argv=/usr/local/libexec/dovecot/deliver
   -d ${user}@${domain} -n -m ${extension}
 ...

 $ grep dovecot main.cf
 virtual_transport = dovecot
 dovecot_destination_recipient_limit = 1
 deliver_command = /usr/local/libexec/dovecot/deliver
 …
 
 yes, this part i think i understand - the difficulty i'm having is with 
 determining which parameters i can pass to lmtp to accomplish this.  i'm 
 effectively looking for what i would consider the equivalent to 
 virtual_transport=lmtp:[localhost]:lmtp-deliver - but reading through the 
 smtp/lmtp and others man pages and experimenting a bit, i've not been able to 
 figure out what parameter might provide for this.
 

 and then somehow in master.cf a parameter to the lmtp service named 
 dovecot, specifying [localhost]:lmtp-deliver


 not that way:) it's transport:[nexthop], not [nexthop]:transport...
 man smtp, lmtp, pipe, …
 
 sorry, i probably should have been more literal here, given the context.  
 [localhost] is the nexthop, and lmtp-deliver is the port [10026 in this case, 
 by way of the system's services database].  i omitted the leading transport 
 here [lmtp] in an attempt to illustrate that the data would be a parameter 
 passed to lmtp.
 

 so far, given the various portions of the documentation i've referenced and 
 the iterations i've tried, the answer appears to be no, but i wondered if i 
 might be missing something.


 I won't debate this now, but it seems to me that all this is documented.
 anyway, postfix supports custom transports, and they are used in many
 places. examples:

 - spam filtering: things like:
 amavis . smtp
  -o blah=blah
  ...


 - delivery: things like
 dovecot ... pipe
  -o blah=blah
 
 therein lies my fundamental question, i guess.  having read the documentation 
 for lmtp(8), transport(5), master(5) and probably a few others i'm forgetting 
 - if i'm being blind to the relevant lmtp parameters, i'm hopeful i might 
 glean some enlightenment, or if not, just a confirmation that this particular 
 exercise isn't possible.



as per
http://www.postfix.org/lmtp.8.html
you can specify lmtp_port (default is 24). so you could do
 -o lmtp_port=10026


now, you'd better explain what real problem you are trying to solve.
describe it in in the problem domain, not in the solution domain
(ideally, describe it in a postfix independent manner).


Re: relocation of virtual_transport settings to master.cf service

2012-03-19 Thread btb

On 2012.03.19 02.34, mouss wrote:

Le 14/03/2012 03:53, b...@bitrate.net a écrit :

On Mar 13, 2012, at 17.01, mouss wrote:


Le 13/03/2012 19:07, b...@bitrate.net a écrit :

i've been experimenting with delivery for the virtual domain
class to dovecot via lmtp - e.g.


postconf virtual_transport

virtual_transport = lmtp:[localhost]:lmtp-deliver

this works fine.

out of curiosity, i wondered if the particulars could be
somehow moved into a service definition in master.cf - e.g.

virtual_transport = dovecot


yes, you can define a transport in master.cf and use it in
main.cf. so you can define

joerunsfast ... smtp -o var=val ...

and use that in main.cf:

foo_transport = joerunsfast

you can even define parameters for that transport:


joerunsfast_variable = value

in your main.cf, as far as variable applies to a transport
(transports inherit from: smtp, lmtp, pipe, ... )


$ cat master.cf ... # Dovecot LDA dovecot unix-   n
n   -   -  pipe flags=DRhu user=_mailbox
argv=/usr/local/libexec/dovecot/deliver -d ${user}@${domain} -n
-m ${extension} ...

$ grep dovecot main.cf virtual_transport = dovecot
dovecot_destination_recipient_limit = 1 deliver_command =
/usr/local/libexec/dovecot/deliver …


yes, this part i think i understand - the difficulty i'm having is
with determining which parameters i can pass to lmtp to accomplish
this.  i'm effectively looking for what i would consider the
equivalent to virtual_transport=lmtp:[localhost]:lmtp-deliver - but
reading through the smtp/lmtp and others man pages and
experimenting a bit, i've not been able to figure out what
parameter might provide for this.



and then somehow in master.cf a parameter to the lmtp service
named dovecot, specifying [localhost]:lmtp-deliver



not that way:) it's transport:[nexthop], not
[nexthop]:transport... man smtp, lmtp, pipe, …


sorry, i probably should have been more literal here, given the
context.  [localhost] is the nexthop, and lmtp-deliver is the port
[10026 in this case, by way of the system's services database].  i
omitted the leading transport here [lmtp] in an attempt to
illustrate that the data would be a parameter passed to lmtp.



so far, given the various portions of the documentation i've
referenced and the iterations i've tried, the answer appears to
be no, but i wondered if i might be missing something.



I won't debate this now, but it seems to me that all this is
documented. anyway, postfix supports custom transports, and they
are used in many places. examples:

- spam filtering: things like: amavis . smtp -o blah=blah
...


- delivery: things like dovecot ... pipe -o blah=blah


therein lies my fundamental question, i guess.  having read the
documentation for lmtp(8), transport(5), master(5) and probably a
few others i'm forgetting - if i'm being blind to the relevant lmtp
parameters, i'm hopeful i might glean some enlightenment, or if
not, just a confirmation that this particular exercise isn't
possible.




as per http://www.postfix.org/lmtp.8.html you can specify lmtp_port
(default is 24). so you could do -o lmtp_port=10026


now, you'd better explain what real problem you are trying to solve.
describe it in in the problem domain, not in the solution domain
(ideally, describe it in a postfix independent manner).


that actually is the real problem i'm trying to solve.  right now, i'm 
using virtual_transport = lmtp:[localhost]:lmtp-deliver, and this works 
fine.  i'm just curious if i can move the settings to master.cf.  it's 
just an exercise in learning for me.  if it isn't possible, it's fine, 
mail will still be delivered to localhost, on port 10026, via lmtp, as is.


Re: relocation of virtual_transport settings to master.cf service

2012-03-19 Thread Noel Jones
On 3/19/2012 7:36 AM, btb wrote:

 that actually is the real problem i'm trying to solve.  right now,
 i'm using virtual_transport = lmtp:[localhost]:lmtp-deliver, and
 this works fine.  i'm just curious if i can move the settings to
 master.cf.  it's just an exercise in learning for me.  if it isn't
 possible, it's fine, mail will still be delivered to localhost, on
 port 10026, via lmtp, as is.

Not every piece of postfix uses every parameter.  You can read the
man page for each of the postfix components to see what parameter
are used.

I believe the virtual(8) delivery agent is the only program that
uses virtual_transport, so that's the only place in master.cf that
you could put -o virtual_transport=...' and expect it to have an
effect.


  -- Noel Jones


Re: relocation of virtual_transport settings to master.cf service

2012-03-19 Thread Wietse Venema
Noel Jones:
 On 3/19/2012 7:36 AM, btb wrote:
 
  that actually is the real problem i'm trying to solve.  right now,
  i'm using virtual_transport = lmtp:[localhost]:lmtp-deliver, and
  this works fine.  i'm just curious if i can move the settings to
  master.cf.  it's just an exercise in learning for me.  if it isn't
  possible, it's fine, mail will still be delivered to localhost, on
  port 10026, via lmtp, as is.
 
 Not every piece of postfix uses every parameter.  You can read the
 man page for each of the postfix components to see what parameter
 are used.
 
 I believe the virtual(8) delivery agent is the only program that
 uses virtual_transport, so that's the only place in master.cf that
 you could put -o virtual_transport=...' and expect it to have an
 effect.

Minor correction: domains that match $virtual_mailbox_domains will
be delivered to $virtual_transport (and recipients will be validated
with $virtual_mailbox_maps). The logic for this resides mostly in
the trivial-rewrite daemon.

Wietse


Re: relocation of virtual_transport settings to master.cf service

2012-03-19 Thread Viktor Dukhovni
On Mon, Mar 19, 2012 at 11:14:19AM -0500, Noel Jones wrote:

 I believe the virtual(8) delivery agent is the only program that
 uses virtual_transport, so that's the only place in master.cf that
 you could put -o virtual_transport=...' and expect it to have an
 effect.

In fact it is trivial-rewrite(8), not virtual(8). There is no point
in setting:

local_transport
virtual_transport
relay_transport
default_transport

in master.cf, since these settings are effectively global, there
is only one queue manager which makes transport decisions, and qmgr
consults a single trivial-rewrite service.

-- 
Viktor.


Re: relocation of virtual_transport settings to master.cf service

2012-03-19 Thread /dev/rob0
The Subject: is misleading. The OP wants merely to shorten this 
working setting:

 postconf virtual_transport
 virtual_transport = lmtp:[localhost]:lmtp-deliver
 
 this works fine.

... to something like this:

 out of curiosity, i wondered if the particulars could be
 somehow moved into a service definition in master.cf - e.g.
 
 virtual_transport = dovecot

But since the actual transport is lmtp(8), it appears that this 
cannot be done. As mouss pointed out:

 as per http://www.postfix.org/lmtp.8.html you can specify 
 lmtp_port (default is 24). so you could do -o lmtp_port=10026

and with a master.cf entry:

dovecotunix  -   -   n   -   -   lmtp
-o lmtp_port=10026

He can use virtual_transport = dovecot:[localhost] (If this is the 
only use of lmtp, lmtp_port=10026 could as well be set in main.cf.)

One final trick is possible: a DNS hack such that any domains which 
would be delivered by this virtual_transport all resolve with an MX 
record pointing to localhost.

In fact if the Dovecot LMTP port is listening on the external IP 
address[es], this might work without a DNS hack. I'm not sure if 
that would cause a loops back to myself error, however.
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if /dev/rob0 is in the Subject:


Re: relocation of virtual_transport settings to master.cf service

2012-03-13 Thread mouss
Le 13/03/2012 19:07, b...@bitrate.net a écrit :
 i've been experimenting with delivery for the virtual domain class to dovecot 
 via lmtp - e.g.
 
 postconf virtual_transport
 virtual_transport = lmtp:[localhost]:lmtp-deliver
 
 this works fine.
 
 out of curiosity, i wondered if the particulars could be somehow moved into a 
 service definition in master.cf - e.g.
 
 virtual_transport = dovecot

yes, you can define a transport in master.cf and use it in main.cf. so
you can define

joerunsfast ... smtp
-o var=val
...

and use that in main.cf:

foo_transport = joerunsfast

you can even define parameters for that transport:


joerunsfast_variable = value

in your main.cf, as far as variable applies to a transport (transports
inherit from: smtp, lmtp, pipe, ... )


$ cat master.cf
...
# Dovecot LDA
dovecot unix-   n   n   -   -  pipe
flags=DRhu user=_mailbox
argv=/usr/local/libexec/dovecot/deliver
-d ${user}@${domain} -n -m ${extension}
...

$ grep dovecot main.cf
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
deliver_command = /usr/local/libexec/dovecot/deliver
...


 
 and then somehow in master.cf a parameter to the lmtp service named dovecot, 
 specifying [localhost]:lmtp-deliver


not that way:) it's transport:[nexthop], not [nexthop]:transport...
man smtp, lmtp, pipe, ...


 
 so far, given the various portions of the documentation i've referenced and 
 the iterations i've tried, the answer appears to be no, but i wondered if i 
 might be missing something.
 

I won't debate this now, but it seems to me that all this is documented.
anyway, postfix supports custom transports, and they are used in many
places. examples:

- spam filtering: things like:
amavis . smtp
-o blah=blah
...


- delivery: things like
dovecot ... pipe
-o blah=blah



 thanks
 -ben



Re: relocation of virtual_transport settings to master.cf service

2012-03-13 Thread btb
On Mar 13, 2012, at 17.01, mouss wrote:

 Le 13/03/2012 19:07, b...@bitrate.net a écrit :
 i've been experimenting with delivery for the virtual domain class to 
 dovecot via lmtp - e.g.
 
 postconf virtual_transport
 virtual_transport = lmtp:[localhost]:lmtp-deliver
 
 this works fine.
 
 out of curiosity, i wondered if the particulars could be somehow moved into 
 a service definition in master.cf - e.g.
 
 virtual_transport = dovecot
 
 yes, you can define a transport in master.cf and use it in main.cf. so
 you can define
 
 joerunsfast ... smtp
   -o var=val
   ...
 
 and use that in main.cf:
 
 foo_transport = joerunsfast
 
 you can even define parameters for that transport:
 
 
 joerunsfast_variable = value
 
 in your main.cf, as far as variable applies to a transport (transports
 inherit from: smtp, lmtp, pipe, ... )
 
 
 $ cat master.cf
 ...
 # Dovecot LDA
 dovecot unix-   n   n   -   -  pipe
   flags=DRhu user=_mailbox
   argv=/usr/local/libexec/dovecot/deliver
   -d ${user}@${domain} -n -m ${extension}
 ...
 
 $ grep dovecot main.cf
 virtual_transport = dovecot
 dovecot_destination_recipient_limit = 1
 deliver_command = /usr/local/libexec/dovecot/deliver
 …

yes, this part i think i understand - the difficulty i'm having is with 
determining which parameters i can pass to lmtp to accomplish this.  i'm 
effectively looking for what i would consider the equivalent to 
virtual_transport=lmtp:[localhost]:lmtp-deliver - but reading through the 
smtp/lmtp and others man pages and experimenting a bit, i've not been able to 
figure out what parameter might provide for this.

 
 and then somehow in master.cf a parameter to the lmtp service named dovecot, 
 specifying [localhost]:lmtp-deliver
 
 
 not that way:) it's transport:[nexthop], not [nexthop]:transport...
 man smtp, lmtp, pipe, …

sorry, i probably should have been more literal here, given the context.  
[localhost] is the nexthop, and lmtp-deliver is the port [10026 in this case, 
by way of the system's services database].  i omitted the leading transport 
here [lmtp] in an attempt to illustrate that the data would be a parameter 
passed to lmtp.

 
 so far, given the various portions of the documentation i've referenced and 
 the iterations i've tried, the answer appears to be no, but i wondered if i 
 might be missing something.
 
 
 I won't debate this now, but it seems to me that all this is documented.
 anyway, postfix supports custom transports, and they are used in many
 places. examples:
 
 - spam filtering: things like:
 amavis . smtp
   -o blah=blah
   ...
 
 
 - delivery: things like
 dovecot ... pipe
   -o blah=blah

therein lies my fundamental question, i guess.  having read the documentation 
for lmtp(8), transport(5), master(5) and probably a few others i'm forgetting - 
if i'm being blind to the relevant lmtp parameters, i'm hopeful i might glean 
some enlightenment, or if not, just a confirmation that this particular 
exercise isn't possible.