Re: Address rewriting help?

2016-08-31 Thread John Stoffel
> "Tom" == Tom Horsley  writes:

Tom> On Wed, 31 Aug 2016 18:32:03 -0400
Tom> Tom Horsley wrote:

>> I'm just reading about the pickup program and the
>> receive_override_options to turn off mapping.
>> I think that might work, only the mail from
>> fetchmail is being locally delivered via pickup.

Tom> Nah, that didn't work either, but I think I can just totally
Tom> bypass postfix in the fetchmail half of the equation by giving it
Tom> an mda to deliver to rather than telling it to do local delivery.

Tom> Just put the complicated pipe in my .forward file into
Tom> fetchmail's mda option instead.

I use fetchmail which I then pipe into procmail as the MDA, which
works awesome for sorting mail.  But... I'm now in the process of
setting up my own domain using postfix and dovecot and I'll have to
move to Sieve to do all this.

In my .fetchmailrc I have something like this:

   poll imap.gmail.com protocol IMAP
  user "somenice...@gmail.com", with password 
"brothercanyouspareadime", is
  'bob' here ssl
  mda "procmail -d %T"

and it works well.  Then in my local .procmailrc I have all my filters
into mbox style files which are the inboxes for my email folders.
Works well.

But like I said, I'm now moving to postfix/dovecot/sieve for my mail
handling.  All so I can read home mail in multiple places more easily.

John


Re: Address rewriting help?

2016-08-31 Thread Tom Horsley
On Wed, 31 Aug 2016 18:32:03 -0400
Tom Horsley wrote:

> I'm just reading about the pickup program and the
> receive_override_options to turn off mapping.
> I think that might work, only the mail from
> fetchmail is being locally delivered via pickup.

Nah, that didn't work either, but I think
I can just totally bypass postfix in the
fetchmail half of the equation by giving it
an mda to deliver to rather than telling
it to do local delivery.

Just put the complicated pipe in my .forward
file into fetchmail's mda option instead.


Re: Address rewriting help?

2016-08-31 Thread Tom Horsley
On Wed, 31 Aug 2016 17:19:54 -0500
Noel Jones wrote:

> Sounds as if smtp_generic_maps may be a better fit for this than
> canonical maps.
> http://www.postfix.org/ADDRESS_REWRITING_README.html#generic

I tried generic maps first, but that not only changed
the sender address, but the To: address as well, so I
could only send mail to myself (maybe I didn't
read enough to configure it correctly :-).

I'm just reading about the pickup program and the
receive_override_options to turn off mapping.
I think that might work, only the mail from
fetchmail is being locally delivered via pickup.


Re: Address rewriting help?

2016-08-31 Thread Noel Jones
On 8/31/2016 5:03 PM, Tom Horsley wrote:
> I'm trying to setup a relayhost to send all my mail
> through smtp.office365.com so postfix can queue it and
> I don't have to stare at a "Authenticating..." dialog
> box for 10 or 20 seconds.
> 
> I actually have things mostly working. I use
> this:
> 
> sender_canonical_maps = regexp:/etc/postfix/canonical

Sounds as if smtp_generic_maps may be a better fit for this than
canonical maps.
http://www.postfix.org/ADDRESS_REWRITING_README.html#generic



  -- Noel Jones

> 
> to change all addresses to the one and only address
> that works with my office365 account.
> 
> The problem comes when I receive mail. I'm using
> fetchmail to suck all my mail out of office365
> and deliver it locally where I can run it through
> a gazillion filters specified in a pipe in my
> ~/.forward file.
> 
> I think that is causing all the From: addresses
> in my incoming mail to also be re-written so that
> everything looks like it comes from me, which is just
> a tad confusing.
> 
> What is a good way to still manage to filter all my
> incoming mail without re-writing the From: address
> on the way in? (While still, of course, re-writing
> the outgoing address so office365 will accept it).
> 
> I don't insist on using a .forward file or even using
> fetchmail as long as there is some way I can extract
> all my mail from office365 an filter it locally.
> 



Address rewriting help?

2016-08-31 Thread Tom Horsley
I'm trying to setup a relayhost to send all my mail
through smtp.office365.com so postfix can queue it and
I don't have to stare at a "Authenticating..." dialog
box for 10 or 20 seconds.

I actually have things mostly working. I use
this:

sender_canonical_maps = regexp:/etc/postfix/canonical

to change all addresses to the one and only address
that works with my office365 account.

The problem comes when I receive mail. I'm using
fetchmail to suck all my mail out of office365
and deliver it locally where I can run it through
a gazillion filters specified in a pipe in my
~/.forward file.

I think that is causing all the From: addresses
in my incoming mail to also be re-written so that
everything looks like it comes from me, which is just
a tad confusing.

What is a good way to still manage to filter all my
incoming mail without re-writing the From: address
on the way in? (While still, of course, re-writing
the outgoing address so office365 will accept it).

I don't insist on using a .forward file or even using
fetchmail as long as there is some way I can extract
all my mail from office365 an filter it locally.


Re: per-milter configuration

2016-08-31 Thread Wietse Venema
? ?:
> Hi people !
> 
> I need to set several milters in postfix working un the same time.
> One of those have old milter protocol and non-default *_macros milter 
> parameters.
> Other milters can share default milter parameters from main.cf.
> And as far as I understood the milter readme I can't do that because:
> 
> per-milter settings in curly braces support only four milter protocol 
> parameters: command_timeout, connect_timeout, content_timeout, 
> default_action, and protocol. So I can't set milter macroses and 
> content_timeout !

No problem: if you send "too many" macros the milter(s)
will just ignore them.

