Re: Keeping a copy of all mail, and then removing headers from outbound

2012-03-08 Thread Lars Preben Sørsdahl
  What I'm trying to achieve is for Postfix to deliver a copy to a local
 IMAP
  account, and then remove our internal/private headers before passing the
  mail on to the relay host. The idea is for some custom software to read
 the
  copy from the IMAP account, using the interal/private headers for
  integration with other systems.



 Use smtp_header_checks=pcre:/path/to/file to remove the headers
 from outbound mail. If you also use LMTP or SMTP to deliver local
 IMAP accounts, one extra step is needed. I'm not going to complicate
 the solution if this step is not needed.

Wietse


Yes, I'm using LMTP for delivering the bcc copy to an IMAP account, so
please tell me about the extra step. :)

From main.cf:

always_bcc=myaccount
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
relayhost=[smtp.sendgrid.net]:587

Mail sent to custo...@example.com via Postfix should be copied to the
myaccount IMAP account with all it's original headers, but I want to
remove the X-Cusomer-ID (and possible some others) from the mail when
it's delivered to the external relayhost.



-- 
Lars Preben Sørsdahl
lars.preben.no


Re: Keeping a copy of all mail, and then removing headers from outbound

2012-03-08 Thread Wietse Venema
Lars Preben S?rsdahl:
 What I'm trying to achieve is for Postfix to deliver a copy to a
 local IMAP account, and then remove our internal/private headers
 before passing the mail on to the relay host. The idea is for some
 custom software to read the copy from the IMAP account, using the
 interal/private headers for integration with other systems.

Wietse:
 Use smtp_header_checks=pcre:/path/to/file to remove the headers
 from outbound mail. If you also use LMTP or SMTP to deliver local
 IMAP accounts, one extra step is needed. I'm not going to complicate
 the solution if this step is not needed.

Lars Preben S?rsdahl:
 Yes, I'm using LMTP for delivering the bcc copy to an IMAP account, so
 please tell me about the extra step. :)
 
 From main.cf:
 
 always_bcc=myaccount
 mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
 relayhost=[smtp.sendgrid.net]:587

In that case, it should be safe to have the option in main.cf,
because LMTP mail delivery uses lmtp_header_checks instead of
smtp_header_checks.

/etc/postfix/main.cf:
smtp_header_checks = pcre:/path/to/file

Wietse


Re: How to delete a key via postconf

2012-03-08 Thread Wietse Venema
Wietse Venema:
  -X Edit  the  main.cf configuration file, and remove the parameters
 given on the postconf(1) command line.  The file is copied to  a
 temporary  file  then  renamed  into  place.   Specify a list of
 parameter names, not name=value pairs.  There is no  postconf(1)
 command to perform the reverse operation.

Changed to -X for safety reaons. The action may result in loss of
information and therefore should require a two-finger action.

Updated feature patch (on source code mirrors):
postfix-release/experimental/feature-patches/20120308-postconf-X-patch
postfix-release/experimental/feature-patches/20120308-postconf-X-patch.sig

This version should be final.

Wietse


Question with Postfix and SPF

2012-03-08 Thread Marcelo Vieira

Hello,

I have a question related with Postfix and SPF.

I have a server configured to check SPF MTA. Two domains uses that MTA.

When I receive an e-mail from outside (gmail / hotmail etc ...) the 
verification of

SPF is ok. When sending an e-mail from a domain that exists in the MTA to
another, the SPF isnt checked, nor any information is written on logs.

E-mails exchanged between different domains on the same MTA should have
their SPF checked?


Filters : How to change subject based on body?

2012-03-08 Thread Denis BUCHER

Dear all,

I need to be able to change subject based on message body.
I would be very glad if someone had some advice on how to do that with 
postfix ?


More precisely, what I want to do is :

1. Only emails for postmas...@mydomain.com should be concerned (headers
   filter)
2. Then based on body checks I would like to change the Subject, or add
   a custom header

The aim is to be able to recognize the original sender of the failed 
mail so that I can handle them accordingly


Any help would be greatly appreciated !

Denis



Re: Question with Postfix and SPF

