Postfix not honoring email aliases for local delivery

Discussion in 'Installation/Configuration' started by rneilson, Mar 9, 2007.

  1. rneilson

    rneilson New Member

    I have a hosting server, configured as per the Perfect Setup (Opensuse 10), with ISPConfig installed. Everything seems to be working - uptime has been over a month, now, with the only problems I've had so far being domain registration hiccups which have nothing to do with my server.

    However, one of my customers is testing a web order form, and I've run into a problem: while emails incoming from outside servers work fine, local deliveries don't seem to be using email aliases properly.

    Eg.

    Username: example.admin
    Primary email: [email protected]
    Alias: [email protected]

    If I send an email to [email protected] from outside, it works without a problem. If I send it from an another domain also hosted on the site, [email protected], it bounces back with the following error:

    I checked all the threads on Postfix problems I could, and the following have already been ruled out:

    - The server's FQDN is main.example.com
    - The $myhostname parameter in main.cf is main.example.com
    - main.example.com is not used as a virtual domain for any email or web services. www.example.com and example.com are, however.
    - All DNS entries are correct. Again, outside email works fine with the alias rewriting.
    - alias_maps = hash:/etc/aliases
    - virtual_maps = hash:/etc/postfix/virtusertable
    - mydestination = /etc/postfix/local-host-names
    - [email protected] and [email protected] are both present in /etc/postfix/virtusertable and point to example.admin
    - example.com is listed in /etc/postfix/local-host-names

    Any help would be greatly appreciated!
     
  2. falko

    falko Super Moderator ISPConfig Developer

    What's in your mail log when this happens?
     
  3. rneilson

    rneilson New Member

    Here's /var/log/mail (snippet):
    [email protected] is an alias I've set up for [email protected].

    Thanks
     
  4. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/postfix/main.cf (please strip out the comments), /etc/postfix/virtusertable, and /etc/postfix/local-host-names?
     
  5. rneilson

    rneilson New Member

    /etc/postfix/main.cf

    /etc/postfix/local-host-names
    /etc/postfix/virtusertable (snippet only - I don't want the users of twenty sites plastered all over the forums)

     
  6. falko

    falko Super Moderator ISPConfig Developer

    Ok, and now I need to know the real email addresses instead of [email protected] and [email protected]
     
  7. rneilson

    rneilson New Member

    In this case, so I wasn't cluttering anyone else's mailbox, I set up the username testing, which has [email protected] as an alias, just so I could confirm the behaviour with a fresh email. (The original user who noticed the problem is on another site I host.) The user testing then forwards to [email protected].

    The original notice was when a PHP script mailed to an alias - I got the undeliverable message error, since wwwrun's email forwards to me. I also tried sending to [email protected], with the same result (info is an alias for markanthony).
     
  8. falko

    falko Super Moderator ISPConfig Developer

    What's in [email protected] .procmailrc file (in his homedir)?

    Please run
    Code:
    postconf -e 'inet_protocols = ipv4'
    /etc/init.d/postfix restart
    to get rid of the inet_protocols warning in your mail log.
     
  9. rneilson

    rneilson New Member

    Thanks, I was wondering how to get that error out.

    The user is testing, not test - perhaps I should've made it testuser or something. The email [email protected] is just an alias of [email protected].

    The .procmailrc for testing, however, is as follows:

    MAILDIR=$HOME/Maildir/
    DEFAULT=$MAILDIR
    ORGMAIL=$MAILDIR

    INCLUDERC=/srv/www/web1/user/testing/.mailsize.rc
    ## INCLUDERC=/srv/www/web1/user/testing/.quota.rc
    ## INCLUDERC=/srv/www/web1/user/testing/.antivirus.rc
    ## INCLUDERC=/srv/www/web1/user/testing/.local-rules.rc
    ## INCLUDERC=/srv/www/web1/user/testing/.html-trap.rc
    ## INCLUDERC=/srv/www/web1/user/testing/.spamassassin.rc
    ## INCLUDERC=/srv/www/web1/user/testing/.autoresponder.rc
     
  10. falko

    falko Super Moderator ISPConfig Developer

    And what's in the .forward file (in the same directory)?
     
  11. rneilson

    rneilson New Member

  12. falko

    falko Super Moderator ISPConfig Developer

    Looks ok.
    What's the output of
    Code:
    grep testing /etc/passwd
    ?
     
  13. rneilson

    rneilson New Member

    grep testing /etc/passwd :
    testing:x:10058:10001:Testing:/srv/www/web1/user/testing:/bin/false
     
  14. falko

    falko Super Moderator ISPConfig Developer

    Looks ok. And what's the output of
    Code:
    grep 10058 /etc/passwd
    ?
     
  15. rneilson

    rneilson New Member

    testing:x:10058:10001:Testing:/srv/www/web1/user/testing:/bin/false
     
  16. falko

    falko Super Moderator ISPConfig Developer

    I was thinking that maybe there are two or more users with the same user id in /etc/passwd, but this isn't the case. To be honest, I have no idea what's wrong with your system...
     
  17. rneilson

    rneilson New Member

    Beats me, too. The best I can figure out is that for local deliveries, ie between two email addresses on the same system, postfix isn't consulting the virtusertable at all, but just /etc/aliases, which of course doesn't include any of the aliases specified by ISPConfig. And I can't figure out a way to force it.

    Any hints on configuring the fallback_transport option in postfix?
     
  18. rneilson

    rneilson New Member

  19. till

    till Super Moderator Staff Member ISPConfig Developer

    I dont think that. Local delivery works perfectly on all my servers. ISPConfig uses a standard setup with system users that is used on many bon ISPConfig servewrs as well for years.
     
  20. rneilson

    rneilson New Member

    My problem seems to be similar to the one in this thread. He's using opensuse 10.2, the same as me. And I've confirmed this behaviour with multiple accounts. If there is an entry in /etc/aliases for the username portion of the email address (i.e. a system username, not an alias set up in ISPConfig), then the mail is delivered. If the recipient is only in virtusertable, then email originating on another server is processed fine, but if the origin and destination are both hosted on my server, it will fail.

    Maybe there's something missing from the default configuration of opensuse 10.2's postfix package? Do your servers have an entry for fallback_transport (or something related) in /etc/postfix/main.cf?
     

Share This Page