Sendmail w/Dovecot Centos 5 All inbound mail goes to root only and not to users

Discussion in 'Installation/Configuration' started by vestport, Aug 14, 2007.

  1. vestport

    vestport Member

    Hello,

    I have setup a centos 5 server w/sendmail and dovecot. For now I am simply trying to get email working with the command line "mail" program. My MX records are setup as well as reverse lookups on DNS servers. I can send outbound mail fine. The problem is that any inbound mail only goes to the "root" account no matter who the intended recipient is. Even mail on localhost is not working correctly. user@localhost can email roo@localhost fine but email from root@localhost to user@localhost never gets through and ends up in the root mail folder. In short all received emails locally or from the net go to the root account and not to the users that they are addressed to. Outbound emails from regular users are addressed correctly.

    I will add that normal users accounts do not appear to have a "Mailbox" of any kind in their home directory. I just don't know what I am missing here. Do I need a .procmailrc or .mailrc in the users directory or an /etc/procmailrc or something?

    I have setup sendmail in the past but I admit it was some time ago and I am a bit rusty. Also, security and configuration issues have surely changed since I set a mail server up last. Any help is greatly appreciated.


    My domain is psfleasing.com, server is mail.psfleasing.com. Here is a printout of my /var/log/maillog with root trying to email a user account "www@localhost" on the mail.psfleasing.com server.


    I do a "mail www@localhost" from the # command line and below is what I see in the maillog.

    Aug 14 17:26:13 mail sendmail[7068]: l7ELQDRj007068: from=root, size=38, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
    Aug 14 17:26:13 mail sendmail[7069]: l7ELQDak007069: from=<[email protected]>, size=335, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v6, relay=localhost.localdomain [127.0.0.1]
    Aug 14 17:26:13 mail sendmail[7068]: l7ELQDRj007068: to=www@localhost, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30038, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (l7ELQDak007069 Message accepted for delivery)
    Aug 14 17:26:13 mail sendmail[7070]: l7ELQDak007069: to=root, ctladdr=<[email protected]> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30565, dsn=2.0.0, stat=Sent


    It says it sent but is not there if I login to my "www" user account.


    The user mailbox is not setup correctly and I don't really know where to start.


    Thanks


    Art
     
  2. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/aliases?

    The mboxes are in /var/spoll/mail; if you use Maildir instead, the Maildirs are created in the users' home directories.
     
  3. vestport

    vestport Member

    My /etc/aliases

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

    # General redirections for pseudo accounts.
    bin: root
    daemon: root
    adm: root
    lp: root
    sync: root
    shutdown: root
    halt: root
    mail: root
    news: root
    uucp: root
    operator: root
    games: root
    gopher: root
    ftp: root
    nobody: root
    radiusd: root
    nut: root
    dbus: root
    vcsa: root
    canna: root
    wnn: root
    rpm: root
    nscd: root
    pcap: root
    apache: root
    webalizer: root
    dovecot: root
    fax: root
    quagga: root
    radvd: root
    pvm: root
    amanda: root
    privoxy: root
    ident: root
    named: root
    xfs: root
    gdm: root
    mailnull: root
    postgres: root
    sshd: root
    smmsp: root
    postfix: root
    netdump: root
    ldap: root
    squid: root
    ntp: root
    mysql: root
    desktop: root
    rpcuser: root
    rpc: root
    nfsnobody: root

    ingres: root
    system: root
    toor: root
    manager: root
    dumper: root
    abuse: root

    newsadm: news
    newsadmin: news
    usenet: news
    ftpadm: ftp
    ftpadmin: ftp
    ftp-adm: ftp
    ftp-admin: ftp
    www: webmaster
    webmaster: root
    noc: root
    security: root
    hostmaster: root
    info: postmaster
    marketing: postmaster
    sales: postmaster
    support: postmaster


    # trap decode to catch security attacks
    decode: root

    # Person who should get root's mail
    #root: marc
     
  4. vestport

    vestport Member

    Mailbox locations

    Mailboxes are in /var/spool/mail.

    Only root has data. User mailbox for user "www" is created but empty even though I have tried to mail this user many times.


    Thanks for having a look at this Falko!


    Art
     
  5. vestport

    vestport Member

    Mail problem partially resolved

    Hello Falko, I see in checking the /etc/aliases file there is a reserved user "www" for httpd. Duhhhhh, foolishly I chose this username for one of my user accounts and this obviously explains most of the failures.

    I have another user "art" that indeed has mail in "Maildir" however just typing "mail" at the "$" prompt says:

    No mail for art
    [art@mail ~]$

    when there is in fact mail there.

    If I cat the actual messages in the Maildir they are indeed there. I guess I just cant use "www" for a user name . With that solved how can I get "mail" to show me messages for user "art" ?

    Right now it says:


    No mail for art
    [art@mail ~]$

    when there are actually messages there.

    Sorry as I said I am a bit rusty and foolishly selected a reserved user as a username initially.


    With that said and where I am at this point how do I get the "mail" program to actually show me the messages? Is this where I need .mailrc I assume? If so what do I include in my .mailrc?


    Just installed "pine" so life is good and the basic problem is solved. I'm still curious why "mail" still shows "No mail for art".


    Thanks Falko! Just the check on /etc/aliases got me going in the right direction here.


    Art
     
  6. falko

    falko Super Moderator Howtoforge Staff

    I've never used mail for checking emails. I think you're better of with a real email client. :)
     

Share This Page