stripping null characters

2009-02-04 Thread Cory Coager
We have a mainframe client sending emails with the body containing null 
characters.  I found the message_strip_characters and 
message_reject_characters options could resolve this issue but I'm 
wondering if 'message_strip_characters = \0' could cause problems with 
attachments containing null characters?





The information contained in this communication is intended
only for the use of the recipient(s) named above. It may
contain information that is privileged or confidential, and
may be protected by State and/or Federal Regulations. If
the reader of this message is not the intended recipient,
you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received
this communication in error, please return it to the sender
immediately and delete the original message and any copy
of it from your computer system. If you have any questions
concerning this message, please contact the sender.




syntax for multiple addresses in transport

2009-01-22 Thread Cory Coager
What is the syntax for specifying multiple addresses in transport for 
smtp?  Something like:


example.com  smtp:[gateway1.example.com] smtp:[gateway2.example.com]





The information contained in this communication is intended
only for the use of the recipient(s) named above. It may
contain information that is privileged or confidential, and
may be protected by State and/or Federal Regulations. If
the reader of this message is not the intended recipient,
you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received
this communication in error, please return it to the sender
immediately and delete the original message and any copy
of it from your computer system. If you have any questions
concerning this message, please contact the sender.




Re: syntax for multiple addresses in transport

2009-01-22 Thread Cory Coager

Victor Duchovni said the following on 01/22/2009 12:31 PM:

On Thu, Jan 22, 2009 at 12:26:54PM -0500, Cory Coager wrote:

  
What is the syntax for specifying multiple addresses in transport for smtp? 
 Something like:


example.com  smtp:[gateway1.example.com] smtp:[gateway2.example.com]



No, there is no multi-nexthop syntax in the transport table. However, with
SMTP, you are free to use names that resolve to multiple IP addresses,
or names (without []) that have multiple MX records.

  
Is there another way of adding multiple addresses for transport of a 
domain?  Round robin DNS would work I guess but not as good as a 
failover.  If one of the addresses in the DNS is down the transport is 
going to get delayed for that MX and the mailq is going to build up.





The information contained in this communication is intended
only for the use of the recipient(s) named above. It may
contain information that is privileged or confidential, and
may be protected by State and/or Federal Regulations. If
the reader of this message is not the intended recipient,
you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received
this communication in error, please return it to the sender
immediately and delete the original message and any copy
of it from your computer system. If you have any questions
concerning this message, please contact the sender.




Re: syntax for multiple addresses in transport

2009-01-22 Thread Cory Coager

Noel Jones said the following on 01/22/2009 03:20 PM:
Is there another way of adding multiple addresses for transport of a 
domain?  Round robin DNS would work I guess but not as good as a 
failover.  If one of the addresses in the DNS is down the transport 
is going to get delayed for that MX and the mailq is going to build up.


Why would an address in DNS being down be any different from an 
address specified in a config file being down?


Anyway, if you don't want to put special entries in DNS you can add 
entries to your hosts file to simulate multiple A records.



I guess you are right, failover would try the primary and wait for a
timeout before attempting the failover address.

I was just looking into the hosts file but it doesn't seem like postfix
refers to it as I'm getting bounce messages:
Host or domain name not found. Name service error for
name=smtptest.localhost type=A: Host not found





The information contained in this communication is intended
only for the use of the recipient(s) named above. It may
contain information that is privileged or confidential, and
may be protected by State and/or Federal Regulations. If
the reader of this message is not the intended recipient,
you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received
this communication in error, please return it to the sender
immediately and delete the original message and any copy
of it from your computer system. If you have any questions
concerning this message, please contact the sender.




tracking MTA connections

2009-01-08 Thread Cory Coager

I'm attempting to generate some rrd graphs to track MTA connections for
postfix.  With sendmail it was possible to do this by greping the ps
list for the number of sendmail processes.  How would I accomplish this
on postfix?


~Cory Coager





The information contained in this communication is intended
only for the use of the recipient(s) named above. It may
contain information that is privileged or confidential, and
may be protected by State and/or Federal Regulations. If
the reader of this message is not the intended recipient,
you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received
this communication in error, please return it to the sender
immediately and delete the original message and any copy
of it from your computer system. If you have any questions
concerning this message, please contact the sender.