2012-03-08 Thread Reindl Harald
Am 08.03.2012 16:44, schrieb Marcelo Vieira:
 I have a question related with Postfix and SPF.
 I have a server configured to check SPF MTA. Two domains uses that MTA.
 
 When I receive an e-mail from outside (gmail / hotmail etc ...) the 
 verification of
 SPF is ok. When sending an e-mail from a domain that exists in the MTA to
 another, the SPF isnt checked, nor any information is written on logs.
 E-mails exchanged between different domains on the same MTA should have
 their SPF checked?

you are not understanding what SPF means
SENDER POLICY framework

why should this affect internal communication or trusted senders (mynetwork)
hopefully your machine trusts itself :-)




signature.asc
Description: OpenPGP digital signature


Re: Filters : How to change subject based on body?

2012-03-08 Thread /dev/rob0
On Thu, Mar 08, 2012 at 04:49:24PM +0100, Denis BUCHER wrote:
 I need to be able to change subject based on message body.
 I would be very glad if someone had some advice on how to do
 that with postfix ?

You cannot. And from reading the rest, I think you should not.

 More precisely, what I want to do is :
 
 1. Only emails for postmas...@mydomain.com should be
concerned (headers filter)

Why the header? Mail routing is not done on the basis of mail 
headers. Why are you seeing these mails with this header?

Also, if mydomain.com is intended as an example, please use 
example.com. Don't use real domains as examples.

 2. Then based on body checks I would like to change the
Subject, or add a custom header
 
 The aim is to be able to recognize the original sender of
 the failed mail so that I can handle them accordingly

Failed mail? Why did it fail? I bet that is the real issue which 
requires your attention.

You should elaborate on the actual problem you are trying to solve, 
and show us the logs, postconf -n, and other relevant information 
about it.

http://www.postfix.org/DEBUG_README.html#mail
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if /dev/rob0 is in the Subject:


Re: Question with Postfix and SPF

2012-03-08 Thread Scott Kitterman
On Thursday, March 08, 2012 12:44:55 PM Marcelo Vieira wrote:
 Hello,
 
 I have a question related with Postfix and SPF.
 
 I have a server configured to check SPF MTA. Two domains uses that MTA.
 
 When I receive an e-mail from outside (gmail / hotmail etc ...) the
 verification of
 SPF is ok. When sending an e-mail from a domain that exists in the MTA to
 another, the SPF isnt checked, nor any information is written on logs.
 
 E-mails exchanged between different domains on the same MTA should have
 their SPF checked?

You should probably take this up on an SPF related list.  See 
http://www.openspf.org/Forums for information on how to subscribe to the spf-
help mailing list.

Scott K


Re: Question with Postfix and SPF

2012-03-08 Thread Wietse Venema
Marcelo Vieira:
 Hello,
 
 I have a question related with Postfix and SPF.
 
 I have a server configured to check SPF MTA. Two domains uses that MTA.
 
 When I receive an e-mail from outside (gmail / hotmail etc ...) the 
 verification of
 SPF is ok. When sending an e-mail from a domain that exists in the MTA to
 another, the SPF isnt checked,

SPF is concerned with the details of an SMTP session (primarily,
the sender IP address, and the HELO command).  SMTP is not normally
used to deliver mail between domains on the same MTA. In the absence
of an SMTP sesion, there will be no SMTP session details to check.

 nor any information is written on logs.

On the contrary, Postfix logs profusely what is happening, but
none of that involves SMTP.

 E-mails exchanged between different domains on the same MTA should have
 their SPF checked?

How is that supposed to work, absent SMTP session details?

Wietse


Strange behavior of Postfix?

2012-03-08 Thread Leslie León Sinclair

A childhood friend of mine have this problem:

He can send mails to his mailing list server only with RoundCube, but 
with another Client[Squirrelmail, Thunderbird, ClawsMail or Micro$oft 
Outlook doesn´t], and I don´t know what´s happening. I post below his 
main.cf. Mailman if configured and working, when you send a mail to a 
list, postfix give a user unknown error[the user of the list], but 
with RoundCube works as a sunshine. So I don´t know what might be 
happening there.


I hope you can help me because the issue is tricky to me too.

main.cf
smtpd_banner = $myhostname ESMTP $mail_name Debian GNU/Linux
biff = no

# Appending domain is the MUA's job.
append_dot_mydomain = no

readme_directory  = no

# Bounce template
bounce_template_file = /etc/postfix/warnings/bounce.msg

# Debug
debug_peer_level  = 4
debug_peer_list   = $mynetworks

