Home > Articles > Security > Network Security

Supporting External or Mobile Users

One problem that many administrators face is supporting external and mobile email users. The problem of supporting those remote users stems from one of the basic assumptions used to stop Unsolicited Commercial Email (UCE). UCE, commonly known as SPAM, is the bane of email and the Internet. Although some ISPs allow their customers to use their email servers to send UCE, most do not. Many spammers will search for email servers that are misconfigured to allow anyone, including the spammers, to send email from anywhere to any destination address, not just those the email server is responsible for. This misconfiguration is known as an "open-relay" because you are relaying email to their final destination for anyone, not just your trusted users.

The basic premise of preventing UCE works like this:

  • Your email server knows what domains it is to receive email for, and will gladly do so from anywhere—internal trusted users or any IP address reachable on the Internet.

  • Your email server is configured to know your internal trusted networks, and will gladly receive email to any destination on the Internet, as long as the client machine came from a trusted source. The email server will then speed the messages along to their final destinations on your internal trusted users' behalf.

  • Any email that is not destined for a domain serviced by your email server, and not originating from a trusted source, will be rejected.

The problem then is this: How does one identify trusted users to the mail server? These users might be in a different branch location, and thus using a different network address. They may be telecommuting users who have cable modems or DSL, and are either statically assigned or dynamically assigned IP addresses. They may be roaming users who are dialing up through their local or global ISP. Each of these problems can be addressed in many ways. Let's look at several common scenarios.

Remote Users with Fixed IP Addresses

Remote users, or offices, with a fixed IP address can be addressed by simply adding their IP address to an access table. Remember that Postfix's configuration files are modular, so you can simply add or remove IP addresses to access tables on an as-needed basis. There is no need to stop and restart your Postfix mail server, and the access table file can easily be distributed to multiple Postfix relays.

Although certainly not secure, there is a way you can support users without fixed IP addresses. In the Postfix access table you can also specify DNS domain names of your user's ISPs. Specifying a domain name allows any reverse resolvable IP from that ISP to effectively use your email server. While this may solve a problem, it opens the potential for many more serious problems, and is generally not a recommended way to configure Postfix.

The advantages of configuring your Postfix MTA to use the simple access table method are as follows:

  • You do not impact the users; they continue to use their clients as they would locally.

  • It is easy to bring whole offices on-line simply by adding their network address space or external firewall proxy address.

  • You do not expose usernames and passwords in the clear over the Internet.

There are several disadvantages, which may or may not concern you in your deployment situation:

  • There is no actual authentication of users to your mail server, so anyone sitting at those IP addresses or remote offices could use your mail server unhindered.

  • IP addresses are easy to spoof, so therefore not a strong method of identifying a remote identity.

  • If the lookup table contains whole ISP networks for dial-up users, any user from that ISP can use your email server as an open relay.

  • It may create additional administrative work to keep the access table up-to-date.

Implementing the client access table method in Postfix is quite simple. First, create or edit a file called client_access. This file will contain the IP address or DNS domain name of the host or network you want to relay mail for, followed by an action. Actions, if you recall from the first article in this series, are the measures that Postfix takes on a pattern match. We could specify whether to explicitly accept (OK) or deny (REJECT) clients or ISPs.

/etc/postfix/client_access:
  4.3.2.1      OK
  bigisp.com    OK

After you have created the client_access file, remember to issue the postmap command to convert it to a database table.

Next, edit your main.cf configuration file to set smtpd_recipient_restrictions. Normally, you would allow trusted networks using the permit_mynetworks directive, and check_relay_domains for domains you wish to relay to for untrusted clients. Add the check_client_access parameter, and specify a hash map type (the hash: part) with the actual lookup table name and location:

/etc/postfix/main.cf:
  smtpd_recipient_restrictions =
    permit_mynetworks
    check_client_access hash:/etc/postfix/client_access
    check_relay_domains

You can specify a different database format, such as dbm or btree, instead of hash if your system has those access methods available to you. Just be certain to create the database lookup table using the same method using the postmap command.

