1 / 42

Popular MTAs EXIM & POSTFIX

Popular MTAs EXIM & POSTFIX. SPARCS 10 이대근 (harry). MTA. M ail T ransfer A gent. or. M essage T ransfer A gent. Let’s recall…. E-mail. MDA : Mail  우편함. 그냥 새. MTA. MTA. MUA (ex: outlook express). MUA. With MTA you can…. Send and receive an email, of course

kuper
Download Presentation

Popular MTAs EXIM & POSTFIX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Popular MTAsEXIM & POSTFIX SPARCS 10 이대근(harry)

  2. MTA Mail Transfer Agent or Message Transfer Agent

  3. Let’s recall…

  4. E-mail MDA : Mail  우편함 그냥 새 MTA MTA MUA (ex: outlook express) MUA

  5. With MTA you can… • Send and receive an email, of course • To users of your machine, without ISP • To other mail servers, you need connection to internet • Fetch emails from POP3 server • using fetchmail • Receive emails in right place • Using procmail • Get messages from some programs via e-mail • Log files or security warnings can be delivered to your email

  6. A Lot of MTAs And Qmail, Courier, Smail, MMDF…

  7. EXperimentalInternet Mailer EXIM

  8. EXIM • One of the most popular MTAs • Default MTA for Ubuntu • SPARCS server • GPL • Flexible, extensible • Good compatibility with Sendmail • Latest stable release: 4.72 (2010/06/03)

  9. How EXIM delivers mails? Mail server SMTP(25) Receiver Delivery Daemon Spool Queue runner RemoteDelivery LocalDelivery Internet Mailbox

  10. Message ID 1OROMT-0003j0-6G Time Process ID Time Fractional part of the time of reception. The unit may be 1/2000 sec, 1/1000 sec, 1/200 sec or 1/100 sec. The time at which the message started to be received. The number of seconds since the start of the epoch. ID of the process which received the message.

  11. Command line options # exim [options] [arguments] ––help Displays help message –bd Runs exim as a daemon, awaiting incoming SMTP connections from all available interfaces. Usually used with option –q. –q Starts one queue runner process. Time specifications start queue runner periodically. (–q30m for starting every 30 minutes)

  12. Command line options # exim [options] [arguments] –Mc <message id> <message id> … Deliver messages in turn. Usually called internally by queue runner. –C <filelist> Find configuration files in <filelist> and apply them instead of default configuration file specified by CONFIGURE_FILE. –bP <option name> <option name> … Print the current configuration to standard output.

  13. Let’s see SPARCS server [21:56:58]harry@sparcs:~$ ps aux | grepexim 102 2563 0.0 0.0 13344 1332 ? Ss Jul01 0:02 /usr/sbin/exim4 -bd -q30m Root 17964 0.0 0.2 13588 3680 ? S 18:14 0:00 /usr/sbin/exim4 -Mc 1OXW93-0004fL-QH 102 17966 0.0 0.1 13588 2056 ? S 18:14 0:00 /usr/sbin/exim4 -Mc 1OXW93-0004fL-QH 102 17976 0.0 0.0 13352 896 ? S 18:14 0:00 /usr/sbin/exim4 -bd -q30m

  14. Configuring EXIM • EXIM configuration file is divided into 6 parts • ACL: Access control list for controlling incoming SMTP mails • Authenticators: Settings for authenticator drivers • Routers: Determines how the messages is to be delivered • Transports: Defines the mechanisms how the messages are to be copied • Retry: Rules for use when the message cannot be delivered immediately • Rewrite: Global address rewriting rules • Local_scan: Private options for local_scan()function Difficult?

  15. /etc/exim4/update-exim4.conf.conf [21:56:58]harry@sparcs:/etc/exim4$ cat update-exim4.conf.conf # /etc/exim4/update-exim4.conf.conf # # Edit this file and /etc/mailname by hand and execute update-exim4.conf # yourself or use 'dpkg-reconfigure exim4-config' # # Please note that this is _not_ a dpkg-conffile and that automatic changes # to this file might happen. The code handling this will honor your local # changes, so this is usually fine, but will break local schemes that mess # around with multiple versions of the file. # # update-exim4.conf uses this file to determine variable values to generate # exim configuration macros for the configuration file. # # Most settings found in here do have corresponding questions in the # Debconf configuration, but not all of them. # # This is a Debian specific file

  16. /etc/exim4/update-exim4.conf.conf dc_eximconfig_configtype='internet' dc_other_hostnames='sparcs.org;sparcs.net;143.248.234.102' dc_local_interfaces='' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' CFILEMODE='644' dc_use_split_config='true' dc_hide_mailname='' dc_mailname_in_oh='true' dc_localdelivery='maildir_home'

  17. /etc/exim4/update-exim4.conf.conf dc_eximconfig_configtype='internet' • dc_eximconfig_configtype: The main configuration type. • ‘local’: Mails are sent and received between the accounts of local machine • ‘internet’: Configure as a general email server connected to internet • ‘satellite’: Sends mail to another machine(smarthost) • ‘smarthost’: Intermediates email • Sets macro DC_eximconfig_configtype.

  18. /etc/exim4/update-exim4.conf.conf dc_other_hostnames='sparcs.org;sparcs.net;143.248.234.102' dc_other_hostnames : List of domains of mails that the server will finally accept Multiple values can be set, separated by colon(:). Mails delivered to harry@sparcs.org, harry@sparcs.net, harry@143.248.234.102 will be passed from daemon process to receiver process.

  19. /etc/exim4/update-exim4.conf.conf dc_local_interfaces='' dc_local_interfaces : List of IPs for daemon to listen on Multiple values can be set, separated by colon(:). Empty string means all interfaces.

  20. /etc/exim4/update-exim4.conf.conf CFILEMODE='644' CFILEMODE : The octal file mode of the generated file Sets the mode of the files that are generated by update-exim4.conf.

  21. /etc/exim4/update-exim4.conf.conf dc_use_split_config='true' • dc_use_split_config : Defines whether it uses split configuration files • ‘true’: Uses multiple files below /etc/exim4/conf.d • ‘false’: Uses single file /etc/exim4/exim4.conf.template dc_localdelivery='maildir_home' • dc_local_delivery : Name of default transport directory • ‘’ or ‘mail_spool’: Mails are delivered to spool by default • ‘maildir_home’: Mails are delivered to ~/Maildir/ by default

  22. Update configuration # update-exim4.conf –d /etc/exim4 –o /etc/exim4/exim4.conf Automatically generates configuration files. # /etc/init.d/exim4 restart Restarts the daemon with new configuration.

  23. Log files • /var/log/exim4/mainlog • /var/log/exim4/rejectlog

  24. PostFix

  25. POSTFIX • One of the most popular MTAs • IBM Public License(free) • Secure alternative to Sendmail • Able to handle large amounts of emails • Latest stable release: 2.7.1 (2010/06/08)

  26. Installation

  27. /etc/postfix/main.cf [21:56:58]harry@sparcs:/etc/postfix$ cat main.cf # See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. myorigin= /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h readme_directory = no

  28. /etc/postfix/main.cf # TLS parameters smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = sparcs alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydestination = sparcs.org, sparcs.net, localhost.localdomain, , localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all

  29. /etc/postfix/main.cf # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. myorigin= /etc/mailname myorigin: Specifies the domain that appears in mail that posted on this machine. /etc/mailnamehas sparcs.kaist.ac.kr in its first line, so specifying myorigin = /etc/mailname makes the sender of the mails outgoing from this machine like ‘harry@sparcs.kaist.ac.kr’. myorigin = $mydomainis one of the most generally used settings.

  30. /etc/postfix/main.cf mynetworks_style = subnet • mynetworks_style : Specifies what kinds of clients to relay mail from. • host: Forwards mails from only the local machine • subnet: Forwards mail from the clients in the same subnetwork as the machine • class: Forwards mail from the clients in the same class as the machine • If mynetworks_style is not set, you should specify the mynetworks list by hand.

  31. /etc/postfix/main.cf mydestination = sparcs.org, sparcs.net, localhost.localdomain, , localhost mydestination : Specifies what domains this server will finally accept Multiple values can be set, separated by commas(,).

  32. /etc/postfix/main.cf relayhost = • relayhost : Specifies the delivery method • (empty string): Deliver the mail directly to the internet • $mydomain: Deliver mails via local mail server inet_interfaces = all inet_interfaces : Specifies what interfaces that daemon should listen on

  33. Update configuration # postfix reload # /etc/init.d/postfix restart Restarting postfix daemon will apply your new settings

  34. Log files • /var/log/mail.log • /var/log/mail.info • /var/log/mail.err • /var/log/mail.warn

  35. Aliases & Forwarding

  36. Aliases • Alias is a way to use a virtual mail account • If webmaster is an alias of harry, messages sent to webmaster@sparcs.org will be redirected to harry’s mailbox. • Alias is an easy way to configure mailing list • If wheel-seminar is aliases of all members who participates in wheel seminar, messages sent to wheel-seminar@sparcs.org will be redirected to their mailboxes. • MTAs automatically reads alias database when the delivery process starts and deliver messages according to it.

  37. /etc/aliases • <alias> : <actual name> • webmaster : harry • <alias> : :include:<file name> • wheel-seminar : :include:/SPARCS/mail/aliases.d/wheel-seminar • Files is just a list of usernames separated by newlines. • We have a good tool: edalias

  38. newaliases • MTAs read /etc/aliases.db, not /etc/aliases. • You have to update database file after editing aliases files. • # newaliases

  39. Forwarding • Pass messages to other mail addresses • If harry forwards his mails to harry@gmail.com, all mails sent to harry@sparcs.org will be delivered to harry@gmail.com, in fact.

  40. Settings • Alias • harry : harry@gmail.com • /home/harry/.forward • harry@gmail.com

  41. Questions?

  42. Thank you!

More Related