# Net interfaces
inet_interfaces  = all
inet_protocols   = all
mynetworks_style = host
mynetworks   = 127.0.0.0/8

relayhost = mx.mydomain.cu

myhostname = apolo.mydomain.cu
mydomain   = mail.mydomain.cu
myorigin   = $mydomain
masquerade_domain = 
proxy:mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf

relay_domain = proxy:mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/dovecot-auth

#smtpd_sasl_path = smtpd
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_auth_enable  = yes
broken_sasl_auth_clients= yes
smtpd_sasl_authenticated_header = yes
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject, 
reject_non_fqdn_hostname, permit_sasl_authenticated, 
reject_unauth_destination
smtpd_sender_restrictions   = reject_unauth_pipelining, 
reject_unknown_sender_domain, reject_non_fqdn_sender, 
hash:/etc/postfix/rules/spamaddrss
smtpd_recipient_restrictions= permit_mynetworks, 
permit_auth_destination, permit_sasl_authenticated, permit_mx_backup, 
reject_unauth_destination, reject_unlisted_recipient


smtpd_tls_auth_only = no
smtpd_use_tls   = yes
smtp_tls_note_starttls_offer= yes
smtpd_tls_CAfile= /etc/ssl/certs/cacert.pem
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file  = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_loglevel  = 5
smtpd_tls_received_header   = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source   = dev:/dev/urandom

smtpd_helo_required = yes
disable_vrfy_command= yes
smtp_sasl_auth_enable   = no
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_etrn_restrictions = reject

body_checks = pcre:/etc/postfix/rules/body_checks, 
regexp:/etc/postfix/rules/avchk, pcre:/etc/postfix/rules/avchkre
header_checks = pcre:/etc/postfix/rules/header_checks, 
pcre:/etc/postfix/rules/headerchkmsg

mime_header_checks = pcre:/etc/postfix/rules/mime_header_checks

smtpd_sender_login_maps = pcre:/etc/postfix/rules/sender_login_checks

smtp_mx_address_limit = 0
smtp_connect_timeout = 30
smtp_helo_timeout = 60s
smtp_rcpt_timeout = 240s
smtp_quit_timeout = 240s
smtp_rset_timeout = 20s
smtp_skip_4xx_greeting = yes
smtp_skip_5xx_greeting = yes

message_size_limit = 10485760
mailbox_size_limit = 10485760

recipient_delimiter = +

smtpd_recipient_limit = 25

dovecot_destination_recipient_limit = 1

maximal_queue_lifetime = 4d

delay_warning_time = 4h
smtpd_error_sleep_time = 1s

local_destination_concurrency_limit = 25
bounce_queue_lifetime = 4d

alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_database = hash:/etc/aliases

#mydestination = [He tried a lot of values here, but right now is empty, 
and still strange the behavior]


transport_maps = hash:/etc/postfix/transport
mailman_destination_recipient_limit = 1
owner_request_special = no

virtual_mailbox_base= /home/vmail
virtual_uid_maps= static:5000
virtual_gid_maps= static:5000
virtual_transport   = dovecot

virtual_alias_maps  = 
proxy:mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = 
proxy:mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
virtual_mailbox_maps= 
proxy:mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf


show_user_unknown_table_name = no

queue_directory   = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory  = /usr/lib/postfix
mail_owner= postfix
default_privs = nobody

unknown_local_recipient_reject_code = 550
local_recipient_maps =  $alias_maps, $virtual_mailbox_maps, 
proxy:unix:passwd.byname


in_flow_delay   = 1s

home_mailbox= Maildir/

mail_spool_directory = /var/spool/mail

debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id  sleep 5

sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
mailbox_command = 

Re: Strange behavior of Postfix?

2012-03-08 Thread Wietse Venema
Leslie Le?n Sinclair:
 A childhood friend of mine have this problem:
 
 He can send mails to his mailing list server only with RoundCube, but 
 with another Client[Squirrelmail, Thunderbird, ClawsMail or Micro$oft 
 Outlook doesn?t], and I don?t know what?s happening. I post below his 

On the RECEIVING mail server side:

1) Show one maillog example of a good session.

2) Show one maillog example of a bad session.

Wietse


Re: Strange behavior of Postfix?