Finally, you need to tell the running Postfix processes about your configuration change. Simply type postfix reload as root-level admin, and the Postfix processes will reread the configuration file.

You should now have a Postfix configured to allow remote offices and telecommuting users to send email through your email server. But how can those concerns in the list of cons be addressed?

Authenticating the Sender

One way of allowing roaming users (and even users in remote locations) to use the email servers is to have the users be authenticated somehow.

A very easy way, although not recommended, is to authenticate the email based on the sender address. The process basically scans the email headers looking for a valid sender address. This address is then compared to a list of addresses that are allowed to relay email.

Hopefully, you can immediately see the problems with this approach: It is trivial to forge email messages, and therefore spoof a sender's address; and it also creates additional administrative burdens by keeping the sender address lookup table in sync with users within the organization.

Implementing the sender access table method in Postfix is quite similar to implementing the client access table authentication. First, create or edit a file called sender_access. This file will contain the email address of the sender you want to enable email relaying for.

/etc/postfix/sender_access:
  user1@domain.com     OK
  user2@domain.com     OK

Again, convert the text file into a database lookup table using the postmap command.

Next, edit your main.cf configuration file to set smtpd_recipient_restrictions. Add the check_sender_access parameter, and specify a hash map type (the hash: part) with the actual lookup table name and location.

/etc/postfix/main.cf:
  smtpd_recipient_restrictions =
    permit_mynetworks
    check_client_access hash:/etc/postfix/client_access
    check_sender_access hash:/etc/postfix/sender_access
    check_relay_domains

Finally, type postfix reload to put the new configuration file into effect.

POP-before-SMTP

A more effective method is to have the user authenticate first to the mail server using an actual account name and password. That is tougher to spoof and impersonate. Not impossible, but certainly harder.

There are several different methods available that are listed on the Postfix Add-on's page (http://www.postfix.org/addon.html).

