Re: virtual_alias_maps and pipe to command

2009-08-03 Thread /dev/rob0
On Monday 03 August 2009 15:27:40 David Zejda wrote:
 I have many mappings in virtual_alias_maps to other mail addresses, but
 I am not succesfull in aliasing to a command using the | in the form:

 virtal...@zejda.net   |/usr/bin/procmail /home/veronika/.procmailrc

That's because it was never implemented. Absence from the Postfix
documentation can be inferred to mean that the feature does not exist.

 If I try to add the entry to the alias_maps, I get:

You need to understand that alias_maps is ONLY used by the local(8)
delivery agent.

 Aug  3 22:18:14 o-it postfix/smtp[14594]: 1D1DC7FC2:
 to=al...@zejda.net, relay=127.0.0.1[127.0.0.1]:27, delay=0.94,
 delays=0.04/0.01/0.04/0.85, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued
 as 2B29180A3)
 Aug  3 22:18:14 o-it postfix/qmgr[14586]: 1D1DC7FC2: removed
 Aug  3 22:18:14 o-it postfix/virtual[14598]: 2B29180A3:
 to=al...@zejda.net, relay=virtual, delay=0.86,
 delays=0.85/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user:
 al...@zejda.net)

The address you gave it is using the virtual(8) delivery agent.

 Please, how can I let postfix to deliver to external command?
  ^
Incomplete question. Insert virtual mailbox addresses above. And BTW,
this is indeed a FAQ here, where did you look?

mydestination = [ ... what you needed before ... ], localhost,
localhost.$mydomain
virtual_alias_maps containing:
addr...@virtual_mailbox  al...@localhost
virtual_mailbox_maps containing:
addr...@virtual_mailbox  anything here
alias_maps containing:
alias:   |/path/to/your/command and arguments

See aliases(5) for the details of running commands from an alias. Offer
void where taxed or prohibited by law, or if you failed to build any
necessary files with postmap(1)/newaliases(1).

 postconf -n

 alias_maps = btree:/etc/postfix/aliases
 allow_mail_to_commands = alias,forward,include
 append_dot_mydomain = no

This setting removes the need for localhost.$mydomain as I gave you
above.

 bounce_size_limit = 64000
 command_directory = /usr/sbin
 config_directory = /etc/postfix
 content_filter = smtp:[127.0.0.1]:27
 daemon_directory = /usr/lib/postfix
 default_privs = neznamy

Know what this one means. See postconf.5.html#default_privs .

 local_recipient_maps =

Why?

 local_transport = virtual

No, take this out.

 mail_owner = postfix
 mydestination = $myhostname, $mydomain, btree:/etc/postfix/virtdomains

virtdomains included in mydestination? You seem to be very confused
here. Did you try to follow some HOWTO or tutorial which you did not
understand?

*If* you really need virtual mailboxes (small sites and beginners
generally do not!) you should follow the real documentation:
http://www.postfix.org/VIRTUAL_README.html
and understand the choices you have:
http://www.postfix.org/ADDRESS_CLASS_README.html

My guess is that you would have been better off forgetting about
virtual mailboxes and just using the BASIC_CONFIGURATION_README.
Virtual alias domains can easily provide namespace separation for
multiple domains, still using local(8) delivery.

 myhostname = smtp.o-it.info
 mynetworks = 127.0.0.0/8, 82.113.54.166/32, 81.92.145.161/32,
 192.168.30.136/32
 myorigin = $mydomain
 relay_domains = $mynetworks

Wrong. Most sites should just unset this. Anyway, $mynetworks is a
network list, not a domain list.

 smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
 smtpd_delay_reject = yes
 smtpd_recipient_restrictions = permit_mynetworkscheck_policy_service
 inet:127.0.0.1:6check_recipient_access
 btree:/etc/postfix/virtaccessreject

This looks very odd too. Is virtaccess what you used in place of
doing virtual_mailbox_domains/maps the documented way?

 transport_maps = btree:/etc/postfix/transport

Why? What's in here?

 virtual_alias_maps = btree:/etc/postfix/virtalias
 virtual_gid_maps = static:8

Such a low GID/UID is an unusual choice. Not necessarily wrong per se,
but you should know why you chose it.

 virtual_mailbox_base = /var/mail
 virtual_mailbox_maps = btree:/etc/postfix/virtmbox
 virtual_minimum_uid = 7
 virtual_uid_maps = btree:/etc/postfix/virtuid
-- 
Offlist mail to this address is discarded unless
/dev/rob0 or not-spam is in Subject: header


Re: virtual_alias_maps and pipe to command

2009-08-03 Thread David Zejda
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thank you for the extensive reply, you pointed me to look on the config
in whole more seriously and really, there were odd remains of
experiments from the past, which caused the behavior.. it seems, that
everything works OK now.

D.

