Re: multi instance support bug (env not found)

2009-06-05 Thread Charles Seeger
| "type" is a built-in in POSIX shells, and even the pre-historic SunOS
| /bin/sh has a "type" built-in, be it a bare-bones version that does not
| support the "-p" switch, that is sufficient. So another possibility is:
| 
| set -- `type find`
| shift `expr $# - 1`
| # Now, $1 is the full path of "find".
| # ...

FYI, the expr (which will cost an extra fork/exec in Bourne sh and ksh88)
can be avoided easily:

set -- `type find`
set -- $# "${@:-}"
shift $1
# Now, $1 is the full path of "find".

One may wish to check type's return code, as well. 

Best,
Chuck



Re: Howto bounce a message in queue

2009-06-05 Thread Terry Carmen

> Noel Jones wrote:
>> At 03:24 PM 2/7/2007, Dick Middleton wrote:
>>> Is it possible to manually "bounce"  a message in the deferred queue
>>> so preempting the normal retry/timeout period?
>>>
>>> I've got a message sitting in the queue trying to connect to a
>>> non-existent server.  The sooner it gets bounced back to originator
>>> the better,
>>
>> If these are the result of a user mis-typing a domain, add the bad
>> domain to your transport map and requeue the message with postsuper -r
>> QUEUEID.
>> # transport
>> hotmal.com  error:invalid domain "hotmal.com"  maybe try "hotmail.com"
>> instead.
>>
>> If these are the result of bouncing undeliverable mail, you need to
>> implement proper recipient validation so invalid recipients are rejected
>> during SMTP.
>>
>
> Sorry to bump such an old topic but this fits what I'm trying to learn
> to do on a system that focuses on sending outbound traffic using v2.5.5.
>
> I did read "man transport" and searched list archives but I just don't
> seem to be getting all the pieces right. . . . I have a transport file
> and I've postmapped it. Does an additional directive go in main.cf or
> master.cf and what might that look like when implemented?
>

Add an entry like:

"verision.net error:Invalid Domain Name. did you mean verizon.net?"

To /etc/postfix/transport, then requeue the message as described above.

Terry

-- 
CNY Support, LLC
Web. Database. Business
http://www.cnysupport.com




Re: Howto bounce a message in queue

2009-06-05 Thread Noel Jones

Jon wrote:

Noel Jones wrote:

At 03:24 PM 2/7/2007, Dick Middleton wrote:
Is it possible to manually "bounce"  a message in the deferred queue 
so preempting the normal retry/timeout period?


I've got a message sitting in the queue trying to connect to a 
non-existent server.  The sooner it gets bounced back to originator 
the better,


If these are the result of a user mis-typing a domain, add the bad 
domain to your transport map and requeue the message with postsuper -r 
QUEUEID.

# transport
hotmal.com  error:invalid domain "hotmal.com"  maybe try "hotmail.com" 
instead.


If these are the result of bouncing undeliverable mail, you need to 
implement proper recipient validation so invalid recipients are 
rejected during SMTP.




Sorry to bump such an old topic but this fits what I'm trying to learn 
to do on a system that focuses on sending outbound traffic using v2.5.5.


I did read "man transport" and searched list archives but I just don't 
seem to be getting all the pieces right. . . . I have a transport file 
and I've postmapped it. Does an additional directive go in main.cf or 
master.cf and what might that look like when implemented?


Yes, your main.cf must list the transport_maps directive.
http://www.postfix.org/postconf.5.html#transport_maps

Typically something like:
# main.cf
transport_maps = hash:/etc/postfix/transport

  -- Noel Jones


Re: Howto bounce a message in queue

2009-06-05 Thread Jon

Noel Jones wrote:

At 03:24 PM 2/7/2007, Dick Middleton wrote:
Is it possible to manually "bounce"  a message in the deferred queue 
so preempting the normal retry/timeout period?


I've got a message sitting in the queue trying to connect to a 
non-existent server.  The sooner it gets bounced back to originator 
the better,


If these are the result of a user mis-typing a domain, add the bad 
domain to your transport map and requeue the message with postsuper -r 
QUEUEID.

# transport
hotmal.com  error:invalid domain "hotmal.com"  maybe try "hotmail.com" 
instead.


If these are the result of bouncing undeliverable mail, you need to 
implement proper recipient validation so invalid recipients are rejected 
during SMTP.




