send email to a local domain but mailbox are an another server

Discussion in 'Installation/Configuration' started by mateo, Oct 25, 2010.

  1. mateo

    mateo New Member

    Hello,

    I hope that you will understand my question, as my english is not as good as it should be.

    Only the web service is used on the server, the mail server is on another server.
    If i try to send email using mail() (php function) to [email protected], the mail are not sent. I think that the server try to delivred them locally.

    I didn't register the domain in the email panel.

    in the /var/log/maillog, postfix seems to try to send it to the good server (the ip is not my server) but the mails are not sent...

    How can i fix it ?

    Thanks.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Which ispconfig version do you use?
    2) Have you used mydomain.com as server hostname or anywhere in /etc/postfix/main.cf or in /etc/mailname?
     
  3. mateo

    mateo New Member

    I am using ISPConfig Version: 3.0.2.1
    the domain is not use in for the hostname (i can see it using 'hostname', it's enough ?)
    and neither in /etc/postfix/main.cf or in /etc/mailname

    mydomain.com was on a previous server (not using ispconfig) and the mails were sent correctly, that is why i think that the problem comes from my server.

    here is the logfile when i try to send an email to [email protected]
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If you see it when you run the hostname command, then the domain is used as hostname which will confuse postfix. Please change the hostname of your server so that it is soemthing like: server.yourdomain.com and not just: yourdomain.com
    You can find the instructions to change the hostname in the perfect setup guide.

    Additionally, please post the output of the command:

    netstat -tap | grep smtp
     
  5. mateo

    mateo New Member

    unsing hostname command, the response is not mydomain.com

    netstat -tap | grep smtp says :
    tcp 0 0 localhost.localdomain:smtp *:* LISTEN 8578/smtpd

    the smtp is working, as i can send email to other domain (eg: gmail, or anyone that are not registered as a website (there is not only mydomain.com on the server)
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the file /etc/hosts, the output of the commands:

    hostname
    hostname -f

    the postfix main.cf file and the content of /etc/mailname
     
  7. mateo

    mateo New Member

    hostname says :
    s10

    hostname -f says:
    localhost.localdomain

    cat /etc/hosts says (i replace xxxx by my main domain, which is not mydomain.com)

    127.0.0.1 localhost.localdomain localhost s10
    ::1 localhost6.localdomain6 localhost6
    88.190.11.86 s10.xxxxxxx.eu s10

    main.cf (all comments removed) :
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    mail_owner = postfix
    inet_interfaces = localhost
    mydestination = $myhostname, localhost.$mydomain, localhost
    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.3.3/samples
    readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES

    mailname : don't have one :) (looking with locate mailname, and it's not found)
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Is 213.186.44.129 the remote server?
     
  9. mateo

    mateo New Member

    Yes this IP is their remote mail server...
    That's is why i think that everything is fine, but my client tells me that he doesn't recevive "my" emails.

    By the way, thanks to try to help me :)
     
  10. falko

    falko Super Moderator Howtoforge Staff

    Then the problem is on the remote server. The mailbox doesn't seem to exist there.
     
  11. mateo

    mateo New Member

    The mailbox exists on the remote server, i am sure of it because i mail to my client to this address (and the script was working fine on the previous server).

    but, yes, what i read on the logfile, this is that the email is sent, and the remote server doesn't recevive it..

    I will try some change, try other things.

    Anyway, thanks you a lot for spending time on my problem !

    if i resolv it, i will post the solution.
     
  12. falko

    falko Super Moderator Howtoforge Staff

    The remote server does receive it, but according to the mail log, the mail box doesn't exist.
     

Share This Page