On 3/12/2013 11:22 PM, Alex wrote: >>> header_checks = pcre:/etc/postfix/header_checks.pcre >>> pcre:/etc/postfix/header_checks-jimsun.pcre >> >> Are the jimsum checks still effective? I thought these were years >> old, and I wouldn't expect them to do much good. > > Not really. I just use it to outright reject .com and .exe files. Your > name is in there, attributed with writing a few of those rules years > ago.
The extension matching rules really belong in mime_header_checks. That feature didn't exist when these were originally published. (if mime_header_checks is undefined, it automatically reuses $header_checks) I thought those rules had a bazillion Subject: matches, few of which will ever match any current spam. Ineffective rules should be removed, both for general cleanliness and to prevent false positives. >>> relay_domains = $mydestination, $transport_maps >> >> relay_domains is for domains you're the MX for, but are delivered >> elsewhere, such as a downstream mail store. >> >> transport_maps does not belong here; if you add a transport for eg. >> hotmail.com, you've made yourself an open relay to that destination. >> >> Typically this should be set explicitly empty >> # main.cf >> relay_domains = > > This server's entire purpose is to relay mail. I have a few > transport_maps for the eventual destination of the mail this server > processes. Ok, but $transport_maps really does not belong in relay_domains, because it's too easy for someone to innocently add an off-site destination there -- instant open relay. Far better to make a separate file for the dual purpose, named transport_relay or some such, then use that file in addition to transport_maps. transport_maps = hash:/etc/postfix/transport, hash:/etc/postfix/transport_relay relay_domains = $mydestination, hash:/etc/postfix/transport_relay >>> smtpd_recipient_restrictions = reject_non_fqdn_recipient, >>> reject_non_fqdn_sender, reject_unlisted_recipient, >>> permit_mynetworks, reject_unauth_destination, >>> check_client_access hash:/etc/postfix/client_checks, >>> check_sender_access hash:/etc/postfix/sender_checks, >> >> Ok. I notice you don't have permit_sasl_authenticated here, which >> forces sasl users to use the submission port. That's fine. > > So I could continue to have the user's use port 25 with TLS? I hadn't > realized that. I like that option a lot better. The current setting (no permit_sasl_authenticated in smtpd_recipient_restrictions) means sasl users can't relay (relay - send mail to an off-site destination) using port 25. That's common practice, and generally recommended. If you're not getting too many complaints, don't change it. If users have trouble setting up submission/STARTTLS, consider enabling smtps port 465 with smtpd_tls_wrappermode=yes on that port in master.cf. This corresponds to the "SSL" setting in most consumer mail software. (It's not really SSL, but that's the common consumer term used). I'll also point out that smtps is not an RFC standard and was deprecated ~15 years ago when STARTTLS was invented, but it's still widely used. There are no notable security considerations with smtps; it's mostly just a "correct vs. convenient" issue. > > I bet this also explains why using the account test option when > creating a new account using Thunderbird fails when I try to force it > to use 993 for imaps with TLS, but succeeds using 143 and TLS. No, that's tbird receiving via IMAP and has no relation to tbird sending via SMTP. > > Would I set this option immediately after the permit_mynetworks? If you want to allow sasl users to use port 25, yes. But I suggest leave it as it is now. >> You might as well move reject_unknown_sender_domain to >> smtpd_recipient_restrictions and just empty this section. > > It's okay to add this after the permits and check_client/sender_access? Yes. The general rule-of-thumb order is: smtpd_recipient_restrictions = [restrictions applied to everyone, including local users] permit_mynetworks reject_unauth_destination [whitelists] [reject_* restrictions] [check_*_access local blacklists] [rbl lookups] The idea is to do the cheap built-in tests before slightly more expensive local lookups, before most expensive DNS based tests. If you choose to also allow sasl users here, permit_sasl_authenticated goes next to permit_mynetworks (doesn't matter if it's before or after). -- Noel Jones
