Etch perfect setup - problems with SMTP

Discussion in 'HOWTO-Related Questions' started by StefanV, Oct 25, 2007.

  1. StefanV

    StefanV New Member

    First of all, hello everybody!

    Like many others on this forum, I hope that I can find someone to help me with a problem regarding a linux server. I would like say from the beginning that I'm new in linux, so please be patient with me :).

    I've followed the perfect setup tutorial for Debian Etch and I don't manage to send mails by SMTP. Can someone tell me where should I look and what should I do? I will paste below the content of my config files... If I need to paste something else, please tell me. Thanks in advance!

    My zone file:

    Code:
    $ttl 30M
    mydomain.ro.     IN      SOA     ns1.mydomain.ro. contact.mydomain.ro. (
                            1193316753
                            10800
                            3600
                            604800
                            30M )
    mydomain.ro.     IN      NS      ns1.mydomain.ro.
    mydomain.ro.     IN      A       67.200.100.20
    mydomain.ro.     IN      NS      ns2.mydomain.ro.
    www.mydomain.ro. IN      CNAME   mydomain.ro.
    ns1.mydomain.ro. IN      A       67.200.100.20
    ns2.mydomain.ro. IN      A       67.200.100.21
    mail.mydomain.ro.        IN      A       67.200.100.20
    mail.mydomain.ro.        IN      MX      1 mydomain.ro.
    
    
    saslauthd file:

    Code:
    
    # Settings for saslauthd daemon
    #
    
    # Should saslauthd run automatically on startup? (default: no)
    START=yes
    
    # Which authentication mechanisms should saslauthd use? (default: pam)
    #
    # Available options in this Debian package:
    # getpwent  -- use the getpwent() library function
    # kerberos5 -- use Kerberos 5
    # pam       -- use PAM
    # rimap     -- use a remote IMAP server
    # shadow    -- use the local shadow password file
    # sasldb    -- use the local sasldb database file
    # ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
    #
    # Only one option may be used at a time. See the saslauthd man page
    # for more information.
    #
    # Example: MECHANISMS="pam"
    MECHANISMS="pam"
    
    # Additional options for this mechanism. (default: none)
    # See the saslauthd man page for information about mech-specific options.
    MECH_OPTIONS=""
    
    # How many saslauthd processes should we run? (default: 5)
    # A value of 0 will fork a new process for each connection.
    THREADS=5
    
    # Other options (default: -c)
    # See the saslauthd man page for information about these options.
    #
    # Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
    # Note: See /usr/share/doc/sasl2-bin/README.Debian
    OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
    
    
    main.cf file

    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # 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.
    
    myhostname = mydomain.ro
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = mydomain.ro, localhost.mydomain.ro, localhost.localdomain, localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command = procmail -a "$EXTENSION"
    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
    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
    
    
    The ip's and hostname are not real (just a precaution).. the rest of the configuration is copy/paste.

    Once again, thanks!
     
  2. StefanV

    StefanV New Member

    Now that is interesting.. I didn't do anything to the server and todai it works to connect to SMTP.. Hmmmm.. maybe the DNS was not propagated? I can't explain. Now, the problem is that if I send an e-mail from anothe address to [email protected], I don't receive that mail. But if I use webmin to send an email to [email protected], I can get that mail by using POP3 (so the poblem is not with POP3)
     
  3. falko

    falko Super Moderator Howtoforge Staff

    Please check if the MX record of your domain is correct:
    Code:
    dig mx mydomain.ro
     
  4. StefanV

    StefanV New Member

    Code:
    ; <<>> DiG 9.3.4 <<>> mx mydomain.ro
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9721
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;mydomain.ro.                    IN      MX
    
    ;; Query time: 2 msec
    ;; SERVER: 66.96.80.194#53(66.96.80.194)
    ;; WHEN: Fri Oct 26 08:17:56 2007
    ;; MSG SIZE  rcvd: 28
    
    And it seems that I was wrong... I can't get e-mails with pop, even if I send them directly from webmin. But the mails sent from another address are stored in my mailbox on the server.

    [Edit] Thanks Falko for trying to help me ... and also thanks for the great tutorials you write!
     
    Last edited: Oct 26, 2007
  5. StefanV

    StefanV New Member

    and this is the result of dig mail.mydomain.ro

    Code:
    ; <<>> DiG 9.3.4 <<>> mx mail.mydomain.ro
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52766
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;mail.mydomain.ro.               IN      MX
    
    ;; ANSWER SECTION:
    mail.mydomain.ro.        1800    IN      MX      1 mydomain.ro.
    
    ;; Query time: 16 msec
    ;; SERVER: 66.96.80.194#53(66.96.80.194)
    ;; WHEN: Fri Oct 26 09:02:05 2007
    ;; MSG SIZE  rcvd: 49
    
    Maybe I need to change some instances of mydomain.ro to mail.mydomain.ro in theconfig files?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    You need no MX record for mail.mydomain.ro (unless you want to receive emails of the form user@[B]mail[/B].mydomain.ro), but an A record for mail.mydomain.ro, and then you create an MX record for mydomain.ro that points to mail.mydomain.ro.
     
  7. StefanV

    StefanV New Member

    I've modified the mx record and now I can receive again on pop but not send on smtp :). For both pop and smtp I use mail.mydomain.ro in my thunderbird config
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Do you get any errors messages? Any errors in your logs?
     
  9. StefanV

    StefanV New Member

    The problem was with my ISP. They blocked the port 25.. So I made a port redirect to make it work. Thanks for everything, Falko!
     

Share This Page