2012-03-08 Thread Noel Jones
On 3/8/2012 12:43 PM, Leslie León Sinclair wrote:
 A childhood friend of mine have this problem:
 
 He can send mails to his mailing list server only with RoundCube,
 but with another Client[Squirrelmail, Thunderbird, ClawsMail or
 Micro$oft Outlook doesn´t], and I don´t know what´s happening. I
 post below his main.cf. Mailman if configured and working, when you
 send a mail to a list, postfix give a user unknown error[the user
 of the list], but with RoundCube works as a sunshine. So I don´t
 know what might be happening there.
 
 I hope you can help me because the issue is tricky to me too.

How to ask for help:
http://www.postfix.org/DEBUG_README.html#mail

In particular, we need to see postconf -n output and postfix logs
of one good session, and postfix logs of one failed session.

 
 main.cf
...
 masquerade_domain =
 proxy:mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
 relay_domain =
 proxy:mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf

the above two settings are probably a mistake.  What is the intent
of these?

 smtpd_recipient_restrictions= permit_mynetworks,
 permit_auth_destination, permit_sasl_authenticated,
 permit_mx_backup, reject_unauth_destination, reject_unlisted_recipient

This is wrong.  Don't use permit_auth_destination in this context,
and do not use permit_mx_backup.



 smtp_mx_address_limit = 0

This should be set at the default 5 or another fairly low number to
protect against destinations with hundreds of MX hosts.

 smtpd_recipient_limit = 25

Be aware that setting the recipient limit low will increase load on
your server.


 #mydestination = [He tried a lot of values here, but right now is
 empty, and still strange the behavior]

Note there is a difference between empty and commented out.
Commented out uses the default value of $myhostname,
localhost.$mydomain, localhost
http://www.postfix.org/postconf.5.html#mydestination

 show_user_unknown_table_name = no

This makes debugging harder.  Set to yes until everything is working.

 local_recipient_maps =  $alias_maps, $virtual_mailbox_maps,
 proxy:unix:passwd.byname

virtual_mailbox_maps should never be included in local recipients.





  -- Noel Jones


Re: Strange behavior of Postfix?

2012-03-08 Thread Leslie León Sinclair

The two sessions, below...

1) Show one maillog example of a good session.


Mar  8 14:58:40 apolo postfix/pickup[26492]: C7A5356B4: uid=33 
from=les...@mail.mydomain.cu
Mar  8 14:58:40 apolo postfix/qmgr[2706]: C7A5356B4: 
from=les...@mail.mydomain.cu, size=553, nrcpt=1 (queue active)
Mar  8 14:58:42 apolo postfix/smtpd[24204]:  localhost[127.0.0.1]: rcpt 
TO:les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: extract_addr: input: 
les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: smtpd_check_addr: 
addr=les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: ctable_locate: move existing 
entry key les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: extract_addr: in: 
les...@mail.mydomain.cu, result: les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: ctable_locate: move existing 
entry key les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: maps_find: 
recipient_canonical_maps: les...@mail.mydomain.cu: not found
Mar  8 14:58:42 apolo postfix/smtpd[24204]: mail_addr_find: 
les...@mail.mydomain.cu - (not found)
Mar  8 14:58:42 apolo postfix/smtpd[24204]: maps_find: canonical_maps: 
les...@mail.mydomain.cu: not found
Mar  8 14:58:42 apolo postfix/smtpd[24204]: mail_addr_find: 
les...@mail.mydomain.cu - (not found)
Mar  8 14:58:42 apolo postfix/smtpd[24204]: send attr key = 
les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: input attribute value: 
les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: dict_proxy_lookup: 
table=mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf 
flags=lock|fold_fix key=les...@mail.mydomain.cu - status=0 
result=les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: maps_find: 
virtual_alias_maps: 
proxy:mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf(0,lock|fold_fix): 
les...@mail.mydomain.cu = les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/smtpd[24204]: mail_addr_find: 
les...@mail.mydomain.cu - les...@mail.mydomain.cu
Mar  8 14:58:42 apolo postfix/pipe[27511]: 9749456A7: 
to=les...@mail.mydomain.cu, relay=dovecot, delay=0.17, 
delays=0.13/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)




2) Show one maillog example of a bad session.


