Results 1 to 8 of 8

Thread: Postfix question

  1. #1
    Join Date
    Mar 2009
    Beans
    46

    Postfix question

    Hi all,

    I have done quite a bit of research on this but struggling to resolve my issue.

    I have a network at home with a server (server1.mydomain.com) which can hook upto a mail server to send alerts out and an email server (server-mail.mydomain.com). I started to try and build an email server using postfix to send an email to my gmail account (adam@gmail.com) from server1

    I installed postfix and added a few config changes:
    Code:
    mydestination = server-mail.mydomain.com, localhost.mydomain.com, localhost, mydomain.com, gmail.com
    mynetworks = 127.0.0.0/8, 192.168.1.0/24
    I then just tried to send an email:
    Code:
    telnet localhost 25
    Trying ::1...
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    220 server-mail.mydomain.com ESMTP Sendmail 8.14.4/8.14.4/Debian-2ubuntu2; Wed, 18 Sep 2013 18:59:16 +0400; (No UCE/UBE) logging access from: server-mail.mydomain.com(OK)-server-mail.mydomain.com [127.0.0.1]
    ehlo server1.mydomain.com
    250-server-mail.mydomain.com Hello server-mail.mydomain.com [127.0.0.1], pleased to meet you
    250-ENHANCEDSTATUSCODES
    250-PIPELINING
    250-EXPN
    250-VERB
    250-8BITMIME
    250-SIZE
    250-DSN
    250-ETRN
    250-DELIVERBY
    250 HELP
    mail from: server1@mydomain.com
    250 2.1.0 server1@mydomain.com... Sender ok
    rcpt to: adam@gmail.com
    553 5.1.8 adam@gmail.com... Domain of sender address server1@mydomain.com does not exist

    I'm trying to emulate my server1 sending a mail (I think) by using ehlo server1.mydomain.com

    I dont know if I'm way off here but any help would be appreciated

  2. #2
    Join Date
    Mar 2009
    Beans
    46

    Re: Postfix question

    So a bit of development, I noticed the telnet resulted in 'ESMTP Sendmail' being shown. it looked like a install of sendmail was overriding postfix. I removed and restarted it now im getting the correct connection

    Code:
    telnet server-mail.mydomain.com 25
    Trying 192.167.1.x...
    Connected to server-mail.mydomain.com.
    Escape character is '^]'.
    220 server-mail.mydomain.com ESMTP Postfix (Ubuntu)
    MAIL FROM: server1@mydomain.com
    250 2.1.0 Ok
    RCPT TO: adam@gmail.com
    550 5.1.1 <adam@gmail.com>: Recipient address rejected: User unknown in local recipient table
    ... but a different error.
    Last edited by adamjseed; September 18th, 2013 at 09:55 PM.

  3. #3
    Join Date
    Mar 2010
    Location
    Metro-ATL; PM free zone.
    Beans
    Hidden!
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Postfix question

    Sending email requires DNS-MX records and that your ISP doesn't block outbound SMTP traffic. Most residential ISPs block inbound and outbound SMTP traffic. That is why the ISP has email gateways.

    Output from postconf -n would be helpful after you confirm that you can telnet to gmail.com port 25, and have an MX DNS record.

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Postfix question

    Quote Originally Posted by TheFu View Post
    Sending email requires DNS-MX records and that your ISP doesn't block outbound SMTP traffic. Most residential ISPs block inbound and outbound SMTP traffic. That is why the ISP has email gateways.

    Output from postconf -n would be helpful after you confirm that you can telnet to gmail.com port 25, and have an MX DNS record.
    You should be able to send email via gmail by using port 587 instead of port 25. That's how I have my home server set up.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #5
    Join Date
    Mar 2009
    Beans
    46

    Re: Postfix question

    Hi Charles, thanks for the reply

    I think your right, I'm with Virgin UK and telnet gmail.com 25 does not work.

    Do you have any suggestions on how I can me create a mail server that can send emails to gmail? it needs to work with standard software which can hook up to a mail server.

  6. #6
    Join Date
    Mar 2009
    Beans
    13

    Re: Postfix question

    Hi Adam

    do you know that the "mydestination" configuration parameter lists all the domains that your server can deliver mails locally for.
    When you put gmail.com there it means that whenever a mail for xxx@gmail.com is sent through your server it will try to deliver that mail locally instead of passing it on to another (gmails mail sever) to have it deliver the mail.

    I'm not sure but I do not think that is what you want.

    Regards
    Klaus

  7. #7
    Join Date
    Mar 2010
    Location
    Metro-ATL; PM free zone.
    Beans
    Hidden!
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Postfix question

    Do you only want to send email to 1 email address or do you want to be able to send emails to anyone using your gmail address as the only sender?
    The 2nd is what CharlesA has setup, if I'm reading his text correctly. Using that technique, you should be able to use any email address that lets you use a "thick client" to send emails ... including the email address that your ISP provides.

    If you don't have any need to receive emails, ever, then you are covered. You can use something like fetchmail to poll your email accounts (IMAP/POP3) and pull any email back to your server, so that it appears you have send and receive capabilities. That works.

    For just a few local accounts, this can work fine by setting up account translation maps so a local userid sends to a specific external email account using connection parameters. I'd have to look up exactly how postfix supports this, but I've seen it done.

    Hummm ... just got a business idea.

  8. #8
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Postfix question

    Quote Originally Posted by adamjseed View Post
    Hi Charles, thanks for the reply

    I think your right, I'm with Virgin UK and telnet gmail.com 25 does not work.

    Do you have any suggestions on how I can me create a mail server that can send emails to gmail? it needs to work with standard software which can hook up to a mail server.
    Check this out. It's for CentOS, but it's basically the same for Ubuntu/Debian.
    http://charlesa.net/tutorials/centos...lay-centos.php

    Note to self, write up one of those for Debian...
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •