{"id":284,"date":"2011-05-14T11:15:10","date_gmt":"2011-05-14T02:15:10","guid":{"rendered":"http:\/\/systemdev.comsys-blog.com\/?p=284"},"modified":"2011-05-14T11:15:10","modified_gmt":"2011-05-14T02:15:10","slug":"centos5-6-sendmail-procmail-%e8%a8%ad%e5%ae%9a%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/tamura.jp\/?p=284","title":{"rendered":"CentOS5.6 Sendmail \u8a2d\u5b9a\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u30b5\u30fc\u30d0\u3092\u30de\u30eb\u30c1\u30c9\u30e1\u30a4\u30f3\u3067\u904b\u7528\u3057\u3001procmail \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306esendmail.mc\u3002<br \/>\nlocalhost.locahdomain \u304c\u3044\u305f\u308b\u6240\u306b\u51fa\u3066\u3001\u4e2d\u7d99\u6642\u306b\u4ed6\u306e\u30b5\u30fc\u30d0\u306breject\u3055\u308c\u3066\u3057\u307e\u3063\u3066\u3044\u305f\u3002<br \/>\n\u3042\u3068\u3001\/etc\/hosts \u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3002<br \/>\n127.0.0.1 hogehoge.jp localhost.localdomain localhost<\/p>\n<p>sendmail.mc \u306e\u8a18\u8ff0\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<br \/>\n\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193\u2193<\/p>\n<div>\n<pre>divert(-1)dnl\ndnl #\ndnl # This is the sendmail macro config file for m4. If you make changes to\ndnl # \/etc\/mail\/sendmail.mc, you will need to regenerate the\ndnl # \/etc\/mail\/sendmail.cf file by confirming that the sendmail-cf package is\ndnl # installed and then performing a\ndnl #\ndnl #     make -C \/etc\/mail\ndnl #\ninclude(`\/usr\/share\/sendmail-cf\/m4\/cf.m4')dnl\nVERSIONID(`setup for linux')dnl\nOSTYPE(`linux')dnl\ndnl #\ndnl # Do not advertize sendmail version.\ndnl #\ndnl define(`confSMTP_LOGIN_MSG', `$j Sendmail; $b')dnl\ndnl #\ndnl # default logging level is 9, you might want to set it higher to\ndnl # debug the configuration\ndnl #\ndnl define(`confLOG_LEVEL', `9')dnl\ndnl #\ndnl # Uncomment and edit the following line if your outgoing mail needs to\ndnl # be sent out through an external mail server:\ndnl #\ndnl define(`SMART_HOST', `smtp.your.provider')dnl\ndnl #\ndefine(`confDEF_USER_ID', ``8:12'')dnl\ndnl define(`confAUTO_REBUILD')dnl\ndefine(`confTO_CONNECT', `1m')dnl\ndefine(`confTRY_NULL_MX_LIST', `True')dnl\ndefine(`confDONT_PROBE_INTERFACES', `True')dnl\ndefine(`PROCMAIL_MAILER_PATH', `\/usr\/bin\/procmail')dnl\ndefine(`ALIAS_FILE', `\/etc\/aliases')dnl\ndefine(`STATUS_FILE', `\/var\/log\/mail\/statistics')dnl\ndefine(`UUCP_MAILER_MAX', `2000000')dnl\ndefine(`confUSERDB_SPEC', `\/etc\/mail\/userdb.db')dnl\ndefine(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl\ndefine(`confAUTH_OPTIONS', `A')dnl\ndefine(`confDOMAIN_NAME', `mail.hogehoge.jp')dnl\n\ndnl #\ndnl # The following allows relaying if the user authenticates, and disallows\ndnl # plaintext authentication (PLAIN\/LOGIN) on non-TLS links\ndnl #\ndnl define(`confAUTH_OPTIONS', `A p')dnl\ndnl #\ndnl # PLAIN is the preferred plaintext authentication method and used by\ndnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do\ndnl # use LOGIN. Other mechanisms should be used if the connection is not\ndnl # guaranteed secure.\ndnl # Please remember that saslauthd needs to be running for AUTH.\ndnl #\nTRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl\ndefine(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl\ndnl #\ndnl # Rudimentary information on creating certificates for sendmail TLS:\ndnl #     cd \/etc\/pki\/tls\/certs; make sendmail.pem\ndnl # Complete usage:\ndnl #     make -C \/etc\/pki\/tls\/certs usage\ndnl #\ndefine(`confCACERT_PATH', `\/etc\/pki\/CA')dnl\ndefine(`confCACERT', `\/etc\/pki\/CA\/cacert.pem')dnl\ndefine(`confSERVER_CERT', `\/etc\/pki\/dovecot\/certs\/dovecot.pem')dnl\ndefine(`confSERVER_KEY', `\/etc\/pki\/dovecot\/private\/dovecot.pem')dnl\ndnl #\ndnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's\ndnl # slapd, which requires the file to be readble by group ldap\ndnl #\ndnl define(`confDONT_BLAME_SENDMAIL', `groupreadablekeyfile')dnl\ndnl #\ndnl define(`confTO_QUEUEWARN', `4h')dnl\ndnl define(`confTO_QUEUERETURN', `5d')dnl\ndnl define(`confQUEUE_LA', `12')dnl\ndnl define(`confREFUSE_LA', `18')dnl\ndefine(`confTO_IDENT', `0')dnl\ndnl FEATURE(delay_checks)dnl\nFEATURE(`no_default_msa', `dnl')dnl\nFEATURE(`smrsh', `\/usr\/sbin\/smrsh')dnl\nFEATURE(`mailertable', `hash -o \/etc\/mail\/mailertable.db')dnl\nFEATURE(`virtusertable', `hash -o \/etc\/mail\/virtusertable.db')dnl\nFEATURE(redirect)dnl\nFEATURE(always_add_domain)dnl\nFEATURE(use_cw_file)dnl\nFEATURE(use_ct_file)dnl\ndnl #\ndnl # The following limits the number of processes sendmail can fork to accept\ndnl # incoming messages or process its message queues to 20.) sendmail refuses\ndnl # to accept connections once it has reached its quota of child processes.\ndnl #\ndnl define(`confMAX_DAEMON_CHILDREN', `20')dnl\ndnl #\ndnl # Limits the number of new connections per second. This caps the overhead\ndnl # incurred due to forking new sendmail processes. May be useful against\ndnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address\ndnl # limit would be useful but is not available as an option at this writing.)\ndnl #\ndnl define(`confCONNECTION_RATE_THROTTLE', `3')dnl\ndnl #\ndnl # The -t option will retry delivery if e.g. the user runs over his quota.\ndnl #\nFEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl\nFEATURE(`access_db', `hash -T -o \/etc\/mail\/access.db')dnl\nFEATURE(`blacklist_recipients')dnl\nEXPOSED_USER(`root')dnl\ndnl #\ndnl # For using Cyrus-IMAPd as POP3\/IMAP server through LMTP delivery uncomment\ndnl # the following 2 definitions and activate below in the MAILER section the\ndnl # cyrusv2 mailer.\ndnl #\ndnl define(`confLOCAL_MAILER', `cyrusv2')dnl\ndnl define(`CYRUSV2_MAILER_ARGS', `FILE \/var\/lib\/imap\/socket\/lmtp')dnl\ndnl #\ndnl # The following causes sendmail to only listen on the IPv4 loopback address\ndnl # 127.0.0.1 and not on any other network devices. Remove the loopback\ndnl # address restriction to accept email from the internet or intranet.\ndnl #\nDAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl\ndnl #\ndnl # The following causes sendmail to additionally listen to port 587 for\ndnl # mail from MUAs that authenticate. Roaming users who can't reach their\ndnl # preferred sendmail daemon due to port 25 being blocked or redirected find\ndnl # this useful.\ndnl #\nDAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl\ndnl #\ndnl # The following causes sendmail to additionally listen to port 465, but\ndnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed\ndnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't\ndnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS\ndnl # and doesn't support the deprecated smtps; Evolution &lt;1.1.1 uses smtps\ndnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.\ndnl #\ndnl # For this to work your OpenSSL certificates must be configured.\ndnl #\nDAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl\ndnl #\ndnl # The following causes sendmail to additionally listen on the IPv6 loopback\ndnl # device. Remove the loopback address restriction listen to the network.\ndnl #\ndnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl\ndnl #\ndnl # enable both ipv6 and ipv4 in sendmail:\ndnl #\ndnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')\ndnl #\ndnl # We strongly recommend not accepting unresolvable domains if you want to\ndnl # protect yourself from spam. However, the laptop and users on computers\ndnl # that do not have 24x7 DNS do need this.\ndnl #\nFEATURE(`accept_unresolvable_domains')dnl\ndnl #\ndnl FEATURE(`relay_based_on_MX')dnl\ndnl #\ndnl # Also accept email sent to \"localhost.localdomain\" as local email.\ndnl #\ndnl LOCAL_DOMAIN(`localhost.localdomain')dnl\ndnl LOCAL_DOMAIN(`hogehoge.jp')dnl\ndnl #\ndnl # The following example makes mail from this host and any additional\ndnl # specified domains appear to be sent from mydomain.com\ndnl #\ndnl MASQUERADE_AS(`hogehoge.jp')dnl\ndnl #\ndnl # masquerade not just the headers, but the envelope as well\ndnl #\ndnl FEATURE(masquerade_envelope)dnl\ndnl #\ndnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well\ndnl #\nFEATURE(masquerade_entire_domain)dnl\ndnl FEATURE(`limited_masquerade')dnl\ndnl #\ndnl MASQUERADE_DOMAIN(localhost)dnl\ndnl MASQUERADE_DOMAIN(localhost.localdomain)dnl\ndnl MASQUERADE_DOMAIN(mydomainalias.com)dnl\ndnl MASQUERADE_DOMAIN(mydomain.lan)dnl\nMAILER(smtp)dnl\nMAILER(procmail)dnl\ndnl MAILER(cyrusv2)dnl\n\ndefine(`confSMTP_LOGIN_MSG',`unknown')dnl\ndefine(`confRECEIVED_HEADER',`$?sfrom $s $.$?_($?s$|from $.$_)\n      $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)\n      $.by $j (unknown)$?r with $r$. id $i$?{tls_version}\n      (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u\n      for $u; $|;\n      $.$b')dnl<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u30b5\u30fc\u30d0\u3092\u30de\u30eb\u30c1\u30c9\u30e1\u30a4\u30f3\u3067\u904b\u7528\u3057\u3001procmail \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306esendmail.mc\u3002 localhost.locahdomain \u304c\u3044\u305f\u308b\u6240\u306b\u51fa\u3066\u3001\u4e2d\u7d99\u6642\u306b\u4ed6\u306e\u30b5\u30fc\u30d0\u306breject\u3055\u308c\u3066\u3057\u307e\u3063\u3066\u3044\u305f\u3002 \u3042\u3068\u3001\/et [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-284","post","type-post","status-publish","format-standard","hentry","category-sendmail"],"_links":{"self":[{"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/posts\/284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tamura.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=284"}],"version-history":[{"count":0,"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/posts\/284\/revisions"}],"wp:attachment":[{"href":"https:\/\/tamura.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tamura.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tamura.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}