> Also I cant get the proper syntax for multi-milter configuration from 
> milter readme:
> - should I get rid of spaces around "=" ? Is the following record 
> valid?: {inet:127.0.0.1:9027, milter_protocol = 3, 
> milter_command_timeout = 180}

As documented, you can specify "name=value" or "{ name = value }"

> - it's not relevant since *_macros settings aren't supported but what 
> about "{}" in item definition inside milter definition that itself is in 
> "{}" ?

You can specify "name={}" or "{ name = {} }".

> - how, in paticular, I should put several milter definitions under 
> /smtpd_milters/ parameter. Is following example valid?:
> 
> > smtpd_milters = { unix:greylist/milter-greylist.sock,
> > connect_timeout=180,
> > default_action=accept},
> > { unix:opendkim/opendkim.sock,  default_action = tempfail, 
> > command_timeout=120}

I thought that all this is documented. You specify one or more
milter definitions separated by comma or space, and each milter
definition can be inside { }.

Wietse


Re: relay outage - bounce or deffered queue

2016-08-31 Thread Zalezny Niezalezny
Ok Thanks.

On Wed, Aug 31, 2016 at 3:32 PM, Wietse Venema  wrote:

> Zalezny Niezalezny:
> > Dear Colleagues,
> >
> > in our infrastructure we are using Postfix as a relay server which is
> > responsible for transfering messages from our MS Exchange and Production
> > systems. Our infrastructure include several Postfix relays:
> >
> > M$Exchange(lan) ---> Postfix1(middleware lan) ---> Postfix2(application
> > lan) ---> Postfix3(web lan) ---> Internet
> >
> > I would like to ask You, what will happend if Postfix2 will be offline ?
> > How Postfix1 will behave ?
>
> As required by SMTP mail standard, Postfix will retry the email up
> to some time limit (with Postfix, maximal_queue_lifetime, default 7d).
>
> > M$ Exchange sending every minute ~10 000 E-mails.
>
> I recommend implementing Postfix2 etc. with multiple MTAs, perhaps
> behind HaProxy load balancers.
>
> > *If outage will take longer, we need to store thousands of E-mails in the
> > deffered queue, is there any limit for number of messages stored in the
> > deffered queue ?*
>
> Your math is off. With 1 messages per minute, that is over a
> million email messages queued for every two hours of downtime. You
> simply cannot afford days of downtime with such a volume.
>
> Wietse
>


Re: relay outage - bounce or deffered queue

2016-08-31 Thread Wietse Venema
Zalezny Niezalezny:
> Dear Colleagues,
> 
> in our infrastructure we are using Postfix as a relay server which is
> responsible for transfering messages from our MS Exchange and Production
> systems. Our infrastructure include several Postfix relays:
> 
> M$Exchange(lan) ---> Postfix1(middleware lan) ---> Postfix2(application
> lan) ---> Postfix3(web lan) ---> Internet
> 
> I would like to ask You, what will happend if Postfix2 will be offline ?
> How Postfix1 will behave ?

As required by SMTP mail standard, Postfix will retry the email up
to some time limit (with Postfix, maximal_queue_lifetime, default 7d).

> M$ Exchange sending every minute ~10 000 E-mails.

I recommend implementing Postfix2 etc. with multiple MTAs, perhaps
behind HaProxy load balancers.

> *If outage will take longer, we need to store thousands of E-mails in the
> deffered queue, is there any limit for number of messages stored in the
> deffered queue ?*

Your math is off. With 1 messages per minute, that is over a
million email messages queued for every two hours of downtime. You
simply cannot afford days of downtime with such a volume.

Wietse


relay outage - bounce or deffered queue

2016-08-31 Thread Zalezny Niezalezny
Dear Colleagues,

in our infrastructure we are using Postfix as a relay server which is
responsible for transfering messages from our MS Exchange and Production
systems. Our infrastructure include several Postfix relays:

M$Exchange(lan) ---> Postfix1(middleware lan) ---> Postfix2(application
lan) ---> Postfix3(web lan) ---> Internet

I would like to ask You, what will happend if Postfix2 will be offline ?
How Postfix1 will behave ?

a) will it bounce all messages from M$ Exchange users with answer that host
is not able to deliver messages ?

b) or maybe it will store all messages in the deffared queue for the
certain amount of time and will try to resent them every 300s ?

In case of any outage of Postfix2 or 3 I would like to store all E-mails in
the deffered queue till moment when Postfix2/3 will be again available ? M$
Exchange sending every minute ~10 000 E-mails.

How to configure it properly then ?

Using this parameter ?

*bounce_queue_lifetime*



*If outage will take longer, we need to store thousands of E-mails in the
deffered queue, is there any limit for number of messages stored in the
deffered queue ?*



*Thanks in advance for any hints*


*Cheers*

*Zalezny*


Re: Postfix / PGSql Errors

2016-08-31 Thread Wietse Venema
nalini.elk...@insidethestack.com:
> Hello List,
> 
> We are getting the following errors with PostFix 3.1.2
> 
> Aug 30 20:10:13 postfix/trivial-rewrite[21874]: warning: 
> pgsql:/etc/postfix/sql-domain-aliases.cf is unavailable. unsupported 
> dictionary type: pgsql 
> Aug 30 20:10:13 postfix/trivial-rewrite[21874]: warning: 
> virtual_alias_domains: pgsql:/etc/postfix/sql-domain-aliases.cf: table lookup 
> problem 
> Aug 30 20:10:13 postfix/trivial-rewrite[21874]: warning: 
> virtual_alias_domains lookup failure 
> 

Recompile (see PGSQL_README) or install postfix-pgsql package.

Wietse