Mar  8 14:52:59 apolo postfix/smtpd[24202]: Read 52 chars: MAIL 
FROM:les...@mail.mydomain.cu
Mar  8 14:52:59 apolo postfix/smtpd[24202]: NOQUEUE: reject: RCPT from 
unknown[10.8.xxx.yyy]: 550 5.1.1 mail...@list.mydomain.cu: Recipient 
address rejected: User unknown; from=les...@mail.mydomain.cu 
to=mail...@list.mydomain.cu proto=ESMTP helo=[10.8.xxx.yyy]



Participe en la XVI Convencioacute;n de Ingenieriacute;a y Arquitectura del 
26 al 30 de noviembre de 2012.
Habana, Cuba: http://www.congresouniversidad.cu
Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu


Re: Strange behavior of Postfix?

2012-03-08 Thread Reindl Harald


Am 08.03.2012 20:58, schrieb Leslie León Sinclair:
 2) Show one maillog example of a bad session.
 
 Mar  8 14:52:59 apolo postfix/smtpd[24202]: Read 52 chars: MAIL 
 FROM:les...@mail.mydomain.cu
 Mar  8 14:52:59 apolo postfix/smtpd[24202]: NOQUEUE: reject: RCPT from 
 unknown[10.8.xxx.yyy]: 550 5.1.1
 mail...@list.mydomain.cu: Recipient address rejected: User unknown; 
 from=les...@mail.mydomain.cu
 to=mail...@list.mydomain.cu proto=ESMTP helo=[10.8.xxx.yyy]

a) do NOT pst DEBUG LOG unless requested, the above is ignored because 
unreadable
b) this is not a full session - where is the connect




signature.asc
Description: OpenPGP digital signature


Re: Strange behavior of Postfix?

2012-03-08 Thread Wietse Venema
Leslie Le?n Sinclair:
 The two sessions, below...
  1) Show one maillog example of a good session.
 
 Mar  8 14:58:40 apolo postfix/pickup[26492]: C7A5356B4: uid=33 
 from=les...@mail.mydomain.cu

Please DO NOT send debug logging unless asked to do so.

This mail is not received via SMTP.

  2) Show one maillog example of a bad session.
 
 Mar  8 14:52:59 apolo postfix/smtpd[24202]: NOQUEUE: reject: RCPT from 
 unknown[10.8.xxx.yyy]: 550 5.1.1 mail...@list.mydomain.cu: Recipient 
 address rejected: User unknown; from=les...@mail.mydomain.cu 
 to=mail...@list.mydomain.cu proto=ESMTP helo=[10.8.xxx.yyy]

This mail is received via SMTP. You have misconfigured the Postfix.

He needs to follow instructions in the mailman documentation. Fixing
this on the mailing list is a waste of everyone's time, because all
he needs to do follow instructions.

Wietse


postscreen scalability

2012-03-08 Thread Dan Lists
How much traffic can postscreen handle?   Each mail server in our
cluster handles 800,000 to 1,000,000 messages per day.  We typically
have 60-120 smptd processes, with peaks as high as 320.  Adding a
greeting delay will result in a lot of open connections.  Can
postscreen handle this volume even with the postscreen_greet_wait
value of 6 seconds?  Would I need to use drop instead of enforce on my
actions?

Thanks,

Dan


Re: How to delete a key via postconf

2012-03-08 Thread Andreas Berton



On Wed, 7 Mar 2012, Quanah Gibson-Mount wrote:

--On Tuesday, March 06, 2012 2:05 PM -0500 Wietse Venema 
wie...@porcupine.org wrote:



 Quanah Gibson-Mount:
  --On Tuesday, March 06, 2012 1:11 PM -0500 Wietse Venema
  wie...@porcupine.org wrote:
 
  Hi Wietse,
 
  I noted in my initial email why this is not desirable solution.


 I ignored your objection, because it made no sense to me. I have
 learned that is it better to ignore things that make no sense to
 me, than to fight them in a debate.


I'm not sure why it made no sense to you.  It's quite well explained and 
logical.



  # postconf -# policy_time_limit
  
   After:
  
   /etc/postfix/main.cf:

  #  policy_time_limit = foo
  #  policy_time_limit = bar
 
  The problem with this approach is that if you later re-enable the

  policy,  it will not remove the #'d out entries.  Over time, you could
  theoretically  end up with numerous #'d entries for the parameter.

 Sorry, feature requests based on theoretical scenarios do not
 convince me.