Sorry to bump such an old topic but this fits what I'm trying to learn 
to do on a system that focuses on sending outbound traffic using v2.5.5.


I did read "man transport" and searched list archives but I just don't 
seem to be getting all the pieces right. . . . I have a transport file 
and I've postmapped it. Does an additional directive go in main.cf or 
master.cf and what might that look like when implemented?


Re: multi instance support bug (env not found)

2009-06-05 Thread Victor Duchovni
On Fri, Jun 05, 2009 at 03:30:55PM -0400, Rob Foehl wrote:

> Surprisingly enough, which isn't a standard utility -- and it's not 
> installed by default in the "minimal" package sets on several platforms, 
> mostly Linux variants.  (Yes, this is annoying.)
>
> /usr/bin/env is probably the safest bet here.  Isn't portability fun?

"type" is a built-in in POSIX shells, and even the pre-historic SunOS
/bin/sh has a "type" built-in, be it a bare-bones version that does not
support the "-p" switch, that is sufficient. So another possibility is:

set -- `type find`
shift `expr $# - 1`
# Now, $1 is the full path of "find".
# ...

This said, the `postconf -h queue_directory` solution is likely simplest
for now.

-- 
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:


If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.


Re: multi instance support bug (env not found)

2009-06-05 Thread Rob Foehl

On Fri, 5 Jun 2009, Wietse Venema wrote:


Victor Duchovni:

On Fri, Jun 05, 2009 at 10:05:16AM -0400, Wietse Venema wrote:


Ralf Hildebrandt:

/usr/libexec/postfix/postfix-script: 346: /bin/env: not found


Replace "/bin/env find" by "`which find`.


Perhaps /usr/bin/env, will be more portable? It seems that /usr/bin/env
is "more" correct than /bin/env for both Linux and Solaris, does it
also work on *BSD systems? Also "find" is /usr/bin/find on both.


/usr/bin/env is the "preferred" location, but this isn't really written in 
stone anywhere.  For further confusion, some Linux distributors ship 
/usr/bin/env as a link to /bin/env, presumably to cover the unusual case 
of separate / and /usr partitions and no initrd.



Why is a hard-coded command path better than `which find`? The
script runs with a PATH setting that is controlled by Postfix (it
would be a bug otherwise).


Surprisingly enough, which isn't a standard utility -- and it's not 
installed by default in the "minimal" package sets on several platforms, 
mostly Linux variants.  (Yes, this is annoying.)


/usr/bin/env is probably the safest bet here.  Isn't portability fun?

-Rob


Re: multi instance support bug (env not found)

2009-06-05 Thread Wietse Venema
Victor Duchovni:
> On Fri, Jun 05, 2009 at 10:05:16AM -0400, Wietse Venema wrote:
> 
> > Ralf Hildebrandt:
> > > /usr/libexec/postfix/postfix-script: 346: /bin/env: not found
> > 
> > Replace "/bin/env find" by "`which find`.
> 
> Perhaps /usr/bin/env, will be more portable? It seems that /usr/bin/env
> is "more" correct than /bin/env for both Linux and Solaris, does it
> also work on *BSD systems? Also "find" is /usr/bin/find on both.

Why is a hard-coded command path better than `which find`? The
script runs with a PATH setting that is controlled by Postfix (it
would be a bug otherwise).

> Is there a better solution? Could always use, and not worry about
> foot-shooters who put macros in "queue_directory = $some_other_parameter".
> 
>   find "`postconf -h $queue_directory`/$q"

That is a temporary problem until postconf can properly expand.

Wietse


Re: multi instance support bug (env not found)

2009-06-05 Thread Gerard
On Fri, 5 Jun 2009 12:51:54 -0400
Victor Duchovni  wrote:

>Perhaps /usr/bin/env, will be more portable? It seems that /usr/bin/env
>is "more" correct than /bin/env for both Linux and Solaris, does it
>also work on *BSD systems? Also "find" is /usr/bin/find on both.

FreeBSD:

~ $ which env
/usr/bin/env


-- 
Gerard
postfix.u...@yahoo.com

TO REPORT A PROBLEM see http://www.postfix.org/DEBUG_README.html#mail
TO (UN)SUBSCRIBE see http://www.postfix.org/lists.html

If ignorance is bliss, why aren't there more happy people?


signature.asc
Description: PGP signature


Re: multi instance support bug (env not found)

