can't create user output file ...

Discussion in 'Installation/Configuration' started by dimitar, Apr 3, 2007.

  1. dimitar

    dimitar New Member

    Hi All,

    I am using Debian sarge and ISPconfig 2.2.11. I have a problem configuring the mailsystem. For a reason i want to use the mbox format. I have installed postfix, procmail, sasl and popa3d. When i send an email FROM ISPconfig account everything runs smoothly but unfortunately when i try to sent a mail TO ISPconfig user i get the following error in maillog:

    (can't create user output file. Command output: find: /var/mail/probe1234: Permission denied procmail: Lock failure on "/var/mail/probe1234.lock" procmail: Error while writing to "/var/mail/probe1234" )

    The webmail is also not working - it returns always: Wrong user/pass

    .procmail of user tester123:
    ## MAILDIR=$HOME/Maildir/
    ## DEFAULT=$MAILDIR
    ## ORGMAIL=$MAILDIR
    QUOTA=2097152
    INCLUDERC=/var/www/web1/user/tester123/.mailsize.rc

    INCLUDERC=/var/www/web1/user/tester123/.quota.rc
    ## INCLUDERC=/var/www/web1/user/tester123/.antivirus.rc
    ## INCLUDERC=/var/www/web1/user/tester123/.local-rules.rc
    ## INCLUDERC=/var/www/web1/user/tester123/.html-trap.rc
    ## INCLUDERC=/var/www/web1/user/tester123/.spamassassin.rc

    ## INCLUDERC=/var/www/web1/user/tester123/.autoresponder.rc


    Content of home dir of the user tester123:

    ls -la /var/www/web1/user/tester123

    drwxr-xr-x 3 tester123 web1 4096 2007-04-02 14:08 .
    drwxrwxr-x 6 dkgigaweb web245 4096 2007-04-03 09:49 ..
    -rw-r--r-- 1 root root 103 2007-04-03 09:08 .antivirus.rc
    -rw-r--r-- 1 root root 747 2007-04-03 09:08 .autoresponder.rc
    -rw-r--r-- 1 root root 22 2007-04-03 09:08 .bounce-exceed-quota.txt
    -rw------- 1 tester123 web1 24 2007-04-03 09:08 .forward
    -rw-r--r-- 1 root root 67866 2007-04-03 09:08 .html-trap.rc
    -rw-r--r-- 1 root root 3889 2007-04-03 09:08 .local-rules.rc
    -rw-r--r-- 1 root root 180 2007-04-03 09:08 .mailsize.rc
    -rw-r--r-- 1 root root 471 2007-04-03 09:08 .procmailrc
    -rw-r--r-- 1 root root 2663 2007-04-03 09:08 .quota.rc
    -rw-r--r-- 1 root root 1145 2007-04-03 09:08 .spamassassin.rc
    -rw-r--r-- 1 root root 1641 2007-04-03 09:08 .user_prefs
    -rw-r--r-- 1 root root 0 2007-04-03 09:08 .vacation.msg
    drwxrwxr-x 2 tester123 web1 4096 2007-04-02 14:04 web


    .quota.rc of tester123:

    # quota.rc by Stuart Clark/Falko Timme
    #
    # If mailbox size exceeds QUOTA, send reply email
    # using $PMDIR/bounce-exceed-quota.txt
    #
    #LOGFILE="/tmp/procmail.quota.log"
    #VERBOSE=NO

    PATH="/usr/bin:$PATH:/usr/local/bin"
    SHELL=/bin/sh
    EMAIL=`formail -zxTo:`

    :0 # if QUOTA is not set to something, then..
    * ! QUOTA ?? .
    {
    QUOTA=10000000000
    }

    :0 # if QUOTA is set to something, then..
    * QUOTA ?? .
    {
    QUOTA=`let HD_QUOTA=\`quota ${LOGNAME} | sed -n 3p | awk '{print $3}'\`*1024
    if [ $HD_QUOTA != 0 ]; then
    let HD_QUOTA_USED=\`quota ${LOGNAME} | sed -n 3p | awk '{print $2}'\`*1024
    let HD_QUOTA_FREE=${HD_QUOTA}-${HD_QUOTA_USED}
    if [ "$HD_QUOTA_FREE" -eq "$QUOTA" ]; then
    QUOTA=${QUOTA}
    else
    if [ "$HD_QUOTA_FREE" -gt "$QUOTA" ]; then
    QUOTA=${QUOTA}
    else
    QUOTA=${HD_QUOTA_FREE}
    fi
    fi
    else
    QUOTA=${QUOTA}
    fi
    echo ${QUOTA}`
    #MAILBOX_SIZE_REPORT_=`wc -c ${DEFAULT}`
    MAILBOX_SIZE_REPORT_=`cat \`find ${DEFAULT} -type f -follow\`| wc -c`

    :0 # if
    * MAILBOX_SIZE_REPORT_ ?? ^^ *\/[0-9]+
    { MAILBOX_SIZE_=${MATCH} }

    :0
    *$ ${QUOTA}^0
    *$ -${MAILBOX_SIZE_}^0
    { }
    MAILBOX_SIZE_ = $=

    :0
    * > ${MAILBOX_SIZE_}
    {
    # keep a backup for a while
    :0c
    /tmp/quota.${LOGNAME}

    :0 # lose items we don't want to bounce
    * 9876543210^0 ^FROM_DAEMON
    * 1^0 ^X-Loop: X-BOUNCE-FILE-SIZE
    /dev/null

    :0fi # double the head, lose the body
    * ^Subject: \/.*
    | sed -eH -e /./b -eg -eq

    SUBJECT="${MATCH}"

    :0f # invert and let second copy of head (the new body) be cited:
    | formail -rtk \
    -I"Subject: Returned Mail: ${SUBJECT}" \
    -I"From: ${EMAIL}" \
    -A"X-Bounced-Reason: Mailbox quota exceeded ${QUOTA} bytes" \
    -A"X-Loop: X-BOUNCE-FILE-SIZE"

    # insert explanation between head and new body;
    :0wf # explanation file should end with an empty line
    | sed -e '1,/^$/!b' -e/./b -e 'r /var/www/web1/user/tester123/.bounce-exceed-quota.txt'

    :0 # send this bounced message from ${EMAIL} using sendmail
    ! -f${EMAIL} -t
    }
    }
    #end


    Paths to:
    which quota - /usr/bin/quota
    which sed - /bin/sed
    which awk - /usr/bin/awk
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please make sure that your harddisk and especially the /var or /var/mail partition is not full. Also make sure that /var/mail/ is writable for all users as procmail writes the mbox files under the username that owns the mbox file.
     
  3. dimitar

    dimitar New Member

    ls -la /var/mail/ | grep tester123
    -rw------- 1 tester123 mail 0 2007-04-02 14:04 tester123


    ls -la /var
    total 68
    drwxr-xr-x 14 root root 4096 2007-03-27 08:29 .
    drwxr-xr-x 21 root root 4096 2007-03-27 08:16 ..
    drwxr-xr-x 2 root root 4096 2007-04-03 06:25 backups
    drwxr-xr-x 10 root root 4096 2007-03-27 08:41 cache
    drwxr-xr-x 24 root root 4096 2007-04-03 09:14 lib
    drwxrwsr-x 2 root staff 4096 2004-12-15 22:55 local
    drwxrwxrwt 3 root root 4096 2007-04-03 09:51 lock
    drwxr-xr-x 9 root root 4096 2007-04-03 06:25 log
    drw--w--w- 2 root mail 8192 2007-04-03 10:09 mail
    drwxr-xr-x 2 root root 4096 2005-09-06 14:16 opt
    drwxr-xr-x 14 root root 4096 2007-04-03 09:51 run
    drwxr-xr-x 7 root root 4096 2007-04-03 09:14 spool
    drwxrwxrwt 3 root root 4096 2007-03-27 08:48 tmp
    drwxr-xr-x 261 www-data web245 12288 2007-04-03 10:09 www


    ls -la /var/spool
    total 28
    drwxr-xr-x 7 root root 4096 2007-04-03 09:14 .
    drwxr-xr-x 14 root root 4096 2007-03-27 08:29 ..
    drwxr-xr-x 5 root root 4096 2005-09-06 14:18 cron
    drwxr-x--- 5 Debian-exim Debian-exim 4096 2005-09-06 14:18 exim4
    drwxrwsr-x 4 lp lp 4096 2007-04-01 06:47 lpd
    lrwxrwxrwx 1 root root 7 2007-03-27 07:13 mail -> ../mail
    drwxrwsr-x 2 root mail 4096 2007-04-03 09:10 pop
    drwxr-xr-x 20 root root 4096 2007-03-27 08:28 postfix


    Anybody can help?
    Thank you in advance!
    Regards
     
  4. dimitar

    dimitar New Member

    Hi Till,

    my hdd is partitioned only in 2 parts: / and /boot, the output of the df command:

    df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/md2 75G 1.6G 70G 3% /
    tmpfs 245M 0 245M 0% /dev/shm
    /dev/md0 47M 15M 30M 34% /boot


    I have experimented with my test user and changed the rights of /var/mail/probe1234: chmod -R 777 probe1234, but the same error appears:

    can't create user output file. Command output:
    find: /var/mail/probe1234: Permission denied procmail: Lock failure on
    "/var/mail/probe1234.lock" procmail: Error while writing to
    "/var/mail/probe1234"


    Thank you...
     
  5. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    repquota|grep probe1234
    ?
     

Share This Page