Re: tracking MTA connections

2009-01-08 Thread Cory Coager

Ralf Hildebrandt said the following on 01/08/2009 08:39 AM:

* Cory Coager ccoa...@davisvision.com:
  

I'm attempting to generate some rrd graphs to track MTA connections for
postfix.  With sendmail it was possible to do this by greping the ps
list for the number of sendmail processes.  How would I accomplish this
on postfix?



grep for the smtp processes (not smtpd)
(or vice versa)

  

The number of smtp processes never changes so this won't work.


~Cory Coager




The information contained in this communication is intended
only for the use of the recipient(s) named above. It may
contain information that is privileged or confidential, and
may be protected by State and/or Federal Regulations. If
the reader of this message is not the intended recipient,
you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received
this communication in error, please return it to the sender
immediately and delete the original message and any copy
of it from your computer system. If you have any questions
concerning this message, please contact the sender.




Re: tracking MTA connections

2009-01-08 Thread Cory Coager



* Ralf Hildebrandt ralf.hildebra...@charite.de:

  

grep for the smtp processes (not smtpd)
(or vice versa)


The number of smtp processes never changes so this won't work.
  

Why ask if you know better? Of course it changes.



mail-ausfall:~# ps auxwww|grep smtp -n |wc -l
6
mail-ausfall:~# ps auxwww|grep smtp -n |wc -l
4

  

Unfortunately its not working.

# ps auxwww|grep smtp -n
postfix  16747  0.0  0.0   3728  1172 ?S10:08   0:00 smtp -n 
pmx -t unix -u
postfix  18905  0.0  0.0   3728  1160 ?S10:21   0:00 smtp -n 
pmx -t unix -u


The version installed is 2.5.4.  It doesn't look like child processes 
get spawned from new connections.  I ran the command on watch and the 
output never changes however postfix is processing about 5 messages per 
minute.  Why am I getting different results?  Is this a configuration tweak?



~Cory Coager




The information contained in this communication is intended
only for the use of the recipient(s) named above. It may
contain information that is privileged or confidential, and
may be protected by State and/or Federal Regulations. If
the reader of this message is not the intended recipient,
you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received
this communication in error, please return it to the sender
immediately and delete the original message and any copy
of it from your computer system. If you have any questions
concerning this message, please contact the sender.




Re: tracking MTA connections

2009-01-08 Thread Cory Coager

Noel Jones said the following on 01/08/2009 10:34 AM:
Postfix keeps idle processes around for $max_idle (default 100s), so 
the process count is only an approximation of the number of 
connections.  Idle processes are reused $max_use (default 100) times 
before they are retired.  The number of processes will change with the 
number of connections until the maximum number of configured 
connections is reached.  I suspect this is similar to what you get 
when counting sendmail processes.


To get an accurate connection count, you will need to parse netstat 
or lsof output to count established connections. Even this may give 
an inaccurate number if there are more connections than available 
smtpd processes.


I use this perl one liner on FreeBSD, you may need to adjust it for 
another OS.


netstat -an 2/dev/null | perl -lne '
$in = 0 if $in == undef;
$out = 0 if $out == undef;
++$in if (/ESTABLISHED/
 
/(?:^|\s)\d+\.\d+\.\d+\.\d+[.:](\d+)\s+\d+\.\d+\.\d+\.\d+[.:]\d+/

 $1 eq 25);
++$out if (/ESTABLISHED/
  
/(?:^|\s)\d+\.\d+\.\d+\.\d+[.:]\d+\s+\d+\.\d+\.\d+\.\d+[.:](\d+)/

  $1 eq 25);
END {print $ARGV[0], Port 25 status: , $in,  Established 
incoming, , $out,  Established outgoing};

'


Parsing netstat seems to work.  It doesn't need to be 100% accurate for 
what I'm doing.


Thanks!


~Cory Coager




The information contained in this communication is intended
only for the use of the recipient(s) named above. It may
contain information that is privileged or confidential, and
may be protected by State and/or Federal Regulations. If
the reader of this message is not the intended recipient,
you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received
this communication in error, please return it to the sender
immediately and delete the original message and any copy
of it from your computer system. If you have any questions
concerning this message, please contact the sender.