Professional Web Applications Themes

FreeBSD server behind router-NAT; how to configure sendmail? - FreeBSD

Hi, My ISP provides me with a fixed IP address and a registered hostname. I use a Sitecom DC-207 that serves as a plain router, NAT and 4-port switch, to connect three Windows PCs and one FreeBSD PC simultaneously to the internet. The router gets the fixed IP address, whereas my FreeBSD system gets IP 192.168.123.1 with a fake hostname. The router is configured to redirect the usual TCP/IP server ports to the FreeBSD PC (e.g. ports 22, 25, 80 etc.), which makes the FreeBSD PC a kind of virtual server for my fixed IP address. One of the problems ...

  1. #1

    Default FreeBSD server behind router-NAT; how to configure sendmail?


    Hi,

    My ISP provides me with a fixed IP address and a
    registered hostname.

    I use a Sitecom DC-207 that serves as a plain router,
    NAT and 4-port switch, to connect three Windows PCs
    and one FreeBSD PC simultaneously to the internet.

    The router gets the fixed IP address, whereas my
    FreeBSD system gets IP 192.168.123.1 with a fake
    hostname.

    The router is configured to redirect the usual TCP/IP
    server ports to the FreeBSD PC (e.g. ports 22, 25, 80
    etc.), which makes the FreeBSD PC a kind of virtual
    server for my fixed IP address.

    One of the problems I encounter is this:
    Sendmail on the FreeBSD PC cannot deliver email,
    because there seems to be a DNS issue, because the
    FreeBSD PC does not have an official IP & hostname.

    How do I configure my FreeBSD PC so, that sendmail
    thinks the PC has the official IP address/hostname
    provided by my ISP, which is actually used by the
    router?
    Or should I follow a different configuration scheme
    for achieving these goals?

    Thanks,
    Rob.



    __________________________________
    Do you Yahoo!?
    Yahoo! Personals - Better first dates. More second dates.
    http://personals.

    Rob Guest

  2. #2

    Default Re: FreeBSD server behind router-NAT; how to configure sendmail?

    Am Samstag, 2. April 2005 18:07 schrieb Rob: 

    You can set the following ine /etc/mail/yourhostname.domain.mc

    define(`confDOMAIN_NAME', `host.name.fq')dnl

    host.name.fq is what ever your provider registred for your IP.
    Make sure there's also a correct A record for that hostname, eg. if it is
    spam.refuse.org then `host spam.refuse.org` must return your IP and `host IP`
    must return spam.refuse.org.

    If you don't have /etc/mail/yourhostname.domain.mc then you should cd
    to /etc/mail and type "make", after you edited the file "make all install
    restart"

    You also may want to define masquerading, like:
    MASQUERADE_AS(`yourdomain.org')
    MASQUERADE_DOMAIN(`internal.domain.sth')dnl
    FEATURE(limited_masquerade)dnl
    FEATURE(`masquerade_entire_domain')
    FEATURE(`masquerade_envelope')

    -Harry
     

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.0 (FreeBSD)

    iD8DBQBCTtDQBylq0S4AzzwRAqwUAJ4nx6MBE05td8FZHdTB0M EmkqSMRQCfQT+p
    eqc7g2MdusFs1kTdm7DDfk8=
    =iwE5
    -----END PGP SIGNATURE-----

    Emanuel Guest

  3. #3

    Default Re: FreeBSD server behind router-NAT; how to configure sendmail?

    Take a look at this: http://www.oav.net/mirrors/freebeemail.pdf.
    Building a stable and secure mailserver using Postfix, Spamassassin,
    Anti-virus and Squirrelmail (webmail).
    It al works fine using a (A)DSL modem/router and NAT (PAT).

    It's just a suggestion and not direct answering your question.
    (I used this how-to and it works fine :-)), so i like to share it with
    others )

    Robertico


    Robertico Guest

  4. #4

    Default Re: FreeBSD server behind router-NAT; how to configure sendmail?

    Emanuel Strobl wrote:\> 

    Thanks for your help. I generated the files with this
    make command, and all just worked out of the box.
    I can send email, without needing to tell sendmail
    about my hostname. So far so good.

    However, next what I need, is using another port for
    sending emails out. I have googled and read the
    sendmail FAQs, but I am completely at a loss here.

    There is a FAQ, that explains:

    If you want all outgoing SMTP connections to use
    port 2525, you can use this in your .mc file:

    define(`RELAY_MAILER_ARGS', `TCP $h 2525')
    define(`ESMTP_MAILER_ARGS', `TCP $h 2525')

    I have put this in my hostname.mc file, but to no
    avail. I'm probably not familiar enough with sendmail
    way of doing things. But then this is such a simple
    thing, that it should be easy.

    I suppose that with "netstat -a", there should be
    a line with port 2525, if above works. But that is
    not there.

    Do you have any suggestions how to solve this?

    Thanks,
    Rob.

    __________________________________________________
    Do You Yahoo!?
    Tired of spam? Yahoo! Mail has the best spam protection around
    http://mail.
    Rob Guest

  5. #5

    Default Re: FreeBSD server behind router-NAT; how to configure sendmail?

    Am Sonntag, 3. April 2005 17:36 schrieb Rob: 
    >
    > Thanks for your help. I generated the files with this
    > make command, and all just worked out of the box.
    > I can send email, without needing to tell sendmail
    > about my hostname. So far so good.
    >
    > However, next what I need, is using another port for
    > sending emails out. I have googled and read the
    > sendmail FAQs, but I am completely at a loss here.
    >
    > There is a FAQ, that explains:
    >
    > If you want all outgoing SMTP connections to use
    > port 2525, you can use this in your .mc file:
    >
    > define(`RELAY_MAILER_ARGS', `TCP $h 2525')
    > define(`ESMTP_MAILER_ARGS', `TCP $h 2525')
    >
    > I have put this in my hostname.mc file, but to no
    > avail. I'm probably not familiar enough with sendmail
    > way of doing things. But then this is such a simple
    > thing, that it should be easy.
    >
    > I suppose that with "netstat -a", there should be
    > a line with port 2525, if above works. But that is
    > not there.[/ref]

    I'm not sure if I understand your problem correctly, but what you did with
    these defines is that sendmail contacts every other system at port 2525
    insetad of 25, it's not listening on 2525, hence you can't see a tcp/2525
    with netstat -a.

    But I think it should do what you want, if I understand your description
    right. If you want sendmail to listen at a custom port these defines are
    wrong. I don't have them in my mind right now, I'm sure you'll find the M4
    defines at the sendmail FAQ, tell me if I can help.

    -Harry
     

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.0 (FreeBSD)

    iD8DBQBCUBkRBylq0S4AzzwRAoU3AJ45QCoVl248yGj48BU+Cb M8M3bFGACdEcQN
    FTWwVeaNAdpjZ3sCPSrnLkI=
    =nu3K
    -----END PGP SIGNATURE-----

    Harald Guest

  6. #6

    Default Re: FreeBSD server behind router-NAT; how to configure sendmail?

    Harald Schmalzbauer wrote: 
    >
    > I'm not sure if I understand your problem correctly,
    > but what you did with these defines is that
    > sendmail contacts every other system at port 2525
    > instead of 25, it's not listening on 2525, hence
    > you can't see a tcp/2525 with netstat -a.
    >
    > But I think it should do what you want, if I
    > understand your description right. If you want
    > sendmail to listen at a custom port these defines
    > are wrong. I don't have them in my mind right now,
    > I'm sure you'll find the M4 defines at the sendmail
    > FAQ, tell me if I can help.[/ref]

    Uh? So are the rules above right or not? I'm still
    confused. The header of that particular FAQ was:
    "How do I send using an alternate port?" and that's
    what I want, unless my English is badly deteriorating,
    which I often feel like when reading sendmail manual
    pages :(.

    Anyway, let's go back to what I want sendmail to do,
    which is possibly a little more complicated than
    just shifting to another outgoing port:

    1) for local delivery, i.e. users on the PC, deliver
    to the local mailboxes (does that need port 25?).

    2) for outgoing delivery, do that over an ssh-tunnel
    port, e.g. over port 2525:
    ssh -N -f -L 2525:localhost:25 smtp.my.isp

    I can create the ssh-tunnel easily:
    telnet localhost 2525
    connects me to the remote smtp server.

    As you may have noticed, I am a very newbie to
    sendmail configuration.

    Thanks for your help!
    Rob.



    __________________________________
    Do you Yahoo!?
    Yahoo! Small Business - Try our new resources site!
    http://smallbusiness./resources/
    Rob Guest

Similar Threads

  1. freebsd and 2 broaband dsl router
    By Kangaroo in forum FreeBSD
    Replies: 0
    Last Post: February 18th, 04:59 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139