The least invasive, and easiest to install and set up is POP-before-SMTP (http://people.oven.com/bet/pop-before-smtp/), written by Bennett Todd. POP-before-SMTP is a daemon written in the Perl scripting language that watches the system logs for clients that pull their email via POP or IMAP. After the script sees a successful authenticated login, it logs that IP address into a database that is readable by Postfix. After a specified interval, say 30 minutes after the last successful POP/IMAP login, the IP address is expired. The main drawback to POP-before-SMTP is that both the script and POP/IMAP daemons must run on the same server as Postfix.

DRAC (http://mail.cc.umanitoba.ca/drac/index.html), written by J. Gary Mills, is a daemon that dynamically updates a relay authorization map. This map is also in a readable format by Postfix.

Like POP-before-SMTP, the user's IP addresses are added to the map after they have successfully authenticated to the POP/IMAP server. Unlike POP-before-SMTP, DRAC needs to be patched into supporting POP/IMAP servers, so you must be comfortable with getting source, patching it, and compiling it with the appropriate configuration settings.

However, because the actual source of the POP/IMAP servers has been changed, they now know how to update the DRAC daemon on the various SMTP servers. This allows the POP/IMAP and SMTP servers to be on different machines. For highly customized environments that have multiple servers to handle the volume, this method provides a more scalable solution.

To support DRAC, the Postfix configuration would then be modified as such:

/etc/postfix/main.cf:
  smtpd_recipient_restrictions =
    permit_mynetworks
    check_client_access btree:/etc/postfix/dracd
    check_relay_domains

Notice that DRAC uses the btree indexing method on its database maps. You must make sure that your Postfix installation supports the btree map method as well.

RFC-2554, or SMTP Authentication

POP/IMAP authentication prior to sending SMTP email is fine for 90% of the instances. However you will occasionally come across those users, or situations, where POP/IMAP before sending does not work. Specifically if you have automated processes that need to send email in response to monitoring needs, for example. How can you authenticate your clients to your SMTP server?

SMTP Authentication is defined in RFC-2554 (http://www.rfc-editor.org/rfc/rfc2554.txt), and has been working in Postfix since experimental release 20000314, although it is recommended you use the newest snapshot or official releases.

SMTP requires that you install SASL, the Simple Authentication and Security Layer, as a prerequisite to compiling Postfix. So let's talk first about SASL.

SASL

SASL, the Simple Authentication and Security Layer, is defined in the base RFC-2222 (http://www.rfc-editor.org/rfc/rfc2222.txt). Cyrus SASL (http://asg.web.cmu.edu/sasl/) is a Postfix-supported implementation written by the Project Cyrus team at Carnegie Mellon University. Cyrus SASL v1.5.5 or newer is required to work with Postfix.

Your distribution may already come with the appropriate Cyrus SASL libraries, but if not, you can retrieve the source from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/, and compile it yourself. Note that if you are compiling yourself, and you must support Microsoft clients and then you must configure Cyrus SASL with --enable-login to force building with the non-standard LOGIN authentication method.

After you have successfully installed the Cyrus SASL libraries, you must properly configure it to the method you will be using to authenticate your uses. Cyrus-SASL uses the /usr/local/lib/sasl/smtpd.conf file for this purpose.

If you plan on authenticating users to your UNIX passwd database, and you are not using Pluggable Authentication Modules (PAM), you must use the Cyrus SASL pwcheck daemon.

/usr/local/lib/sasl/smtpd.conf:
    pwcheck_method: pwcheck

If you plan on authenticating users to Cyrus-SASL's own database—especially useful if you are using the Cyrus mail system for POP/IMAP access—you must configure the pwcheck method to use the sasldb:

/usr/local/lib/sasl/smtpd.conf:
    pwcheck_method: sasldb

Pluggable Authentication Modules (PAM), are generally available on most modern UNIX-like variants such as GNU/Linux, Solaris, and HP-UX. PAM can be used to authenticate against many sources, UNIX passwd database, Windows domain controllers on a WinNT/Win2K network, to NIS servers, Kerberos, LDAP, and MySQL databases. After you have your PAM authentication configuration working, you can tell your SMTP servers to authenticate in the same manner. In order to authenticate against PAM:

/usr/local/lib/sasl/smtpd.conf:
    pwcheck_method: PAM

After you have properly compiled, installed, and configured the Cyrus SASL libraries, you must compile Postfix with SASL support; otherwise, it will whine about being misconfigured in your system logs and not authenticate your roaming users. Compiling Postfix with SASL support is done by running the make command-line with the following arguments (assuming your SASL installation lives in /usr/local/):

make makefiles CCARGS="-DUSE_SASL_AUTH -I/usr/local/include" \
 AUXLIBS="-L/usr/local/lib -lsasl"

A more detailed description of using Postfix with SASL can be found in the SASL_README file included in the Postfix source archive.

Unfortunately, the default builds for Debian and the BSD platforms do not include SASL support by default. The Debian package will need to be rebuilt from the source .deb, whereas the BSD packages will need to be built with the SASL flavor.

Making Postfix Do SMTP AUTH

Not to make light of the machinations that must be overcome to get Cyrus-SASL installed and Postfix configured to properly make use of it, but the rest is a cakewalk.

To turn on SMTP authentication in Postfix, simply add the following lines to your main.cf, some of which are already there:

/etc/postfix/main.cf:
  smtpd_sasl_auth_enable = yes
  smtpd_recipient_restrictions = 
    permit_mynetworks, 
    permit_sasl_authenticated,
    check_relay_domains

Remember the broken Microsoft clients that we enabled explicit support for in the SASL libraries? Well, older Microsoft SMTP client software implements a non-standard version of the AUTH protocol syntax, and expects that the SMTP server replies to EHLO with

250-AUTH=GSSAPI LOGIN PLAIN

instead of

250-AUTH GSSAPI LOGIN PLAIN

Note that the difference is the equal sign between AUTH and the available AUTH methods. To work around such broken but significantly deployed clients, Postfix has a specific configuration directive you must enable. Edit or add the following line to the main.cf file to support Microsoft mail clients:

/etc/postfix/main.cf:
  broken_sasl_auth_clients = yes

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020