Mail problems after following Virtual Users And Domains With Postfix, Courier

Discussion in 'HOWTO-Related Questions' started by tyliong, Jan 6, 2009.

  1. tyliong

    tyliong New Member

    I followed the instructions on "Virtual Users And Domains With Postfix, Courier And MySQL (CentOS 5.1)" and everything is running but I can't get outlook to sync with the server because of some permission or file creation problem. the smtp server seems to be working as i do smtp.mydomain.com and a test email can be sent through and the login is accepted.

    However the pop3 server is not responding. Is pop3.mydomain.com suppose to be the pop server or is it suppose to something else?

    Jan 6 21:55:28 localhost pop3d: Connection, ip=[::ffff:210.193.49.322]
    Jan 6 21:56:13 localhost pop3d: chdir mydomain.com/mydomain_director/: No such file or directory
    Jan 6 21:56:30 localhost pop3d: Connection, ip=[::ffff:210.193.49.322]
    Jan 6 21:56:48 localhost pop3d: LOGIN FAILED, user=mydomain_mailer, ip=[::ffff:210.193.49.322]
    tail: cannot open `error' for reading: No such file or directory


    i seem to have be able to send a test message



    Jan 6 22:09:24 localhost postfix/smtpd[21892]: connect from bb121-6-12-193.myisp.com[123.4.12.123]
    Jan 6 22:09:25 localhost postfix/smtpd[21892]: 1D60D5720049: client=bb121-6-12-123.myisp.com[123.4.12.123]
    Jan 6 22:09:25 localhost postfix/cleanup[21900]: 1D60D5720049: message-id=<[email protected] m>
    Jan 6 22:09:25 localhost postfix/qmgr[15155]: 1D60D5720049: from=<[email protected]>, size=753, nrcpt=1 (queue active)
    Jan 6 22:09:25 localhost postfix/smtpd[21892]: disconnect from bb121-6-12-123.myisp.com[123.4.12.123]
    Forward Message


    One extra question, how do i stop an account from receiving email but allow it to send email? this is for a user authentication system.
    this is the mail log error. apparently there are no directories created for the users
     
  2. volksman

    volksman New Member

    Are you sure you have given permissions to the /home/vmail directory as per the howto?

    As for an e-mail addy that can send but not receive you just send with a from addy that doesn't exist. Something like [email protected]. The mail server doesn't need to know about it at all. However if you need to authenticate against your SMTP server in order to send that then you will need to provide your script with credentials (any will do, you don't need to setup an specifically for it).
     
  3. tyliong

    tyliong New Member

    hmm i think the second question should be in another thread. don't want to get the two mixed up.(btw i still don't get what u mean but never mind i'll start another thread on it)

    Back to the important thing yes i did try this:

    groupadd -g 5000 vmail
    useradd -g vmail -u 5000 vmail -d /home/vmail -m

    which gives me back

    [root@localhost ~]# groupadd -g 5000 vmail
    groupadd: group vmail exists
    You have new mail in /var/spool/mail/root

    [root@localhost ~]# useradd -g vmail -u 5000 vmail -d /home/vmail -m
    useradd: user vmail exists


    is there something i have missed?
     
  4. volksman

    volksman New Member

    Well that creates the user and group on the system. So that's a good start.

    What are the permissions on the /home/vmail directory? Who owns it?

    'ls -la /home'

    Would spit out what we need to see.
     
  5. tyliong

    tyliong New Member

    drwx------ 3 vmail vmail 4096 Jan 6 13:19 vmail
     
  6. volksman

    volksman New Member

    And the contents of the vmail directory. Does it have the same perms/ownership?
     
  7. tyliong

    tyliong New Member

    drwx------ 3 vmail vmail 4096 Jan 6 13:19 .
    drwxr-xr-x 6 root root 4096 Jan 6 13:19 ..
    -rw-r--r-- 1 vmail vmail 33 Jan 6 13:19 .bash_logout
    -rw-r--r-- 1 vmail vmail 176 Jan 6 13:19 .bash_profile
    -rw-r--r-- 1 vmail vmail 124 Jan 6 13:19 .bashrc
    drwxr-xr-x 4 vmail vmail 4096 Jan 6 13:19 .mozilla
    -rw-r--r-- 1 vmail vmail 658 Jan 6 13:19 .zshrc
     
  8. volksman

    volksman New Member

    hrm...interesting.

    Looks like postfix isn't creating the domain/user directories. Did you send a test message TO an account in your domain? IE send a message to [email protected] and make sure your server logs show it was received and sorted by your mail server. Then check the /home/vmail dir again to see if a directory "yourdomain.com" was created with a user directory under it called "you" (based on my example above).
     
  9. tyliong

    tyliong New Member

  10. tyliong

    tyliong New Member

    i can't do that for some reason it stalls after i type subject
     
  11. volksman

    volksman New Member

  12. tyliong

    tyliong New Member

    -bash-3.2$ mail [email protected]
    Subject: hello.
    .
    Cc:
    Null message body; hope that's ok
    -bash-3.2$

    [root@localhost ~]# cd /home/vmail
    [root@localhost vmail]# ls
    [root@localhost vmail]# pwd
    /home/vmail


    nope didn't create it
     
  13. volksman

    volksman New Member

    And your logs show that the message was received by your server and delivered to a mailbox?

    tail -f /var/log/mail.log
     
  14. tyliong

    tyliong New Member

    cent is tail -f /var/log/maillog error

    Jan 7 00:58:48 localhost amavis[19474]: (19474-20) Passed CLEAN, MYNETS LOCAL [127.0.0.1] [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: 5y94daIWtZg3, Hits: 2.866, size: 587, queued_as: 17C7757200E4, 13229 ms
    Jan 7 00:58:48 localhost postfix/smtp[22775]: CF1F557200C2: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=13, delays=0.08/0/0/13, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 17C7757200E4)
    Jan 7 00:58:48 localhost postfix/qmgr[22651]: CF1F557200C2: removed
    Jan 7 00:58:48 localhost postfix/smtp[22780]: 17C7757200E4: to=<[email protected]>, relay=none, delay=0.07, delays=0.05/0.01/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=mail.mydomain.com type=A: Host not found)
    Jan 7 00:58:48 localhost postfix/cleanup[22774]: 31E1657200B2: message-id=<[email protected]>
    Jan 7 00:58:48 localhost postfix/bounce[22781]: 17C7757200E4: sender non-delivery notification: 31E1657200B2
    Jan 7 00:58:48 localhost postfix/qmgr[22651]: 31E1657200B2: from=<>, size=3338, nrcpt=1 (queue active)
    Jan 7 00:58:48 localhost postfix/qmgr[22651]: 17C7757200E4: removed
    Jan 7 00:58:48 localhost postfix/local[22782]: 31E1657200B2: to=<[email protected]>, relay=local, delay=0.08, delays=0.04/0/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox)
    Jan 7 00:58:48 localhost postfix/qmgr[22651]: 31E1657200B2: removed
    tail: cannot open `error' for reading: No such file or directory


    uh oh i am gussing a bad mx record inc
     
  15. volksman

    volksman New Member

    Yup...although it may not be an mx record. Your host just can't find an IP for mail.mydomain.com. Can add that to /etc/hosts for testing or get your DNS server to properly announce the IP.
     
  16. tyliong

    tyliong New Member

    Funny u should say that i don't really know much about changing the host file or dns. where would i add it?

    there is only 1 ip currently for the server

    /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6
    211.193.49.223 casper.mydomain.com capser



    /var/named/chroot/var/named/mydomain.com.db

    $TTL 14400

    mydomain.com. IN SOA ns1.mydomain.com. root (
    2009123100 ; serial
    3H ; refresh (3 hours)
    30M ; retry (30 minutes)
    2W ; expiry (2 weeks)
    1W) ; minimum (1 week)


    ; Since you're using short names (ns1 instead of ns1.mydomain.com.
    ; you must delcare the origin
    $ORIGIN mydomain.com.


    mydomain.com. IN NS ns1.mydomain.com.

    IN MX 10 smtp.mydomain.com.
    ns1 IN A 211.193.49.223 ;primary name server

    casper IN A 211.193.49.223

    smtp IN A 211.193.49.223 ;mail server

    www IN CNAME casper ;web server
    ftp IN CNAME casper ;ftp server
    ;serverA IN TXT "Fax: 999-999-9999"
    ; IPv6 entries for serverA (serverA-v6) and serverB (serverB-v6) are below
    ;serverA-v6 IN AAAA 2001:DB8::1
    ;serverB-v6 IN AAAA 2001:DB8::2
     
  17. volksman

    volksman New Member

    That zone looks ok. From your server can you resolve mail.mydomain.com:

    dig +short @localhost mail.mydomain.com

    If you get an IP back from that command then the DNS is setup correctly and you may just need to update /etc/resolv.conf to use localhost for lookups and not a third party server.

    If you don't then you have DNS issues too.

    /etc/hosts would look something like:

    xxx.xxx.xxx.xxx mail.mydomain.com

    save and exit and your machine should resolve mail.mydomain.com.
     
  18. tyliong

    tyliong New Member

    dig +short @localhost mail.mydomain.com

    does not give anything in return.
     
  19. volksman

    volksman New Member

    Then your DNS is busted too. So update your hosts file for now to test the mail server. Once you get that working then focus on cleaning up the DNS issue.
     
  20. tyliong

    tyliong New Member

    When i update the host file do i need to restart any services?


    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6
    212.193.49.223 casper.mydomain.com capser
    212.193.49.223 mail.mydomain.com



    [root@localhost vmail]# mail [email protected]
    Subject: hello again
    .
    Cc:
    Null message body; hope that's ok
    [root@localhost vmail]# cd /home/vmail
    [root@localhost vmail]# ls
    [root@localhost vmail]#

    Jan 7 01:41:12 localhost amavis[19475]: (19475-20) Passed CLEAN, MYNETS LOCAL [127.0.0.1] [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: rp4RgTenle3A, Hits: 2.866, size: 589, queued_as: 3AFFD57200B2, 1641 ms
    Jan 7 01:41:12 localhost postfix/smtp[23043]: 8C34857200B1: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.7, delays=0.08/0/0/1.6, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 3AFFD57200B2)
    Jan 7 01:41:12 localhost postfix/qmgr[22651]: 8C34857200B1: removed
    Jan 7 01:41:12 localhost postfix/smtp[23048]: 3AFFD57200B2: to=<[email protected]>, relay=none, delay=0.06, delays=0.05/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=mail.mydomain.com type=A: Host not found)
    Jan 7 01:41:12 localhost postfix/cleanup[23042]: 52D4657200B3: message-id=<[email protected]>
    Jan 7 01:41:12 localhost postfix/qmgr[22651]: 52D4657200B3: from=<>, size=3330, nrcpt=1 (queue active)
    Jan 7 01:41:12 localhost postfix/bounce[23049]: 3AFFD57200B2: sender non-delivery notification: 52D4657200B3
    Jan 7 01:41:12 localhost postfix/qmgr[22651]: 3AFFD57200B2: removed
    Jan 7 01:41:12 localhost postfix/local[23051]: 52D4657200B3: to=<[email protected]>, relay=local, delay=0.07, delays=0.03/0.01/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox)
    Jan 7 01:41:12 localhost postfix/qmgr[22651]: 52D4657200B3: removed
    tail: cannot open `error' for reading: No such file or directory
     

Share This Page