qmail variable $USER

volesak na aristia.cz volesak na aristia.cz
Středa Leden 28 17:33:21 CET 2004


Dobry den,
mam drobny problem. Potrebuji zajistit logovani qmail-pop3d demona. Pouzil
jsem postup popsany zde:
http://qmail.ruk.cuni.cz/top.html
Qmail-popup redirects stderr to stdout, thus making it impossible to write a
wrapper around qmail-pop3d which writes to the logfile by writing to stderr.
Being a little cleverer with the shell, you can also redirect FD 7 onto
stdout like this: 
/var/qmail/bin/qmail-pop3d-wrapper.sh /var/qmail/bin/qmail-pop3d Maildir
2>&1 7>&1

Once you've done that, qmail-pop3d-wrapper.sh can log to FD 7, like this: 
#!/bin/sh
echo "qmail-pop3d: user $USER logged in from $TCPREMOTEIP:$TCPREMOTEPORT"
>&7
$@



Problem je v tom, ze se mi misto uzivatelskeho jmena nezobrazi nic. Proste
to promennou $USER ignoruje ci co.
--------
Jan 28 17:29:04 dsmail pop3d: 1075307344.150413 qmail-pop3d:user logged in
from xxx.xxx.xxx.xxx:1573
--------
Neporadil by nekdo?
Diky moc
Honza Volesak


Další informace o konferenci Sendmail