2009-06-05 Thread Victor Duchovni
On Fri, Jun 05, 2009 at 10:05:16AM -0400, Wietse Venema wrote:

> Ralf Hildebrandt:
> > /usr/libexec/postfix/postfix-script: 346: /bin/env: not found
> 
> Replace "/bin/env find" by "`which find`.

Perhaps /usr/bin/env, will be more portable? It seems that /usr/bin/env
is "more" correct than /bin/env for both Linux and Solaris, does it
also work on *BSD systems? Also "find" is /usr/bin/find on both.

Is there a better solution? Could always use, and not worry about
foot-shooters who put macros in "queue_directory = $some_other_parameter".

find "`postconf -h $queue_directory`/$q"

-- 
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:


If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.


Re: can't get smtp_fallback_relay to work

2009-06-05 Thread Ralf Hildebrandt
* Wietse Venema :

> The Postfix SMTP client will never send mail to the SMTP port on
> any IP address that is listed in $inet_interfaces. This is part of
> the basic loop elimination algorithm that also keeps Postfix from
> sending mail to equal-preference MX hosts.

Yes, I initially suspected the HELO...
 
> Either play games in main.cf:inet_interfaces or with master.cf,
> or use a non-default SMTP port.

Yes, that works

-- 
Ralf Hildebrandt
Postfix - Einrichtung, Betrieb und Wartung   Tel. +49 (0)30-450 570-155
http://www.computerbeschimpfung.de
I dropped my computer on my foot! That Megahurtz!


Re: multi instance support bug (env not found)

2009-06-05 Thread Wietse Venema
Ralf Hildebrandt:
> /usr/libexec/postfix/postfix-script: 346: /bin/env: not found

Replace "/bin/env find" by "`which find`.

Wietse


Re: can't get smtp_fallback_relay to work

2009-06-05 Thread Wietse Venema
Ralf Hildebrandt:
> * Wietse Venema :
> > Ralf Hildebrandt:
> > > Jun  5 15:35:18 hanni postfix-ram/smtp[24385]: warning: 
> > > smtp_fallback_relay configuration problem
> > > smtp_fallback_relay = [194.126.158.237]
> > 
> > I don't think you can set smtp_fallback_relay to the local SMTP port.
> 
> Grmbl. Neither 127.0.0.1 nor 194.126.158.237 work. Does that mean I
> must use 
> 
> inet_interfaces = localhost 
> in one instance and
> inet_interfaces = 194.126.158.237
> on the other?

The Postfix SMTP client will never send mail to the SMTP port on
any IP address that is listed in $inet_interfaces. This is part of
the basic loop elimination algorithm that also keeps Postfix from
sending mail to equal-preference MX hosts.

Either play games in main.cf:inet_interfaces or with master.cf,
or use a non-default SMTP port.

Wietse


Re: can't get smtp_fallback_relay to work

2009-06-05 Thread Wietse Venema
Wietse Venema:
> Ralf Hildebrandt:
> > Jun  5 15:35:18 hanni postfix-ram/smtp[24385]: warning: smtp_fallback_relay 
> > configuration problem
> > smtp_fallback_relay = [194.126.158.237]
> 
> I don't think you can set smtp_fallback_relay to the local SMTP port.

Unless of course you update the postfix-ram's inet_interfaces setting
and remove 194.126.158.237.

Wietse


Re: can't get smtp_fallback_relay to work

2009-06-05 Thread Ralf Hildebrandt
* Wietse Venema :
> Ralf Hildebrandt:
> > Jun  5 15:35:18 hanni postfix-ram/smtp[24385]: warning: smtp_fallback_relay 
> > configuration problem
> > smtp_fallback_relay = [194.126.158.237]
> 
> I don't think you can set smtp_fallback_relay to the local SMTP port.

Grmbl. Neither 127.0.0.1 nor 194.126.158.237 work. Does that mean I
must use 

inet_interfaces = localhost 
in one instance and
inet_interfaces = 194.126.158.237
on the other?

-- 
Ralf Hildebrandt
Postfix - Einrichtung, Betrieb und Wartung   Tel. +49 (0)30-450 570-155
http://www.computerbeschimpfung.de
This is the first age that's paid much attention to the future, which is
a little ironic since we may not have one. -- Arthur Clarke


Re: can't get smtp_fallback_relay to work