This is most definitely not a theoretical scenario.  In fact, it is quite 
trivial to produce.  In addition, the postconf -# option is at best a hack. 
Even the man page notes there's no reverse operation, which clearly 
illustrates it is at best a hack.


It was changes made to postfix that created the entire issue that now exists 
in the first place.  I do not think it unreasonable or something that makes 
no sense to ask that a method for fixing an issue that was created because 
of changes you made to postfix be implemented in a future release.


--Quanah

--

Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.

Zimbra ::  the leader in open source messaging and collaboration





Why cant you do it by hand???



Re: complex policy -- how best to implement in Postfix?

2012-03-08 Thread Ben Rosengart
On Tue, Mar 06, 2012 at 04:26:09PM -0500, Ben Rosengart wrote:
 
 Apologies.  I'm thinking parts of this over and if I reanimate the
 thread, I will be sure to provide full context.

Let me try this again.

I want to rewrite *sender addresses* (preferably headers only) when
these conditions are _all_ met:

  1. Client is not in an ACL,
  2. Sender matches a particular LDAP filter, or isn't in LDAP, _AND_
  3. Recipient is in $relay_domains.

After squinting at this from different angles, my current thinking is
that this is outside what Postfix is intended for, and it should be
implemented in a milter -- if at all.  What's annoying about doing it
as a milter is that Postfix already knows how to determine all these
things; only the glue language is missing.

Thanks,
-- 
  Ben Rosengart   Like all those possessing a library,
  Sendmail, Inc.   Aurelian was aware that he was guilty of
  +1 718 431 3822  not knowing his in its entirety [...]
  -- Jorge Luis Borges

NOTICE: If received in error, please destroy and notify sender.
Sender does not waive confidentiality or privilege, and use is prohibited.


Re: postscreen scalability

2012-03-08 Thread Wietse Venema
Dan Lists:
 How much traffic can postscreen handle?   Each mail server in our
 cluster handles 800,000 to 1,000,000 messages per day.  We typically

This is mainly limited by the whitelist database latency: the
time needed to decide that a client is OK, and to hand off the
connection to a real SMTP server process.

In your example, postscreen would have to be able to do 10 lookups
a second, but we all know that mail is not spread out evenly over
a day, so 100 lookups/second would be more appropriate. 

If the number of distinct clients is not overwhelmingly large,
putting a memcache between postscreen and the persistent whitelist
database will help to reduce whitelist lookup latency.

 have 60-120 smptd processes, with peaks as high as 320.  Adding a
 greeting delay will result in a lot of open connections.  Can
 postscreen handle this volume even with the postscreen_greet_wait
 value of 6 seconds?  Would I need to use drop instead of enforce on my
 actions?

postscreen does not wait 6 seconds on all connections; that
would be a terrible mistake.

Wietse


Re: complex policy -- how best to implement in Postfix?

2012-03-08 Thread Wietse Venema
Ben Rosengart:
 On Tue, Mar 06, 2012 at 04:26:09PM -0500, Ben Rosengart wrote:
  
  Apologies.  I'm thinking parts of this over and if I reanimate the
  thread, I will be sure to provide full context.
 
 Let me try this again.
 
 I want to rewrite *sender addresses* (preferably headers only) when
 these conditions are _all_ met:
 
   1. Client is not in an ACL,
   2. Sender matches a particular LDAP filter, or isn't in LDAP, _AND_
   3. Recipient is in $relay_domains.
 
 After squinting at this from different angles, my current thinking is
 that this is outside what Postfix is intended for, and it should be
 implemented in a milter -- if at all.  What's annoying about doing it
 as a milter is that Postfix already knows how to determine all these
 things; only the glue language is missing.

Exactly. I decided long ago that complex conditionals would be
implemented outside of Postfix (the policy protocol); a similar
decision was made for content manipulation (SMTP-based filters and
Milters).  Milter bindings exist for many scripting languages, so
there is no need to re-invent those languages within of Postfix.

Wietse


Re: complex policy -- how best to implement in Postfix?

2012-03-08 Thread Ben Rosengart
On Thu, Mar 08, 2012 at 07:06:25PM -0500, Wietse Venema wrote:
  On Tue, Mar 06, 2012 at 04:26:09PM -0500, Ben Rosengart wrote:
  
  I want to rewrite *sender addresses* (preferably headers only) when
  these conditions are _all_ met:
  