/dev/rob0 napsal(a):
 On Monday 03 August 2009 15:27:40 David Zejda wrote:
 I have many mappings in virtual_alias_maps to other mail addresses, but
 I am not succesfull in aliasing to a command using the | in the form:

 virtal...@zejda.net  |/usr/bin/procmail /home/veronika/.procmailrc
 
 That's because it was never implemented. Absence from the Postfix
 documentation can be inferred to mean that the feature does not exist.
 
 If I try to add the entry to the alias_maps, I get:
 
 You need to understand that alias_maps is ONLY used by the local(8)
 delivery agent.
 
 Aug  3 22:18:14 o-it postfix/smtp[14594]: 1D1DC7FC2:
 to=al...@zejda.net, relay=127.0.0.1[127.0.0.1]:27, delay=0.94,
 delays=0.04/0.01/0.04/0.85, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued
 as 2B29180A3)
 Aug  3 22:18:14 o-it postfix/qmgr[14586]: 1D1DC7FC2: removed
 Aug  3 22:18:14 o-it postfix/virtual[14598]: 2B29180A3:
 to=al...@zejda.net, relay=virtual, delay=0.86,
 delays=0.85/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user:
 al...@zejda.net)
 
 The address you gave it is using the virtual(8) delivery agent.
 
 Please, how can I let postfix to deliver to external command?
   ^
 Incomplete question. Insert virtual mailbox addresses above. And BTW,
 this is indeed a FAQ here, where did you look?
 
 mydestination = [ ... what you needed before ... ], localhost,
   localhost.$mydomain
 virtual_alias_maps containing:
   addr...@virtual_mailbox  al...@localhost
 virtual_mailbox_maps containing:
   addr...@virtual_mailbox  anything here
 alias_maps containing:
   alias:   |/path/to/your/command and arguments
 
 See aliases(5) for the details of running commands from an alias. Offer
 void where taxed or prohibited by law, or if you failed to build any
 necessary files with postmap(1)/newaliases(1).
 
 postconf -n

 alias_maps = btree:/etc/postfix/aliases
 allow_mail_to_commands = alias,forward,include
 append_dot_mydomain = no
 
 This setting removes the need for localhost.$mydomain as I gave you
 above.
 
 bounce_size_limit = 64000
 command_directory = /usr/sbin
 config_directory = /etc/postfix
 content_filter = smtp:[127.0.0.1]:27
 daemon_directory = /usr/lib/postfix
 default_privs = neznamy
 
 Know what this one means. See postconf.5.html#default_privs .
 
 local_recipient_maps =
 
 Why?
 
 local_transport = virtual
 
 No, take this out.
 
 mail_owner = postfix
 mydestination = $myhostname, $mydomain, btree:/etc/postfix/virtdomains
 
 virtdomains included in mydestination? You seem to be very confused
 here. Did you try to follow some HOWTO or tutorial which you did not
 understand?
 
 *If* you really need virtual mailboxes (small sites and beginners
 generally do not!) you should follow the real documentation:
   http://www.postfix.org/VIRTUAL_README.html
 and understand the choices you have:
   http://www.postfix.org/ADDRESS_CLASS_README.html
 
 My guess is that you would have been better off forgetting about
 virtual mailboxes and just using the BASIC_CONFIGURATION_README.
 Virtual alias domains can easily provide namespace separation for
 multiple domains, still using local(8) delivery.
 
 myhostname = smtp.o-it.info
 mynetworks = 127.0.0.0/8, 82.113.54.166/32, 81.92.145.161/32,
 192.168.30.136/32
 myorigin = $mydomain
 relay_domains = $mynetworks
 
 Wrong. Most sites should just unset this. Anyway, $mynetworks is a
 network list, not a domain list.
 
 smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
 smtpd_delay_reject = yes
 smtpd_recipient_restrictions = permit_mynetworkscheck_policy_service
 inet:127.0.0.1:6check_recipient_access
 btree:/etc/postfix/virtaccessreject
 
 This looks very odd too. Is virtaccess what you used in place of
 doing virtual_mailbox_domains/maps the documented way?
 
 transport_maps = btree:/etc/postfix/transport
 
 Why? What's in here?
 
 virtual_alias_maps = btree:/etc/postfix/virtalias
 virtual_gid_maps = static:8
 
 Such a low GID/UID is an unusual choice. Not necessarily wrong per se,
 but you should know why you chose it.
 
 virtual_mailbox_base = /var/mail
 virtual_mailbox_maps = btree:/etc/postfix/virtmbox
 virtual_minimum_uid = 7
 virtual_uid_maps = btree:/etc/postfix/virtuid
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkp3Z5oACgkQ3oCkkciamVF5PgCfU96TqJlTOf/HGTS0YQIXiomq
NX8Anik8BZIOmp/7MV6JNpv1WKwy2gfa
=Odrx
-END PGP SIGNATURE-