2009-06-05 Thread Wietse Venema
Ralf Hildebrandt:
> Jun  5 15:35:18 hanni postfix-ram/smtp[24385]: warning: smtp_fallback_relay 
> configuration problem
> smtp_fallback_relay = [194.126.158.237]

I don't think you can set smtp_fallback_relay to the local SMTP port.

Wietse


can't get smtp_fallback_relay to work

2009-06-05 Thread Ralf Hildebrandt
I'm trying to run two instances, I'm injection on localhost port 10025
into postfix-ram, which has the queue in RAM:

Jun  5 15:35:17 hanni postfix-ram/cleanup[24403]: 45F4A2E369: 
message-id=<20090605133514.45f4a2e...@nanni.state-of-mind.de>
Jun  5 15:35:17 hanni postfix-ram/qmgr[24345]: 45F4A2E369: 
from=, size=363, nrcpt=1 (queue active)
Jun  5 15:35:18 hanni postfix-ram/smtp[24385]: 45F4A2E369: host 
digital.ktu.lt[193.219.160.140] said: 452 4.4.5 Insufficient disk space; try 
again later (in reply to MAIL FROM command)
Jun  5 15:35:18 hanni postfix-ram/smtp[24385]: warning: smtp_fallback_relay 
configuration problem
Jun  5 15:35:18 hanni postfix-ram/smtp[24385]: 45F4A2E369:
to=, relay=none, delay=5.8, delays=5.6/0/0.21/0, 
dsn=4.3.5, status=deferred (mail for 194.126.158.237 loops back to myself)

default instance:

command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debug_peer_list = 127.0.0.1
html_directory = no
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
multi_instance_directories = /etc/postfix-ram
multi_instance_enable = yes
multi_instance_wrapper = ${command_directory}/postmulti -p --
mydestination = $myhostname
myhostname = hanni.state-of-mind.de
mynetworks = 127.0.0.1
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

postfix-ram instance:

alias_maps = hash:/etc/aliases
authorized_submit_users = 
command_directory = /usr/sbin
config_directory = /etc/postfix-ram
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix-ram
debug_peer_level = 2
html_directory = no
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
multi_instance_enable = yes
multi_instance_name = postfix-ram
mydestination = $myhostname
myhostname = nanni.state-of-mind.de
mynetworks = 127.0.0.1
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix-ram
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_connect_timeout = 3s
smtp_data_done_timeout = 60s
smtp_data_init_timeout = 12s
smtp_data_xfer_timeout = 18s
smtp_fallback_relay = [194.126.158.237]
smtp_helo_name = ram.state-of-mind.de
smtp_helo_timeout = 30s
smtp_mail_timeout = 30s
smtp_quit_timeout = 30s
smtp_rcpt_timeout = 30s
smtp_rset_timeout = 2s
smtp_starttls_timeout = 30s
unknown_local_recipient_reject_code = 550

Why is it looping? I already tried changing the smtp_helo_name as you
can see.
-- 
Ralf Hildebrandt
Postfix - Einrichtung, Betrieb und Wartung   Tel. +49 (0)30-450 570-155
http://www.computerbeschimpfung.de
Netzwerkgrundlagen anhand Windows lernen zu wollen ist doch wie seine
ersten sexuellen Erfahrungen mit einer Prostituierten zu sammlen: Die
Leidenschaft fehlt, das wirklich Wichtige lernt man dabei nicht, und die
Chance sich einen Sch�dling einzufangen ist hoch. (Lukas Graf in d.c.s.m)


Re: Rejecting mail to unknown recipients

2009-06-05 Thread Brian Evans - Postfix List
Peter Smith wrote:
>> On Friday 05 June 2009 09:24:54 Peter Smith wrote:
>> 
>>> virtual_mailbox_domains = $transport_maps
>>>   
>> Whats this for?
>>
>> Are the problem domains listed in /etc/postfix/transport for some reason.
>> 
>
> I have an entry in transport:
>
> mydomain.commaildrop:
>
> Is this the problem?
>   

You do not have a virtual_mailbox_maps.  Therefore, all addresses in
virtual_mailbox_domains are valid.

It is not recommended to share a transport map and a domain listing.
This is because you may not want to receive mail for every domain in the
transport map.

Brian


Re: Rejecting mail to unknown recipients

2009-06-05 Thread Peter Smith
All solved now - thanks for your help guys! The changes I made were:

virtual_mailbox_domains =  $transport_maps

to:

