Repository navigation
TL;DRWe need to setup postfix for a limited set of sender and receive addresses plus local outbound. While @SirWumpus has gratefully agreed to work on this issue, others have asked us to describe the matter: if nothing else it may allow others such as yourself to join a discussion around any proposed solutions. We are using a fairly recent postfix version 3.5.25, in case that matters. In the description below, we will write with generic usernames, example domains and IP CIDR address blocks. This will be for illustration purposes only as these are not the actual values that will be used. Requirements of the postfix configurationWe need a postfix configuration ( Ability to send out email to anywhereWe use the following lines in BTW: We need to send email to anywhere outside via the The FYI: we did a Email generated on the host can go to any local userEmail generated ON THE HOST (NOT from outside) can go to any local user, including any of those addresses referenced in For example, applications such as cron that send email to a local administrator need to be able to do so. BTW: We did a Inbound email connections are restrictedInbound email connections (not from the local machine) may only come from IP addresses listed in The NOTE: We also have firewall(s) in place to also enforce restricted access to TCP port 25. The above requirement is an added "defense in depth" practice. BTW: We did a Inbound sender email is restrictedFor all Inbound email, the sender MUST (i.e., SMTP FROM address) be listed in The FYI: We know that SMTP FROM addresses can be forged. This is a added "defense in depth" practice. BTW: We did a The destination of all Inbound email is restrictedThe destination of all Inbound email MUST be a LOCAL address / users listed in The BTW: The BTW: There are addresses in the Because FYI: We did a A few more thoughts and summaryIn the example files above where we show example lines, feel free to suggest changes such as There are no "normal" users on the system, just admins and IOCCC judges. All outbound email is generated on the machine. This will be a combination of messages sent to people who have registered for the IOCCC28 (i.e., to almost anywhere) and special external addresses that IOCCC judges monitor for generated reports. Inbound email, as you can see, is extremely restricted to some very specific IP addresses ( The host must never relay email. It must only receive inbound email, under the above restrictions, to specific local addresses. Locally generated email may go anywhere, to any local address or to any external address, however. We know that SMTP FROM addresses can be forged. We restrict external inbound email from addresses as an added "defense in depth" practice. Email generated on the machine (such as via cron job or via some command) may go to any valid local addresses (such as root or some admin username), however ALL Inbound email is restricted to connections from specific IP addresses We will have firewalls (and other things) that restrict network traffic. We will also limit inbound connections to TCP port 25 via the firewall. We want postfix, as a defense on depth, to further restrict inbound email sources by IP address. We have maintained postfix systems before; however we do not have time to configure this specific use case as we are finishing an application that is critical to the opening of IOCCC28. That is why we are asking for others to help us with these postfix configuration requirements. Thank you for your time and consideration. — The IOCCC Judges UPDATE 0The above message also surely contains things that we need to correct. When we have corrected (most) of them, we will update this sentence. :-) |
Replies: 15 comments 106 replies
|
A lot of this I have on my postfix config btw. I can try and look at it later I hope. |
|
FYI: with my tired eyes things seem reasonable. But as you know my vision is rubbish so you'll have to take that with a pinch of salt. I do however have a question before I can proceed anyway. QUESTIONBy sending email to local users: do you mean delivering it to the local system mailbox ? Or can it be for example luser@example.com (where example.com is the MTA hostname - and restricted from being accessed obviously)? Let me know and hopefully in the morn I can do more. Hoping to get some code in soon (almost done but one minor annoyance to fix). When that is done I can integrate it into mkiocccentry and if all good I can commit to both. I do have other things I need to do though so the code might not come today. |
I'm testing within my NetBSD VM which comes stock with 3.8.4 and an alternative package 3.9.1. @lcn2 Are you using a fresh install of In the config I'm working, I'm marking root elements like domain name, host, install paths with comments as what needs to change between TESTING and PRODUCTION when ready. From that I'm trying to get the TLS to the relay host working. After I'll fine tune the other elements. TLS and DNS setup is always a pain; thankfully I had most of it done for home use with Sendmail. |
It seems that 3.8.4 is close enough to our 3.8.5, based on these Ubuntu postfix 3.2.5 notes and these Debian postfix 3.2.5 notes. So we suggest version 3.8.4 as an alternative to 3.8.5 (and not 3.9.1).
We are using a fresh install and up to date release of AlmaLinux 9.5 if that matters.
Yes. UPDATE 0Corrected some typos in our comment. |
QUESTIONWhat exactly do you need done to resolve this issue entirely? About to start work on the other repo (after a useful update to jparse which will allow for more defence in depth in the mkiocccentry tool and the chkentry tool too). Thanks! |
|
We believe we have addressed all of the current questions that still need answering at this time. If we've missed something or something else needs to be clarified, please ask again. |
|
Our proposed DMARC record for Comments and suggestions welcome. |
|
And as for DMARC. Apparently for gmail if you're sending a large volume of emails you now have to use DMARC. I think I saw another domain but not sure. Perhaps hotmail? Fortunately neither really affect me. @SirWumpus: does DMARC require you put in an email address that can (obviously) be spammed? UPDATE 0Okay I see it does not require it. Perhaps you should change yours too, @lcn2 ? |
|
@lcn2 I just sent you (to the judges email) my postfix config (nothing revealing other than my IPs but since you already have ssh access on the server and since I am changing providers soon it doesn't matter :-) ). I gave some useful things you might or might not know. I also want to correct something I said earlier (here). I had said you don't need to run postmap: it will do it by itself in time. That is of course not correct. What is correct is you don't have to do a postfix reload in order for it to get seen. I do always do it right after to speed it up but it's not required. I made some important bug fixes in some of the mkiocccentry tools today and I hope to look at the chkentry enhancements tomorrow but I will be leaving shortly. Good day (to you too @SirWumpus)! |
|
See the updates to comment GH-discussioncomment-12257206. |
|
Side Saddle: This not at all important, but I thought you might get a chuckle from the SMTP Welcome message I have customised using BarricadeMX. Having longish (3+ lines) can throw off some spambots that script their connection session, such that everything is out of sequence. Now I collected this info from my local VM over a point-to-point SSH tunnel with my MX. The stuff you can do with SSH is so cool. elf$ telnet 10.1.0.1 25
Trying 10.1.0.1...
Connected to 10.1.0.1.
Escape character is '^]'.
220-mx.snert.org ACHTUNG! SMTP #633 11K6HU080230811800
220-ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS! DAS KOMPUTERMASCHINE
220-IST NICHT FUR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST
220-EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN
220-MIT SPITZENSPARKEN. IST NICHT FUR GEWERKEN BEI DUMMKOPFEN. DER
220-RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HANDER IN DAS
220 POCKETS MUSS. ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN.
help
214-2.0.0 ESMTP RFC 1985, 3207, 4954, 5321 supported commands:
214-2.0.0 AUTH DATA EHLO ETRN HELO HELP
214-2.0.0 NOOP MAIL RCPT RSET QUIT STARTTLS
214-2.0.0
214-2.0.0 ESMTP RFC 2821, 5321 not implemented:
214-2.0.0 EXPN TURN VRFY
214-2.0.0
214-2.0.0 Administration commands:
214-2.0.0 CONN CACHE INFO KILL LKEY OPTN
214-2.0.0 STAT VERB XCLIENT
214-2.0.0
214 2.0.0 End
quit
221 2.0.0 mx.snert.org closing connection #247 11K6HU080230811800
Connection closed by foreign host.
elf$ |
|
We believe we have addressed all of the current questions that still need answering at this time. If we've missed something or something else needs to be clarified, please ask again. |
|
@lcn2 You should have received an email with a tarball and status summary: Included is my current work to date.
|
|
This is still an important infrastructure issue: perhaps it can be solved before IOCCC29 opens? |
|
We came up with a Postfix solution that included a fair amount of code that interfaces with Postfix, including a test suite. The fix involved some adjustments in our email service provider, a minor DNS change, and a fair amount of code needed to validate inbound email messages. Our changes include things such as firewalls (yes more than 1), SELinux rules, IP address validation, SMTP envelope validation, email header validation (including some cryptographic stuff), as well as message body validation. We apologize that we cannot go into greater detail in this public forum: rest assured that we are following best practices, and that the postfix configuration has undergone extensive 3rd party review. The system has tested well, and is expected to go live well in time for *IOCCC30 to go into pending state. Thanks to @SirWumpus and @xexyl for your efforts and ideas. |
We came up with a Postfix solution that included a fair amount of code that interfaces with Postfix, including a test suite.
The fix involved some adjustments in our email service provider, a minor DNS change, and a fair amount of code needed to validate inbound email messages. Our changes include things such as firewalls (yes more than 1), SELinux rules, IP address validation, SMTP envelope validation, email header validation (including some cryptographic stuff), as well as message body validation.
We apologize that we cannot go into greater detail in this public forum: rest assured that we are following best practices, and that the postfix configuration has undergone extensive 3rd party…