email hostname problems

Discussion in 'Installation/Configuration' started by sushestvo, May 19, 2006.

  1. sushestvo

    sushestvo Member

    Hi everyone,
    I have a server with ISPCOnfig 2.2.1
    Everytime I sent an email I always have one problem.
    Let's say I send it from [email protected]
    When someone will receive it - FROM tag is fine, but if they open Mail
    Even though sometimes it will put correct domain there (postfix) - it's kinda random.
    How can I fix this?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you have an A-Record for mail.myfirstdomain.com pointing to your server IP?
    How many IP's do you have?
     
  3. sushestvo

    sushestvo Member

    I do have an A record.
    I have 2 IPs... well actually 3 - but ISPConfig doesn't know about third one as it's not used for Apache at all. It's for nginx, totally insolated from ISPConfig.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Sending of mail is not related to apache or ISPConfig itself, it is managed by postfix. Postfix automatically uses the las IP address added to your system to send email. Postfix knows all your IP addresses, even the addresses not configured in ISPConfig.

    You can bind postfix to a specific IP for sending mails with this configuration directive in main.cf:

    smtp_bind_address = 192.168.0.1
     
  5. sushestvo

    sushestvo Member

    The IP address is always the same. The one mail is coming out of.
    But it associates different domain name with every single time. And it does not pick up latest domain name that was added, nor latest IP that was added - it never used it - as I said, postfix doesn't know about it as it's not even in ifconfig.
    I'm not really sure what's going on with this. But it's weird :$
     
  6. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/postfix/main.cf (please strip out the comments)?
    What's the output of
    Code:
    hostname -f
    ?
     
  7. sushestvo

    sushestvo Member

    main.cf
    Code:
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    mail_owner = postfix
    inet_interfaces = all
    unknown_local_recipient_reject_code = 550
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    debug_peer_level = 2
    debugger_command =
    	 PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    	 xxgdb $daemon_directory/$process_name $process_id & sleep 5
    sendmail_path = /usr/sbin/sendmail.postfix
    newaliases_path = /usr/bin/newaliases.postfix
    mailq_path = /usr/bin/mailq.postfix
    setgid_group = postdrop
    html_directory = no
    manpage_directory = /usr/share/man
    sample_directory = /usr/share/doc/postfix-2.1.5/samples
    readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES
    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
    smtpd_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    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
    
    virtual_maps = hash:/etc/postfix/virtusertable
    
    mydestination = /etc/postfix/local-host-names
    the rest is commented out.

    hostname -f: discovery.lockdns.com
     
  8. falko

    falko Super Moderator Howtoforge Staff

    You don't have myhostname and mydomain in main.cf.
    What's the output of
    Code:
    telnet localhost 25
    ?
     
  9. sushestvo

    sushestvo Member

    well, if I specify myhostname and mydomain it will always be the same for all different domains email is sent out from, right? I need it to be dynamic.
    If one user sends an email out from @domain1.com and other @domain2.com - they gotta be different.
    What do I make myhostname and mydomain to be in this case? And why ISPConfig didn't take care of that? I'm sure no one else experience my problem.
     
  10. falko

    falko Super Moderator Howtoforge Staff

    You and your users must set the sender address in your/their email clients. It has nothing to do with the server.
     

Share This Page