virtual_mailbox_domains = mydomain.com

Added:

virtual_transport = maildrop
virtual_mailbox_maps = hash:/etc/postfix/virtual






multi instance support bug (env not found)

2009-06-05 Thread Ralf Hildebrandt
I built and install 2.6.x today:

% make makefile
% make
% make install

on a pristine machine and tried the
multi-instance support. I did this (fresh from my shell, no edits):

r...@hanni:/etc/postfix# postmulti -l -a
-   -   y /etc/postfix
r...@hanni:/etc/postfix# postmulti -I postfix-myinst -e create

### Damn, I cut&pasted it from the instructions, I wanted to name it
differently. I read on, wo to delete...

r...@hanni:/etc/postfix# postmulti -i postfix-myinst -p stop
postfix-myinst/postfix-script: fatal: the Postfix mail system is not running
r...@hanni:/etc/postfix# postmulti -i postfix-myinst -e disable
r...@hanni:/etc/postfix# postmulti -i postfix-myinst -e destroy
/usr/libexec/postfix/postfix-script: 346: /bin/env: not found
/usr/libexec/postfix/postfix-script: 346: /bin/env: not found
/usr/libexec/postfix/postfix-script: 346: /bin/env: not found
/usr/libexec/postfix/postfix-script: 346: /bin/env: not found
/usr/libexec/postfix/postfix-script: 346: /bin/env: not found
r...@hanni:/etc/postfix# which env
/usr/bin/env

-- 
Ralf Hildebrandt
Postfix - Einrichtung, Betrieb und Wartung   Tel. +49 (0)30-450 570-155
http://www.computerbeschimpfung.de
Men are from Mars. Women are from Venus. Computers are from hell.


Re: Policy delegation client request question

2009-06-05 Thread Wietse Venema
Rob Tanner:
> Hi,
> 
> I?ve got the front-end of a policy engine in place and connected to postfix
> on a test server.  All it?s really doing is logging what postfix sends and
> returning an ?OK?.  What I notice is that when I?ve sent emails through that
> server with multiple recipients, rather than getting multiple recipient
> attributes, I get multiple delegation requests.  Is that always the case and
> therefore no delegation request has multiple instances of the same
> attribute, or is it that I haven?t sent the right test message to see the
> multiples in a singe request?

According to the SMTP protocol, Postfix must send a reply for one
recipient before the SMTP client will send the next recipient.

Wietse


Re: Rejecting mail to unknown recipients

2009-06-05 Thread Peter Smith
> On Friday 05 June 2009 09:24:54 Peter Smith wrote:
>>
>> virtual_mailbox_domains = $transport_maps
>
> Whats this for?
>
> Are the problem domains listed in /etc/postfix/transport for some reason.

I have an entry in transport:

mydomain.commaildrop:

Is this the problem?



Re: Rejecting mail to unknown recipients

2009-06-05 Thread Peter Smith
--- In postfix-us...@yahoogroups.com, Pascal Volk 
wrote:
>
> On 06/05/2009 02:25 AM Peter Smith wrote:

> > If I telnet to my mail server, anyth...@... is accepted. If I
> > turn up the logging verbosity, I see:
>
> How do you telnet to your server?
> `telnet localhost 25`?

Actually I was telnetting in to port 25 from a remote location

> > maps_find: virtual_alias_maps: @mydomain.com: not found
> > mail_addr_find: sdf...@... -> (not found)
> > generic_checks: name=reject_unlisted_recipient status=0

> Please provide the `postconf -n` output.

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
bounce_queue_lifetime = 2d
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 20
debug_peer_list = x.x.x.x
default_destination_concurrency_limit = 10
default_process_limit = 300
initial_destination_concurrency = 20
local_destination_concurrency_limit = 1
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain
mynetworks_style = host
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.0.18/README_FILES
relay_domains = $mydestination
sample_directory = /usr/share/doc/postfix-2.0.18/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_unlisted_recipient,reject_unauth_destination,
reject_non_fqdn_sender, reject_invalid_hostname,
reject_unknown_sender_domain, reject_rbl_client bl.spamcop.net,
reject_rbl_client sbl.spamhaus.org, reject_unlisted_recipient
smtpd_reject_unlisted_recipient = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
unknown_virtual_alias_reject_code = 550
unknown_virtual_mailbox_reject_code = 550
virtual_mailbox_domains = $transport_maps

Thanks,
Pete