[tpop3d-discuss]Re: pop before smtp and logging..

Dom Gallagher dgallagher at starnetusa.net
Mon, 10 May 2004 12:38:16 -0500

At 06:00 AM 5/10/2004, tpop3d-discuss-request@lists.beasts.org wrote:
>Date: Mon, 10 May 2004 00:03:16 -0700
>From: James Gurney <james@globalmegacorp.org>
>To: tpop3d-discuss@lists.beasts.org
>Subject: [tpop3d-discuss]pop before smtp and logging..
>2 questions..
>1. Ignoring the fact that pop-before-smtp is the root of all evil, has
>anyone succesfully implemented this with postfix, using the builtin
>system? I've had a look at the relaydbm script, but I must confess my
>perl knowledge is sorely lacking, and if someone else has done this
>already, it would make my life a lot easier, and far better than the
>kludgy system I use now which tail -f's the logfile.

I've got it working via a MySQL map, and it works extremely well.  I've 
since moved to a SASL2 implementation, but I don't recommend doing so 
unless you have a lot of time and patience!  Here's my config; I have a 
reaper script go through and remove older entries.

user = mysqluser
password = mysqlpass
dbname = mail
table = relay
select_field = relay
where_field = relay
hosts = localhost

Relay table:
   relay varchar(15) NOT NULL default '',
   user varchar(255) default NULL,
   entered_at datetime default NULL,
   PRIMARY KEY  (relay),
   UNIQUE KEY user (user)

tpop3d config:
auth-mysql-onlogin-query: REPLACE INTO relay VALUES \
  ( '$(clienthost)', '$(local_part)\@$(domain)', NOW() )

Postfix main.cf:
mynetworks = $config_directory/mynetworks, $config_directory/mysql/relay.cf

>2. The tpop3d logging is reaaallly noisy. One single mail check appears
>to generate 6 lines of logfile. With multiple users all checking the
>mail on a regular basis (ie, every 2 minutes), the mail log quickly gets
>very big. Realistically, I don't need the current verbosity level. Hell,
>I'd be happy with just logging failed connections. I know this has been
>asked before, but I couldn't find a good answer - is there a way to make
>the logging less noisy? It would be really handy if it was a
>configuration option so you could enable more detailed logging for
>troubleshooting, but leave it nice and quiet for day to day operations.

Set the loglevel in your syslog daemon down.
You can set a separate log level if you want 'info' or similar on Postfix 

log-facility: local0

syslog.conf (use tabs):
# Mail related logs:
mail.info               /var/log/maillog
local0.warn             /var/log/maillog

Hope that helps,


Dom Gallagher (dgallagher@starnetusa.net)
Development Engineering
StarNet/MegaPOP - http://www.megapop.net

This message is sent in confidence to the addressees.
It may contain privileged, proprietary, or confidential information.