Mail Errors - Ubuntu "Perfect" Setup

Discussion in 'HOWTO-Related Questions' started by justjim, Jun 18, 2006.

  1. justjim

    justjim New Member

    I seem to be running into occasional problems where scripts work on my sites that are professionally hosted, but they don't seem to work correctly on my Ubuntu "Perfect" server.

    Here is my latest issue which seems to be email related.

    I run a "tell-a-friend" script that works fine on other servers. However, on my Ubuntu server, I receive these errors when visitors complete my online form and the email gets generated.

    Any ideas?

    Thanks in advance:

    JustJim

    The errors:
    --------------------------------------------------------

    Jun 17 16:49:00 server1 postfix/pickup[5850]: 2F227794060: uid=33 from=<www-data>
    Jun 17 16:49:00 server1 postfix/cleanup[8076]: 2F227794060: message-id=<[email protected]>
    Jun 17 16:49:00 server1 postfix/qmgr[5851]: 2F227794060: from=<[email protected]>, size=1271, nrcpt=1 (queue active)
    Jun 17 16:49:01 server1 postfix/smtp[8078]: 2F227794060: to=<[email protected]>, relay=mail.electricscooteroutlet.com[67.15.80.19], delay=1, status=bounced (host mail.electricscooteroutlet.com[67.15.80.19] said: 553 5.1.8 <[email protected]>... Domain of sender address [email protected] does not exist (in reply to MAIL FROM command))
    Jun 17 16:49:01 server1 postfix/cleanup[8076]: 50BE6794061: message-id=<[email protected]>
    Jun 17 16:49:01 server1 postfix/qmgr[5851]: 2F227794060: removed
    Jun 17 16:49:01 server1 postfix/qmgr[5851]: 50BE6794061: from=<>, size=3485, nrcpt=1 (queue active)
    Jun 17 16:49:01 server1 postfix/local[8080]: 50BE6794061: to=<[email protected]>, relay=local, delay=0, status=bounced (maildir delivery failed: create /var/www/Maildir/tmp/1150580941.P8080.server1.greatgolfswing.com: Permission denied)
    Jun 17 16:49:01 server1 postfix/local[8080]: warning: maildir access problem for UID/GID=33/33: create /var/www/Maildir/tmp/1150580941.P8080.server1.greatgolfswing.com: Permission denied
    Jun 17 16:49:01 server1 postfix/local[8080]: warning: perhaps you need to create the maildirs in advance
    Jun 17 16:49:01 server1 postfix/qmgr[5851]: 50BE6794061: removed
    Jun 17 16:49:06 server1 courierpop3login: Connection, ip=[::ffff:192.168.1.1]
    Jun 17 16:49:06 server1 courierpop3login: LOGIN, user=myuserid, ip=[::ffff:192.168.1.1]
    Jun 17 16:49:06 server1 courierpop3login: LOGOUT, user=myuserid, ip=[::ffff:192.168.1.1], top=0, retr=0, time=0
    Jun 17 16:49:11 server1 courierpop3login: Connection, ip=[::ffff:192.168.1.1]
    Jun 17 16:49:11 server1 courierpop3login: LOGIN, user=myuserid, ip=[::ffff:192.168.1.1]
    Jun 17 16:49:11 server1 courierpop3login: LOGOUT, user=myuserid, ip=[::ffff:192.168.1.1], top=0, retr=0, time=0
     
  2. joe

    joe New Member HowtoForge Supporter

    The key to the problem is here:

    Code:
    (maildir delivery failed: create /var/www/Maildir/tmp/1150580941.P8080.server1.greatgolfswing.com: Permission denied)
    It looks like the user that Postfix is running as does not have permission to write to the /var/www/Maildir/tmp directory. If you do a

    Code:
    ps aux
    you'll be able to see what user postfix is. Then modify the permissions on the /var/www/Maildir directory so it's able to write there.
     
  3. justjim

    justjim New Member

    I guess I'm not following what you are instructing:

    When I do a ps aux, I get what is in the attached file:

    -----------------------------------------
    What am I looking for here?

    Also, which folder (exactly) do I make the change to?
    [/var/www/web#/maildir/tmp]? Is this correct?

    What permission settings do I make that folder?

    Thanks again!
     

    Attached Files:

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The directory /var/www/Maildir/tmp/ looks a bit starnge for me, this directory means that a user has /var/www assignes as home directory.

    Do you have ISPConfig installed on your server?
     
  5. justjim

    justjim New Member

    Yes, I do have ISPConfig installed.

    - Jim
     
  6. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -la /var/www
    ? What's in /etc/postfix/main.cf (please strip out the comments)?
     
  7. justjim

    justjim New Member

    Default Mail Errors - Ubuntu "Perfect" Setup

    Here is the output of ls -la /var/www:

    total 32
    drwxr-xr-x 8 root root 4096 2006-06-10 12:06 .
    drwxr-xr-x 16 root root 4096 2006-05-29 15:42 ..
    drwxr-xr-x 2 root root 4096 2006-06-10 22:17 apache2-default
    drwxr-xr-x 3 root root 4096 2006-06-01 00:30 localhost
    drwxr-xr-x 2 root root 4096 2006-05-29 15:01 sharedip
    drwxr-xr-x 8 jdstockton4 web1 4096 2006-06-04 09:42 web1
    drwxr-xr-x 8 testclient web2 4096 2006-06-11 04:00 web2
    drwxr-xr-x 2 root root 4096 2006-05-29 14:51 webalizer
    lrwxrwxrwx 1 www-data web2 13 2006-06-10 12:06 www.bridalshowermall.com -> /var/www/web2
    lrwxrwxrwx 1 www-data web1 13 2006-05-29 16:15 www.greatgolfswing.com -> / var/www/web1


    Here is /etc/postfix/main.cf

    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no

    append_dot_mydomain = no

    myhostname = server1.greatgolfswing.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    #mydestination = server1.greatgolfswing.com, localhost.greatgolfswing.com, localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    myorigin = /etc/mailname
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtpd_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    home_mailbox = Maildir/

    virtual_maps = hash:/etc/postfix/virtusertable

    mydestination = /etc/postfix/local-host-names


    Thanks again for your assistance!
    - Jim
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Do you have a user with /var/www as his homedir?
    When someone sends a mail to that user, Postfix tries to deliver it to /var/www/maildir because of the
    Code:
    home_mailbox = Maildir/
    line in main.cf, but Postfix does it as that user but this cannot work because /var/www is owned by root and has permissions of 755.
     
  9. justjim

    justjim New Member

    Mair Errors - Ubuntu "Perfect" Setup

    Where are the user's home directories established?

    I only have two users set up on the system (root & admin), plus another two setup within ISPConfig (jdstockton4 & testclient). I'm not aware of anyone having this set up as their home directory....at least I haven't set this up anywhere on my own. Is this a default setting for any part of the setup....as I followed all of the instructions in the How to Forge guide to get this far.

    Where would I go to check this?

    Thanks again!

    - Jim
     
  10. falko

    falko Super Moderator Howtoforge Staff

    You can check the users' homedirs in /etc/passwd.
     
  11. justjim

    justjim New Member

    Here is the contents of that file:

    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/bin/sh
    bin:x:2:2:bin:/bin:/bin/sh
    sys:x:3:3:sys:/dev:/bin/sh
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/bin/sh
    man:x:6:12:man:/var/cache/man:/bin/sh
    lp:x:7:7:lp:/var/spool/lpd:/bin/sh
    mail:x:8:8:mail:/var/mail:/bin/sh
    news:x:9:9:news:/var/spool/news:/bin/sh
    uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
    proxy:x:13:13:proxy:/bin:/bin/sh
    www-data:x:33:33:www-data:/var/www:/bin/sh
    backup:x:34:34:backup:/var/backups:/bin/sh
    list:x:38:38:Mailing List Manager:/var/list:/bin/sh
    irc:x:39:39:ircd:/var/run/ircd:/bin/sh
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
    nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
    dhcp:x:101:101::/nonexistent:/bin/false
    syslog:x:102:102::/home/syslog:/bin/false
    klog:x:103:103::/home/klog:/bin/false
    admin:x:1000:1000:Administrator,,,:/home/admin:/bin/bash
    cupsys:x:100:104::/:/bin/false
    fetchmail:x:104:65534::/var/lib/fetchmail:/bin/sh
    messagebus:x:105:109::/var/run/dbus:/bin/false
    hal:x:110:110:Hardware abstraction layer,,,:/var/run/hal:/bin/false
    saned:x:111:111::/home/saned:/bin/false
    gdm:x:106:112:Gnome Display Manager:/var/lib/gdm:/bin/false
    hplip:x:107:7:HPLIP system user,,,:/var/run/hplip:/bin/false
    sshd:x:108:65534::/var/run/sshd:/bin/false
    bind:x:109:113::/var/cache/bind:/bin/false
    mysql:x:112:114:MySQL Server,,,:/var/lib/mysql:/bin/false
    postfix:x:113:115::/var/spool/postfix:/bin/false
    ftp:x:114:65534::/home/ftp:/bin/false
    admispconfig:x:1001:1001:Administrator ISPConfig:/home/admispconfig:/bin/bash
    jdstockton4:x:10002:10001:Administrator:/var/www/web1:/bin/false
    testclient:x:10003:10002:Test Client:/var/www/web2:/bin/false
    haldaemon:x:117:117:Hardware abstraction layer,,,:/var/run/hal:/bin/false
     
  12. falko

    falko Super Moderator Howtoforge Staff

    www-data's homedir is /var/www, so someone is trying to send emails to your Apache user. Find out who or which program does it. Normally you don't send emails to www-data.
    If you need to receive these emails, you can either run
    Code:
    chown www-data /var/www
    or you create an alias for www-data in /etc/aliases and forward the emails to another user (e.g. root) or email address.
    If you change /etc/aliases, you must run
    Code:
    newaliases
    afterwards and restart Postfix.
     
  13. justjim

    justjim New Member

    I tried both of these options, but neither worked. As a last resort, I uninstalled Ubuntu and reloaded my server with SUSE 9.3. Now, instead of the error reporting: [email protected]
    instead, it reports: [email protected]

    Can anyone explain what is taking place here? This script works fine on my accounts that are professionally hosted.

    Here is the complete error log for this transaction:

    Jun 25 10:46:33 server1 postfix/pickup[32057]: 5D8B31E10A: uid=30 from=<wwwrun>
    Jun 25 10:46:33 server1 postfix/cleanup[1185]: 5D8B31E10A: message-id=<[email protected]>
    Jun 25 10:46:33 server1 postfix/qmgr[32059]: 5D8B31E10A: from=<[email protected]>, size=543, nrcpt=1 (queue active)
    Jun 25 10:46:33 server1 postfix/pickup[32057]: 6B55A1E25C: uid=10001 from=<jdstockton-ggs>
    Jun 25 10:46:33 server1 postfix/cleanup[1185]: 6B55A1E25C: message-id=<[email protected]>
    Jun 25 10:46:33 server1 postfix/local[1187]: 5D8B31E10A: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Jun 25 10:46:33 server1 postfix/qmgr[32059]: 5D8B31E10A: removed
    Jun 25 10:46:33 server1 postfix/qmgr[32059]: 6B55A1E25C: from=<[email protected]>, size=411, nrcpt=1 (queue active)
    Jun 25 10:46:33 server1 postfix/local[1187]: 6B55A1E25C: to=<[email protected]>, orig_to=<admispconfig@localhost>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Jun 25 10:46:33 server1 postfix/qmgr[32059]: 6B55A1E25C: removed
    Jun 25 10:46:43 server1 pop3d: Connection, ip=[::ffff:192.168.1.1]
    Jun 25 10:46:43 server1 pop3d: LOGIN, user=jdstockton-ggs, ip=[::ffff:192.168.1.1]
    Jun 25 10:46:43 server1 pop3d: LOGOUT, user=jdstockton-ggs, ip=[::ffff:192.168.1.1], top=0, retr=675, time=0
    Jun 25 10:47:09 server1 postfix/pickup[32057]: 764651E25C: uid=30 from=<wwwrun>
    Jun 25 10:47:09 server1 postfix/cleanup[1185]: 764651E25C: message-id=<[email protected]>
    Jun 25 10:47:09 server1 postfix/qmgr[32059]: 764651E25C: from=<[email protected]>, size=500, nrcpt=1 (queue active)
    Jun 25 10:47:09 server1 postfix/pickup[32057]: 81B931E25E: uid=10001 from=<jdstockton-ggs>
    Jun 25 10:47:09 server1 postfix/cleanup[1185]: 81B931E25E: message-id=<[email protected]>
    Jun 25 10:47:09 server1 postfix/local[1187]: 764651E25C: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Jun 25 10:47:09 server1 postfix/qmgr[32059]: 764651E25C: removed
    Jun 25 10:47:09 server1 postfix/qmgr[32059]: 81B931E25E: from=<[email protected]>, size=411, nrcpt=1 (queue active)
    Jun 25 10:47:09 server1 postfix/local[1187]: 81B931E25E: to=<[email protected]>, orig_to=<admispconfig@localhost>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Jun 25 10:47:09 server1 postfix/qmgr[32059]: 81B931E25E: removed
    Jun 25 10:47:20 server1 pop3d: Connection, ip=[::ffff:192.168.1.1]
    Jun 25 10:47:20 server1 pop3d: LOGIN, user=jdstockton-ggs, ip=[::ffff:192.168.1.1]
    Jun 25 10:47:21 server1 pop3d: LOGOUT, user=jdstockton-ggs, ip=[::ffff:192.168.1.1], top=0, retr=633, time=1
    Jun 25 10:48:12 server1 postfix/pickup[32057]: 05A031E25C: uid=30 from=<wwwrun>
    Jun 25 10:48:12 server1 postfix/cleanup[1185]: 05A031E25C: message-id=<[email protected]>
    Jun 25 10:48:12 server1 postfix/qmgr[32059]: 05A031E25C: from=<[email protected]>, size=1175, nrcpt=1 (queue active)
    Jun 25 10:48:12 server1 postfix/smtp[1249]: warning: connect to private/tlsmgr: No such file or directory
    Jun 25 10:48:12 server1 postfix/pickup[32057]: 0E2B41E25E: uid=30 from=<wwwrun>
    Jun 25 10:48:12 server1 postfix/cleanup[1185]: 0E2B41E25E: message-id=<[email protected]>
    Jun 25 10:48:12 server1 postfix/qmgr[32059]: 0E2B41E25E: from=<[email protected]>, size=486, nrcpt=1 (queue active)
    Jun 25 10:48:12 server1 postfix/pickup[32057]: 183471E260: uid=10001 from=<jdstockton-ggs>
    Jun 25 10:48:12 server1 postfix/cleanup[1185]: 183471E260: message-id=<[email protected]>
    Jun 25 10:48:12 server1 postfix/local[1187]: 0E2B41E25E: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Jun 25 10:48:12 server1 postfix/qmgr[32059]: 0E2B41E25E: removed
    Jun 25 10:48:12 server1 postfix/qmgr[32059]: 183471E260: from=<[email protected]>, size=411, nrcpt=1 (queue active)
    Jun 25 10:48:12 server1 postfix/local[1187]: 183471E260: to=<[email protected]>, orig_to=<admispconfig@localhost>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Jun 25 10:48:12 server1 postfix/qmgr[32059]: 183471E260: removed
    Jun 25 10:48:13 server1 postfix/smtp[1249]: warning: connect to private/tlsmgr: No such file or directory
    Jun 25 10:48:13 server1 postfix/smtp[1249]: warning: problem talking to server private/tlsmgr: No such file or directory
    Jun 25 10:48:13 server1 postfix/smtp[1249]: warning: no entropy for TLS key generation: disabling TLS support
    Jun 25 10:48:13 server1 postfix/smtp[1249]: 05A031E25C: to=<[email protected]>, relay=mail.thingsyougottasee.com[66.98.158.47], delay=1, status=bounced (host mail.thingsyougottasee.com[66.98.158.47] said: 553 5.1.8 <[email protected]>... Domain of sender address [email protected] does not exist (in reply to MAIL FROM command))
    Jun 25 10:48:13 server1 postfix/cleanup[1185]: 902211E260: message-id=<[email protected]>
    Jun 25 10:48:13 server1 postfix/qmgr[32059]: 902211E260: from=<>, size=3350, nrcpt=1 (queue active)
    Jun 25 10:48:13 server1 postfix/qmgr[32059]: 05A031E25C: removed
    Jun 25 10:48:13 server1 postfix/local[1187]: 902211E260: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0, status=sent (delivered to maildir)
    Jun 25 10:48:13 server1 postfix/qmgr[32059]: 902211E260: removed
     
  14. falko

    falko Super Moderator Howtoforge Staff

    I explained it in my previous post. On SuSE, the Apache usrr is called wwwrun instead of www-data.

    You must create an A record for server1.greatgolfswing.com.
    What's in /etc/aliases?
     
  15. justjim

    justjim New Member

    Falko,

    Thanks for your reply! Which previous post are you referring to? I could not find one that mentions this!

    OK! I have created an A record for server1.greatgolfswing.com
    I will try this again once the A record takes affect.

    Here is /etc/aliases:
    ------------------------------

    # Basic system aliases that MUST be present.
    postmaster: root
    mailer-daemon: postmaster

    # amavis
    virusalert: root

    # General redirections for pseudo accounts in /etc/passwd.
    administrator: root
    daemon: root
    lp: root
    news: root
    uucp: root
    games: root
    man: root
    at: root
    postgres: root
    mdom: root
    amanda: root
    ftp: root
    wwwrun: root
    squid: root
    msql: root
    gnats: root
    nobody: root
    # "bin" used to be in /etc/passwd
    bin: root

    # Further well-known aliases for dns/news/ftp/mail/fax/web/gnats.
    newsadm: news
    newsadmin: news
    usenet: news
    ftpadm: ftp
    ftpadmin: ftp
    ftp-adm: ftp
    ftp-admin: ftp
    hostmaster: root
    mail: postmaster
    postman: postmaster
    post_office: postmaster
    # "abuse" is often used to fight against spam email
    abuse: postmaster
    spam: postmaster
    faxadm: root
    faxmaster: root
    webmaster: root
    gnats-admin: root
    mailman: root
    mailman-owner: mailman
     
  16. justjim

    justjim New Member

    Hello,

    Creating the "A" record for server1.greatgolfswing.com corrected this problem.

    Thanks again for your help!
    Best wishes!

    - Jim
     
  17. falko

    falko Super Moderator Howtoforge Staff

    It's post #12 in this thread. :)
     
  18. nenad

    nenad Member

    It seems that I have similiar problem ??:

     
  19. falko

    falko Super Moderator Howtoforge Staff

    Someone is trying to send a mail to the user www-data (that's the Apache user) on your system. Maybe a bounced message or something like that. I think you can ignore it.
     

Share This Page