pfSense Gold Subscription

Author Topic: Postfix Backup MX  (Read 1310 times)

0 Members and 1 Guest are viewing this topic.

Offline G.D. Wusser Esq.

  • Full Member
  • ***
  • Posts: 108
  • Karma: +1/-0
    • View Profile
Postfix Backup MX
« on: December 17, 2014, 10:57:42 pm »
Hi,

I came across a message that pfSense Postfix package can be used as a backup MX server. That is, when the main MX goes down, hold messages for minutes-hours-days, and then relay the messages to the main MX server when it comes back online.

I just loaded the package, and it looks like backup MX mode needs manual configuration.

Are there any pfsense specific examples available?

Thank you.

Offline biggsy

  • Hero Member
  • *****
  • Posts: 646
  • Karma: +16/-0
    • View Profile
Re: Postfix Backup MX
« Reply #1 on: December 18, 2014, 01:28:43 am »
Hi,

Is this the post you are talking about?

I guess it would depend on whether you are using pfSense/postfix as a front-end to your real mail server as well.  That could be trickier.

If you're not, I don't see anything in that post that would require you to manually configure the main.conf file.

These things are pretty much as recommended in the post: "First make sure that smtpd_recipient_restrictions contains permit_mynetworks and reject_unauth_destination"

Similarly, these things are as described:
  •     mydestination
  •     virtual_alias_domains
  •     virtual_mailbox_domains

Not sure about the queuing part but I have certainly seen postfix queue messages until I corrected a misconfiguration that led it to think the mail server wasn't alive.

Worth a try.

Offline G.D. Wusser Esq.

  • Full Member
  • ***
  • Posts: 108
  • Karma: +1/-0
    • View Profile
Re: Postfix Backup MX
« Reply #2 on: December 18, 2014, 10:23:10 am »
Thank you for your reply. The link you posted is one of the general examples.

The default configuration of the pfSense Postfix package will not hold messages if the mail server goes down. Somebody else asked a similar question on these forums, and the gist of the discussion was that it should be possible. I was just wondering if somebody already has a working recipe.

I will dig into this today and post my findings.

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 13405
  • Karma: +590/-7
    • View Profile
Re: Postfix Backup MX
« Reply #3 on: December 18, 2014, 11:40:55 am »
The default configuration of the pfSense Postfix package will not hold messages if the mail server goes down.

It will hold messages and will work as an mx backup.

Just configure general and domain tabs. For an extra config for valid recipients, check recipient tab.

Offline G.D. Wusser Esq.

  • Full Member
  • ***
  • Posts: 108
  • Karma: +1/-0
    • View Profile
Re: Postfix Backup MX
« Reply #4 on: December 18, 2014, 01:36:26 pm »
You are probably right, but it looks like something needs tweaking
.
What is causing the following messages, when the primary MX is down?

Code: [Select]
450 4.1.1
Recipient address rejected: unverified address: Address verification in progress

Is Postfix trying to query the main MX if the recipient is valid? Obviously that will not work when the main MX is down.

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 13405
  • Karma: +590/-7
    • View Profile
Re: Postfix Backup MX
« Reply #5 on: December 18, 2014, 11:21:07 pm »

Is Postfix trying to query the main MX if the recipient is valid? Obviously that will not work when the main MX is down.

At least using ldap perl script on AD, if the MX is offline, it uses current list until a new one is fetched.

Offline G.D. Wusser Esq.

  • Full Member
  • ***
  • Posts: 108
  • Karma: +1/-0
    • View Profile
Re: Postfix Backup MX
« Reply #6 on: December 19, 2014, 03:00:15 pm »
No LDAP on this setup, just a hard-coded list of valid recipients.

I switched the Header verification from Strong to Basic, and “Address verification in progress” rejections stopped.

Maybe, in the future, it would be nice to have more granular control over header verification options, where individual ones could be checked on and off; perhaps with ones that require server verification grouped together, for easier configuration of backup mail exchanges.

Thank you.
« Last Edit: December 20, 2014, 07:34:02 pm by G.D. Wusser Esq. »

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21486
  • Karma: +1456/-26
    • View Profile
Re: Postfix Backup MX
« Reply #7 on: December 29, 2014, 01:15:48 pm »
FYI- In theory / on paper this sounds good but in practice you might find, as I have, that spammers tend to hit your backup MX harder than the primary since backup mail servers tend to have less stringent spam controls.

Not saying it's a bad idea to have a backup MX, it's a great idea, but be forewarned / prepared for what may come.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline sektor

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Postfix Backup MX
« Reply #8 on: January 02, 2018, 10:42:08 pm »
Sorry to revive an old topic but I am actually curious about this setup.

Offline Gertjan

  • Hero Member
  • *****
  • Posts: 2279
  • Karma: +173/-9
    • View Profile
Re: Postfix Backup MX
« Reply #9 on: January 03, 2018, 04:55:04 am »
A high priority mail server - the main MX - and a lower priority server, the backup MX - have exactly the same setup from a "pfSense point of view".

Offline sektor

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Postfix Backup MX
« Reply #10 on: January 14, 2018, 10:02:32 am »
I know how that works, but I was just wondering if it was possible to do it with pfsense should my main server be down briefly.

Offline Gertjan

  • Hero Member
  • *****
  • Posts: 2279
  • Karma: +173/-9
    • View Profile
Re: Postfix Backup MX
« Reply #11 on: Yesterday at 12:05:30 am »
I'm using myself a "3 € a month" small dedicated VPS system as my backup MX, running postfix.
As Jimp said above, this server backup MX gets hit rather often (mine does), because many spammers do not send mail to to main MX, but directly to the back MX.
This means that all mail filtering, present on your main MX should also be present on your backup MX.

This means for me :
fail2ban,
grey listing,
amavis (spamassassin and clamav and their boatload of plugins
which implies full MySQL support

The thing is : all these kind of programs just don't belong on a firewall.

Btw : many voices just state : "do not use a MX backup, you don't need it" because the defition of the mail protocol says : "if the destination server can't be reached, the mail should be queued for a day or so ..." which means that if things go bad, you have a day "click it to work".


Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21486
  • Karma: +1456/-26
    • View Profile
Re: Postfix Backup MX
« Reply #12 on: Yesterday at 09:14:16 am »
The only downside of not having a backup MX is having to wait hours (4+) for retries to come through, or longer if it's a prolonged outage. It's not the end of the world, though, messages will be resent.

If you botch the backup MX config then it could be worse. You could accidentally reject mail and never receive it, or let even more spam through on a continuing basis.

The best backup MX is an exact duplicate of your primary mail server hosted off-site.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!