Netgate m1n1wall

Author Topic: email server behind pfSense  (Read 8791 times)

0 Members and 1 Guest are viewing this topic.

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
email server behind pfSense
« on: April 18, 2012, 07:48:10 am »
Dear all,

I am very new at pfSense. We used Fortigate 100A previously. Now we have configured a pfSense. But we couldn't able to configure our email server appropriately.  As a result I need your help.
The configuration info are given below:

Internal Email Server IP: 10.10.1.5
Email Server IP: 94.55.x.x
pfSense External IP: 94.54.x.x

Thanks in advance for the assistance.

Offline chpalmer

  • Hero Member
  • *****
  • Posts: 1074
  • Karma: +0/-0
    • View Profile
    • Home of Cablenut
Re: email server behind pfSense
« Reply #1 on: April 18, 2012, 02:08:30 pm »
You need to provide a little more info...    :)

Do you have more than 1 WAN IP?

Are you using the WAN IP for only this server?


And you might include the other server I just noticed in your other post. Since this is the same subject, can you please keep it all in one place??   Thanks!   ;)


« Last Edit: April 18, 2012, 02:10:19 pm by chpalmer »
P.S. statements made by me are not necessarily condoned by the management of this fine organization.

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: email server behind pfSense
« Reply #2 on: April 18, 2012, 03:33:51 pm »
This is the Network you can find in the attachment.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 2893
  • Karma: +0/-0
    • View Profile
Re: email server behind pfSense
« Reply #3 on: April 18, 2012, 04:12:26 pm »
You still haven't answered the question.. You say your WAN IP is 94.54, but then your email is 94.55

So you own 2 class B?  Has your ISP routed multiple segments to you?  They gave you disjointed multiple IPs?

Or is that just a typo??
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Have I helped you, want to say thanks?  Donate to pfsense the cost of a beer http://pfsense.org/donate.html

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9983
  • Karma: +2/-0
    • View Profile
Re: email server behind pfSense
« Reply #4 on: April 18, 2012, 04:40:06 pm »
If you have valid ips on pfsense as well on servers, you do not need nat, just need firewall rules.

If your email server runs windows, I suggest you to take a look at postfix forwarder package to protect you mail system.

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: email server behind pfSense
« Reply #5 on: April 18, 2012, 05:17:49 pm »
Thanks marcelloc,

I will try to use postfix forwarder package. What can I use as anti-spam with postfix?

I tried with Firewall rules for the ports IMAP, POP3 and SMTP individually defining them but when mails sent from the it shows that the mail server ip was not 94.55.x.x instead it took the firewall ip as 94.54.x.x. How can I solve the problem.

If I create the virtual ip with the External email server ip 94.55.x.x and then make individually port forwarding for IMAP, POP3 and SMTP will it work? what do you think?

Thanks for your advice.

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: email server behind pfSense
« Reply #6 on: April 18, 2012, 05:21:29 pm »
johnpoz,

The ISP provided a 16 block of IP for using our servers from same block and gave 1 ip from another block for our firewall. This situation was predefined.

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9983
  • Karma: +2/-0
    • View Profile
Re: email server behind pfSense
« Reply #7 on: April 18, 2012, 06:22:18 pm »
I will try to use postfix forwarder package. What can I use as anti-spam with postfix?
postfix package has a lot of antispam features but you can install mailscanner package too.


I tried with Firewall rules for the ports IMAP, POP3 and SMTP individually defining them but when mails sent from the it shows that the mail server ip was not 94.55.x.x instead it took the firewall ip as 94.54.x.x. How can I solve the problem.

to use firewall ip as mx, you will need nat or postfix forwarder package

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: email server behind pfSense
« Reply #8 on: April 19, 2012, 01:41:20 am »
"to use firewall ip as mx, you will need nat or postfix forwarder package"

I need mail server ip (94.55.x.x) as mx. In this case is it possible to configure it from postfix package?

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9983
  • Karma: +2/-0
    • View Profile
Re: email server behind pfSense
« Reply #9 on: April 19, 2012, 06:21:02 am »
"to use firewall ip as mx, you will need nat or postfix forwarder package"

I need mail server ip (94.55.x.x) as mx. In this case is it possible to configure it from postfix package?
postfix will use server address, if you have 94.55. IP on pfsense, it will work

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: email server behind pfSense
« Reply #10 on: April 19, 2012, 06:30:04 am »
Dear marcelloc,

Don't mind. Actually I am very new in pfSense. What do you mean by 94.55.x.x ip in pfSense? My WAN IP is 94.54.x.x and my internal mail server configured as 10.10.1.5. Domain MX record is on 94.55.x.x and I want to send and receive mail through 94.55.x.x

I checked the postfix forwarder option that takes the Domain name and ip. If I put the domain name and ip (94.55.x.x) there will it work?

Thanks for your help.

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9983
  • Karma: +2/-0
    • View Profile
Re: email server behind pfSense
« Reply #11 on: April 19, 2012, 09:09:31 am »
nahid,

You network diagram shows internal and external ips on your mail server. If this ip is an alias on your pfsense, you just need to configure this alias to postfix forwarder and make an outbound nat (firewall -> nat) to force exchange outgoing ip address to be the same as mx.


att,
Marcello Coutinho

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: email server behind pfSense
« Reply #12 on: April 19, 2012, 09:50:13 am »
Thanks Marcello Coutinho.

I will do exactly what you have told on Saturday.

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: email server behind pfSense
« Reply #13 on: April 19, 2012, 10:47:24 am »
Marcello,

How can I configure an aliases in postfix forwarder? Is it the domain where I can give the aliases ip address or something else?

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9983
  • Karma: +2/-0
    • View Profile
Re: email server behind pfSense
« Reply #14 on: April 19, 2012, 09:46:07 pm »
Marcello,

How can I configure an aliases in postfix forwarder? Is it the domain where I can give the aliases ip address or something else?
on domain tab you specify internal domains as well internal ips.

do you mean domain aliases like mydomain.com and domain2.com?