1. Client is not in an ACL,
2. Sender matches a particular LDAP filter, or isn't in LDAP, _AND_
3. Recipient is in $relay_domains.
  
  [...] this is outside what Postfix is intended for, and it should be
  implemented in a milter [...]
 
 Exactly.

I am wondering, though, how to handle the case where recipients are
a mix of internal and external.  This seems like an area where Postfix
might supply some leverage.

If, upstream, I separate the recipients into different transports,
will this cause the upstream Postfix to split the envelope and send
the mail in 1 transaction, even though both transports are implemented
with smtp(8) and the nexthop is the same?

Thanks,
-- 
  Ben Rosengart   Like all those possessing a library,
  Sendmail, Inc.   Aurelian was aware that he was guilty of
  +1 718 431 3822  not knowing his in its entirety [...]
  -- Jorge Luis Borges

NOTICE: If received in error, please destroy and notify sender.
Sender does not waive confidentiality or privilege, and use is prohibited.


Re: complex policy -- how best to implement in Postfix?

2012-03-08 Thread Wietse Venema
Ben Rosengart:
 If, upstream, I separate the recipients into different transports,
 will this cause the upstream Postfix to split the envelope and send
 the mail in 1 transaction, even though both transports are implemented
 with smtp(8) and the nexthop is the same?

Each transport in a (transport, nexthop, recipient) triple has its
own per-nexthop message delivery request queues, and each message
delivery request has its own mail delivery transaction.

However, due to connection caching, multiple transactions from
different transports(!) may share an SMTP session.

Wietse


message-id discarded on send?

2012-03-08 Thread Chris Wilson
If I submit a message with the following message-id to the postfix sendmail
interface using */usr/sbin/sendmail -r...@here.com -t -oi -oem*
Message-Id: *58faf4a4-8e6f-4b60-af87-173efa7d3...@here.com*

The Postfix sendmail interface receives the message with the specified
message-id:
Mar  9 03:49:05 howsmy postfix/cleanup[16499]: 3E8C66C12E7: message-id=*
58faf4a4-8e6f-4b60-af87-173efa7d3...@here.com*

When the message arrives, it appears not to have a message-id at all, and
the receiver generates one.
Message-Id: *4f597db2.e7b9ec0a.6395.816dsmtpin_ad...@mx.google.com*

If I don't submit a message-id to postfix sendmail, the message-id
generated by postfix arrives in the receiving SMTP server correctly as
sent. If I try to specify the message-id, apparently nothing gets sent for
a message-id field by postfix.

What am I missing?


Re: message-id discarded on send?

2012-03-08 Thread Noel Jones
On 3/8/2012 10:48 PM, Chris Wilson wrote:
 If I submit a message with the following message-id to the postfix
 sendmail interface using */usr/sbin/sendmail -r...@here.com
 mailto:r...@here.com -t -oi -oem*
 Message-Id: *58faf4a4-8e6f-4b60-af87-173efa7d3...@here.com
 mailto:58faf4a4-8e6f-4b60-af87-173efa7d3...@here.com*

...

 What am I missing?

(no HTML next time.  Thanks.)

Your supplied message id is not valid, missing ...

Message-ID: 58faf4a4-8e6f-4b60-af87-173efa7d3...@here.com




  -- Noel Jones


Re: message-id discarded on send?

2012-03-08 Thread Chris Wilson
Awesome! That was it. I assumed my PERL library was doing the  for me.
I'm hearing the when you assume speech coming on.

Thank you!!

On Fri, Mar 9, 2012 at 12:15 AM, Noel Jones njo...@megan.vbhcs.org wrote:

 On 3/8/2012 10:48 PM, Chris Wilson wrote:
  If I submit a message with the following message-id to the postfix
  sendmail interface using */usr/sbin/sendmail -r...@here.com
  mailto:r...@here.com -t -oi -oem*
  Message-Id: *58faf4a4-8e6f-4b60-af87-173efa7d3...@here.com
  mailto:58faf4a4-8e6f-4b60-af87-173efa7d3...@here.com*

 ...

  What am I missing?

 (no HTML next time.  Thanks.)

 Your supplied message id is not valid, missing ...

 Message-ID: 58faf4a4-8e6f-4b60-af87-173efa7d3...@here.com




  -- Noel Jones