Problem with postfix config (CatchAll,alias)

Discussion in 'Installation/Configuration' started by stefanr, Aug 2, 2007.

  1. stefanr

    stefanr Member

    hi there,

    Problem :

    1. I have a domain like "domain.com"

    2. I have a second domain like "domain.de"

    3. I set [email protected] as a CatchALL email for domain "domain.com", and some other email accounts like [email protected], [email protected]. This my own Domain.

    4. I set [email protected] as a CatchALL email for domain "domain.de", this will be forward to [email protected], and some other email accounts like [email protected], [email protected]. This not a Domain from me.

    5. when i log to my gmx account and i send email to: [email protected]
    --> I receive this mail on my [email protected].

    6. when i log in with imap to the ispconfig server and send email to: [email protected]
    --> I receive this mail on my [email protected] also.

    7. when i log in with imap to the ispconfig server and send email to: [email protected]
    --> this email goes to the [email protected]


    Questions :
    i have no ideas for this problem. I look at http://www.howtoforge.com/faq/9_33_en.html but i have no ideas to resolve this problem. I look into the /etc/postfix/main.cf for the $mydomain but i don't find this.

    thanks for any help
    Stefan
     
  2. stefanr

    stefanr Member

    my config files

    hi,

    i will post also my configs:

    #cat /etc/postfix/main.cf:
    #myorigin = /etc/mailname
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no
    append_dot_mydomain = no
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    myhostname = mail.rr-netz.de
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = mail.rr-netz.de, quendi.rr-netz.de, localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    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,check_policy_service inet:127.0.0.1:60000
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    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


    kind regards

    Stefan
     
  3. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/mailname? What are the values of myhostname and mydomain in
    Code:
    postconf -d
    ? Are all three values domains that you use for web sites in ISPConfig?

    BTW, please comment out the line
    Code:
    mydestination = mail.rr-netz.de, quendi.rr-netz.de, localhost
    in /etc/postfix/main.cf; otherwise you have two mydestination lines.
     
  4. stefanr

    stefanr Member

    postconf -d |grep myhostname

    ok i have comment out this line...

    thanks

    Stefan
     
  5. stefanr

    stefanr Member

    any ideas

    Hello falko,

    have you seen my output from the "postconf -d" ?
    I heave no ideas to fix the problem.

    Can you help me to fix this Problem?

    kind regards

    Stefan
     
  6. falko

    falko Super Moderator ISPConfig Developer

    Do you use the domain rr-netz.de for a web site and email accounts in ISPConfig?
     
  7. stefanr

    stefanr Member

    Hi falko,

    yes i do this.. mom

    cat /etc/apache2/vhosts/Vhosts_ispconfig.conf

    ######################################
    # Vhost: www.rr-netz.de:80
    ######################################
    #
    #
    <VirtualHost 88.198.26.239:80>
    ServerName www.rr-netz.de:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web1/web
    ServerAlias webmail.rr-netz.de mail.rr-netz.de ispconfig.rr-netz.de nagios.rr-netz.de gallery.rr-netz.de ftp.rr-netz.de rr-netz.de forum.rr-netz.de
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias /cgi-bin/ /var/www/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/web1/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php5>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode Off
    Alias /error/ "/var/www/web1/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail\.rr-netz\.de [NC]
    RewriteRule ^/(.*) https://ispconfig.rr-netz.de:81/roundcubemail/$1 [L,R]
    RewriteCond %{HTTP_HOST} ^mail\.rr-netz\.de [NC]
    RewriteRule ^/(.*) http://www.rr-netz.de/$1 [L,R]
    RewriteCond %{HTTP_HOST} ^ispconfig\.rr-netz\.de [NC]
    RewriteRule ^/(.*) https://ispconfig.rr-netz.de:81/$1 [L,R]
    RewriteCond %{HTTP_HOST} ^nagios\.rr-netz\.de [NC]
    RewriteRule ^/(.*) http://88.198.26.239/nagios2/$1 [L,R]
    RewriteCond %{HTTP_HOST} ^gallery\.rr-netz\.de [NC]
    RewriteRule ^/(.*) http://rr-netz.de/gallery2/$1 [L,R]
    RewriteCond %{HTTP_HOST} ^forum\.rr-netz\.de [NC]
    RewriteRule ^/(.*) http://rr-netz.de/forum/$1 [L,R]
    </VirtualHost>


    DNS by ISP

    $TTL 86400
    @ IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (
    2007073000 ; serial
    14400 ; refresh
    1800 ; retry
    604800 ; expire
    86400 ) ; minimum

    @ IN NS robotns3.second-ns.com.
    @ IN NS robotns2.second-ns.de.
    @ IN NS ns1.first-ns.de.

    @ IN A 88.198.26.239
    forum IN A 88.198.26.239
    ispconfig IN A 88.198.26.239
    localhost IN A 127.0.0.1
    mail IN A 88.198.26.239
    mxmail IN A 85.116.204.95
    webmail IN A 88.198.26.239
    www IN A 88.198.26.239
    ftp IN CNAME www
    imap IN CNAME www
    loopback IN CNAME localhost
    pop IN CNAME www
    relay IN CNAME www
    smtp IN CNAME www
    @ IN MX 10 mail
    @ IN MX 50 ns1.hostingkunden.de


    pls say if you need more informations.

    Stefan
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

  9. stefanr

    stefanr Member

    cat /etc/postfix/main.cf

    Hi till,

    i read this and tried, but i wan't work look:

    #cat /etc/postfix/main.cf

    # Debian specific: Specifying a file name will cause the first
    # line of that file to be used as the name. The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname

    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no

    # appending .domain is the MUA's job.
    append_dot_mydomain = no

    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.

    mydomain = mail.rr-netz.de
    myhostname = mail.rr-netz.de
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = mail.rr-netz.de, quendi.rr-netz.de, localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    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,check_policy_service inet:127.0.0.1:60000
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    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


    after /etc/init.d/postfix restart

    send an test email form gmx and the mail came also to my account and not to the user.

    tail -f /var/log/mail.info

    Aug 9 00:02:18 quendi postfix/smtpd[30362]: connect from saale.bnhof.de[88.198.18.104]
    Aug 9 00:02:18 quendi postfix/smtpd[30362]: D9265890060: client=saale.bnhof.de[88.198.18.104]
    Aug 9 00:02:18 quendi postfix/cleanup[30318]: D9265890060: message-id=<[email protected]>
    Aug 9 00:02:18 quendi postfix/qmgr[28289]: D9265890060: from=<[email protected]>, size=1495, nrcpt=1 (queue active)
    Aug 9 00:02:18 quendi postfix/cleanup[30318]: DD4E1890065: message-id=<[email protected]>
    Aug 9 00:02:18 quendi postfix/smtpd[30362]: disconnect from saale.bnhof.de[88.198.18.104]
    Aug 9 00:02:18 quendi postfix/qmgr[28289]: DD4E1890065: from=<[email protected]>, size=1632, nrcpt=1 (queue active)
    Aug 9 00:02:18 quendi postfix/local[30322]: D9265890060: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0.02, delays=0.02/0/0/0, dsn=2.0.0, status=sent (forwarded as DD4E1890065)
    Aug 9 00:02:18 quendi postfix/qmgr[28289]: D9265890060: removed


    i heave no ideas what i do wrong.

    kind regards

    Stefan
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Please make sure that you have "mail.rr-netz.de" in /etc/mailname too.
     
  11. stefanr

    stefanr Member

    cat /etc/mailname

    quendi:~# cat /etc/mailname
    mail.rr-netz.de


    Stefan
     
  12. falko

    falko Super Moderator ISPConfig Developer

    Please uncomment myorigin = /etc/mailname in /etc/postfix/main.cf and restart Postfix. Does it work then? If not, are there any errors in the mail log?
     
  13. stefanr

    stefanr Member

    tail -f /var/log/mail.log

    Hello,


    tail -f /var/log/mail.log
    Aug 10 20:07:43 quendi postfix/smtpd[6207]: connect from saale.bnhof.de[88.198.18.104]
    Aug 10 20:07:43 quendi postfix/smtpd[6207]: BB24E890060: client=saale.bnhof.de[88.198.18.104]
    Aug 10 20:07:43 quendi postfix/cleanup[6212]: BB24E890060: message-id=<[email protected]>
    Aug 10 20:07:43 quendi postfix/smtpd[6207]: disconnect from saale.bnhof.de[88.198.18.104]
    Aug 10 20:07:43 quendi postfix/qmgr[6112]: BB24E890060: from=<[email protected]>, size=1495, nrcpt=1 (queue active)
    Aug 10 20:07:43 quendi postfix/cleanup[6212]: BE8F5890067: message-id=<[email protected]>
    Aug 10 20:07:43 quendi postfix/local[6213]: BB24E890060: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (forwarded as BE8F5890067)
    Aug 10 20:07:43 quendi postfix/qmgr[6112]: BB24E890060: removed
    Aug 10 20:07:43 quendi postfix/qmgr[6112]: BE8F5890067: from=<[email protected]>, size=1632, nrcpt=1 (queue active)
    Aug 10 20:07:43 quendi postfix/pickup[6107]: C4EF7890068: uid=10002 from=<web1_002>
    Aug 10 20:07:43 quendi postfix/cleanup[6212]: C4EF7890068: message-id=<[email protected]>
    Aug 10 20:07:43 quendi postfix/qmgr[6112]: C4EF7890068: from=<[email protected]>, size=381, nrcpt=1 (queue active)
    Aug 10 20:07:43 quendi postfix/local[6230]: C4EF7890068: to=<[email protected]>, relay=local, delay=0.17, delays=0.01/0/0/0.15, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Aug 10 20:07:43 quendi postfix/qmgr[6112]: C4EF7890068: removed
    Aug 10 20:07:48 quendi postfix/local[6213]: BE8F5890067: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=4.3, delays=0/0/0/4.3, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Aug 10 20:07:48 quendi postfix/qmgr[6112]: BE8F5890067: removed


    i uncomment myorigin = /etc/mailname in /etc/postfix/main.cf and restart Postfix. But it don't work!

    regards

    Stefan
     
  14. stefanr

    stefanr Member

    logfile

    Hello again,


    i found this in /var/log/mail.log

    Aug 10 20:12:04 quendi postfix/pickup[6107]: 8CBC6890068: uid=10003 from=<web1_003>
    Aug 10 20:12:04 quendi postfix/cleanup[7060]: 8CBC6890068: message-id=<[email protected]>
    Aug 10 20:12:04 quendi postfix/qmgr[6112]: 8CBC6890068: from=<[email protected]>, size=383, nrcpt=1 (queue active)
    Aug 10 20:12:04 quendi postfix/local[7078]: 8CBC6890068: to=<[email protected]>, relay=local, delay=0.27, delays=0.06/0.01/0/0.2, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Aug 10 20:12:04 quendi postfix/qmgr[6112]: 8CBC6890068: removed
    Aug 10 20:12:04 quendi postfix/smtpd[7057]: disconnect from quendi.rr-netz.de[127.0.0.1]
    Aug 10 20:12:04 quendi fetchmail[3477]: sleeping at Fri Aug 10 20:12:04 2007 for 300 seconds
    Aug 10 20:12:08 quendi postfix/local[7061]: 11081890060: to=<[email protected]>, relay=local, delay=4.8, delays=0.44/0.01/0/4.4, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -f-)
    Aug 10 20:12:08 quendi postfix/qmgr[6112]: 11081890060: removed


    kind regards

    Stefan
     
  15. stefanr

    stefanr Member

    i look into my ISP domain robot. May i have a DNS Problem?

    $TTL 1d
    @ IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (
    2000091604 ; Serial
    14400 ; Refresh
    1800 ; Retry
    604800 ; Expire
    86400 ) ; Minimum

    @ IN NS ns1.first-ns.de.
    @ IN NS robotns2.second-ns.de.
    @ IN NS robotns3.second-ns.com.

    localhost IN A 127.0.0.1
    @ IN A 88.198.26.239
    www IN A 88.198.26.239
    mail IN A 88.198.26.239

    loopback IN CNAME localhost
    pop IN CNAME www
    smtp IN CNAME www
    relay IN CNAME www
    imap IN CNAME www
    ftp IN CNAME www

    @ IN MX 10 mail
     
  16. falko

    falko Super Moderator ISPConfig Developer

    I suggest that you use a "technical" domain in myorigin, myhostname, and mydomain, i.e., a domain that you don't use for web sites and email accounts. That's how I do it. I bought a "technical" domain that I use solely for server naming purposes, but not for web sites, email, etc.
     
  17. stefanr

    stefanr Member

    to you mean....

    Thanks for replay,

    You mean that i by another domain i.e. "rrnetztec.de" and make DNS entry in the ISP (hetzner) domain robot. Then i can nslookup or ping "rrnetztec.de" work fine
    and i get a replay from my server.

    Then i change in /etc/postfix/main.cf from:

    mydomain = rr-netz.de
    myhostname = mail.rr-netz.de
    myorigin = /etc/mailname

    to:


    mydomain = rrnetztec.de
    myhostname = mail.rrnetztec.de
    myorigin = /etc/mailname

    Is this what you mean? Or must the "myhostname = mail.rr-netz.de" that the users can use in thunderbird or outlook the "mail.rr-netz.de" as server adress.

    thanks for replay

    Stefan
     
  18. falko

    falko Super Moderator ISPConfig Developer

    Yes, that's right.
     
  19. stefanr

    stefanr Member

    Ok,

    i tried this...

    Stefan
     
  20. stefanr

    stefanr Member


    i doo it but after changing from:

    mydomain = rr-netz.de
    myhostname = mail.rr-netz.de
    myorigin = /etc/mailname

    to:


    mydomain = rrnetztec.de
    myhostname = mail.rrnetztec.de
    myorigin = /etc/mailname

    i get this errors in my /var/log/mail.log

    Aug 12 20:33:08 quendi postfix/smtpd[29823]: connect from saale.bnhof.de[88.198.18.104]
    Aug 12 20:33:08 quendi postfix/smtpd[29823]: 2B6E789006A: client=saale.bnhof.de[88.198.18.104]
    Aug 12 20:33:08 quendi postfix/cleanup[29828]: 2B6E789006A: message-id=<[email protected]>
    Aug 12 20:33:08 quendi postfix/smtpd[29823]: disconnect from saale.bnhof.de[88.198.18.104]
    Aug 12 20:33:08 quendi postfix/qmgr[29794]: 2B6E789006A: from=<[email protected]>, size=1379, nrcpt=2 (queue active)
    Aug 12 20:33:08 quendi postfix/smtp[29829]: 2B6E789006A: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=0.05, delays=0.02/0.01/0.02/0, dsn=5.4.6, status=bounced (mail for mail.tec-rrnetz.de loops back to myself)
    Aug 12 20:33:08 quendi postfix/smtp[29829]: 2B6E789006A: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=0.05, delays=0.02/0.01/0.02/0, dsn=5.4.6, status=bounced (mail for mail.tec-rrnetz.de loops back to myself)
    Aug 12 20:33:08 quendi postfix/cleanup[29828]: 394DC89006C: message-id=<[email protected]>
    Aug 12 20:33:08 quendi postfix/qmgr[29794]: 394DC89006C: from=<>, size=3598, nrcpt=1 (queue active)
    Aug 12 20:33:08 quendi postfix/bounce[29830]: 2B6E789006A: sender non-delivery notification: 394DC89006C
    Aug 12 20:33:08 quendi postfix/qmgr[29794]: 2B6E789006A: removed

    Stefan
     

Share This Page