# # E-Mail ±¸¼º # DESCRIPTION: 1.Introduction - ÀüÀÚ ¸ÞÀÏÀº º¸ÅëÀÇ ¿ìÆí¼­ºñ½º¸¦ Àü»ê¸Á »ó¿¡¼­ Àú·ÅÇÑ °¡°Ý¿¡ ¸î¹è ´õ ½Å¼ÓÇÏ°í Æí¸®ÇÏ°Ô »ç¿ëÇÒ ¼ö ÀÖ´Â ¼­ºñ½º ±â´ÉÀÌ´Ù. - Mail server´Â º¸Åë ±× networkÀÇ name server·Î µÇ¾î ÀÖ´Ù. Áï, mail relay host¸¦ ¶æÇÑ´Ù. mail relay host¸¦ Á¦¿ÜÇÑ hostµéÀº ÀϹÝÀûÀ¸·Î client·Î º¼¼öÀÖ´Ù. SETTING UP THE MAILHOST: 1.»ç¿ë º¯¼ö Dw : hostname°ú domainnameÀ» Á¤ÀÇ ÇÏ´Â ºÎºÐ ¿¹) Dwkjw.trigem.co.kr Cw : DwÀÇ alias À̸§ ¿¹) Cwlocalhost Dm : domain nameÀ» Á¤ÀÇ ÇÏ´Â ºÎºÐ ¿¹) Dmtrigem.co.kr DM : »ç¿ëÇÏ´Â Mailer¸¦ ÁöÁ¤ÇÏ´Â ºÎºÐÀ¸·Î º¸Åë "ether"¸¦ »ç¿ëÇÑ´Ù ¿¹) DMether DR : default mail gateway¸¦ ÁöÁ¤ÇÏ´Â ºÎºÐ mailÀ» ´©°¡ relay ÇØÁÙ °ÍÀÎÁö Á¤ÀÇÇØ ÁØ´Ù. ÀÌ host´Â /etc/hosts file¿¡ µî·ÏÀÌ µÇ¾î ÀÖ¾î¾ßÇÑ´Ù. ¿¹)DRmailhost [kjw:/]# grep mailhosts /etc/hosts 158.44.203.17 kjw mailhost Dj : hostname°ú domainnameÀ» ÁöÁ¤ ¿¹) Dj$w.$m 2.mail server setup * DNS or NISµîÀÇ domain Name service¸¦ ¹ÞÀ» ¼ö ÀÖ°Ô systemÀ» settingÇÑ´Ù. * cp /etc/mail/main.cf /etc/mail/sendmail.cf * °¢ system¿¡ ¸Â°Ô sendmail.cf fileÀ» ¼öÁ¤ÇÑ´Ù. ( sol1.x : /etc/sendmail.cf sol2.x : /etc/mail/sendmail.cf ) ex) sendmail.cf file ########################################################### # # SENDMAIL CONFIGURATION FILE FOR SUBSIDIARY MACHINES # # You should install this file as /etc/sendmail.cf # if your machine is a subsidiary machine (that is, some # other machine in your domain is the main mail-relaying # machine). Then edit the file to customize it for your # network configuration. # # @(#)subsidiary.mc 1.11 88/02/08 SMI; from UCB arpa.mc 3.25 2/24/83 # delete the following if you have no sendmailvars table Lmmaildomain # local UUCP connections -- not forwarded to mailhost CV Dmtrigem.co.kr Cmtrigem.co.kr # my official hostname Dj$w.$m # major relay mailer DMether # major relay host DRmailhost CRmailhost ................. 3.mail client setup 2) mail client setup * cp /etc/mail/subsidiary.cf /etc/mail/sendmail.cf * ps -ef | grep sendmail root 241 1 27 1¿ù 04 ? 0:00 /usr/lib/sendmail -bd -q1h * kill -9 241 * /usr/lib/sendmail -bd -q1h 4.daemon ±¸µ¿ 3) daemon ±¸µ¿ - sendmail daemonÀº /usr/lib/sendmail°ú /usr/lib/sendmail.mx µÎ °³ÀÇ fileÀÌ ÀÖ´Ù. sendmail.mx´Â mailÀ» º¸³¾¶§ MX record¸¦ ¸ÕÀú ÂüÁ¶ÇÑ´Ù. ¸¸¾à, MX record¸¦ ³Ö¾îÁÖ¾ú´Ù¸é sendmail.mx daemonÀ» ½á¾ßÇÑ´Ù. * mv /usr/lib/sendmail /usr/lib/sendmail.org * cp /usr/lib/sendmail.mx /usr/lib/sendmail * ps -ef | grep sendmail root 241 1 27 1¿ù 04 ? 0:00 /usr/lib/sendmail -bd -q1h * kill -9 241 * /usr/lib/sendmail -bd -q1h * /usr/lib/sendmail -bd -q1h -bd : background daemonÀ̶ó´Â °ÍÀ» ¸í½Ã -q1h : Queue interval ÁöÁ¤ mail Àü¼Û½Ã error°¡ ³ª¸é /usr/spool/mqueue µð·ºÅ丮¿¡ ½×ÀÌ°Ô µÇ´Âµ¥ ¿©±â¿¡ ½×ÀÎ ¸ÞÀÏÀ» Àç Àü¼ÛÇÏ´Â Áֱ⸦ Á¤ÇÏ´Â °ÍÀ¸·Î 1½Ã°£À̸é "q1h", 30ºÐÀ̸é "q30m" À̶ó°í ÁöÁ¤ÇÏ¸é µÈ´Ù. MAIL ALIAS FILE: 1.alias file 1) ~/.mailrc emailÀÇ ¼Û¼ö½Å ȯ°æÀº »ç¿ëÀÚ ½º½º·Î°¡ °³ÀΠȯ°æ¿¡ ¾Ë¸Â°Ô ¼³Á¤ÇØ ³õÀ» ¼ö ÀÖ´Ù. ÀÌ´Â ~/.mailrc fileÀ» ¸¸µé¾î ¿©·¯°¡Áö º¯¼ö°ªÀ» ÁöÁ¤ÇÔÀ¸·Î¼­ °¡´ÉÇØÁö´Âµ¥ ÀϹÝÀûÀÎ .mailrc sampleÀº ´ÙÀ½°ú °°´Ù. % vi ~/.mailrc set EDITOR=/usr/ucb/ex #Set default editor set PAGER="cat -s | more -22 -c" # To display a long message as continuation of a screenful messages set SHELL=/bin/csh #Set the command interpreter set VISUAL=/usr/ucb/vi #Set the screen editor set ask #Ask Subject: set askcc #Ask Cc: at the end of message set crt=24 #the number of lines for PAGER set dot #'.' alone on a line means terminate message input set folder=/usr1/cupid/Mail #directory to be used when '& s +file-id' or '& folders' set nohold #Save message into ~/mbox after read set ignoreeof #Don't terminate letter input with Ctrl+D set record=/usr1/cupid/outbox #Save all outgoing mail into ~/outbox set screen=12 #Size of window used when display headers, it can be forwarded and backwarded by '& z+' or '& z-' set toplines=10 #Number of lines of mailheader when do '& top' set verbose #Show me how this mail goes on the way to the destination 2) /etc/aliases ( Mailing list ) - º¹¼ö°èÁ¤ »ç¿ë½Ã ´ëÇ¥°èÁ¤¿¡¼­ mailÀ» ¼ö½ÅÇÏ´Â ¹æ¹ý kjw ȤÀº cupid·Î º¸³»±â¸¸ Çϸé ÇØ´ç °èÁ¤¿¡ mailÀÌ Àü´ÞµÈ´Ù. ####################### # Local aliases below # ####################### kjw:kjw@kjw,abc@ss10,test@core cupid:cupid@sonata,abc@zeus - /etc/aliases fileÀ» ¼öÁ¤ÇÏ°í³ª¸é Ç×»ó "newaliases" ¸í·ÉÀ» ½ÇÇàÇØ¾ß ÇÑ´Ù. * /usr/ucb/newaliases 3) ~/.forward kjw À̶ó´Â »ç¿ëÀÚ°¡ kjw@kjw.trigem.co.kr, kjw@test.hitel.co.kr, kjw@sam.kaist.ac.kr, kjw@cupid.hana.nm.kr ÀÇ email address¸¦ °¡Áö°íÀÖÀ»¶§ °¢ address·Î º¸³»Áø ¸ðµç mailÀ» ÇÑ °÷À¸·Î ¸ð¾Æ kjw@kjw.trigem.co.kr ¿¡¼­ ¹Þ¾Æº¸°íÀÚ ÇÒ¶§ kjw@kjw.trigem.co.kr ¸¦ Á¦¿ÜÇÑ ´Ù¸¥ system¿¡´Â '.forward' ¶ó´Â fileÀ» ÀÚ½ÅÀÇ È¨ µð·ºÅ丮¹Ø¿¡ ´ÙÀ½°ú°°ÀÌ ¸¸µé¾î ³õ´Â´Ù. * vi ~/.forward kjw@kjw.trigem.co.kr MAIL Àü¼Û ¹æ¹ý: 1.mail Àü¼Û - º¸Åë Unix ½Ã½ºÅÛ¿¡¼­ 'whereis mail' ¸í·ÉÀ¸·Î »ç¿ë°¡´ÉÇÑ mail ¸í·É¾î¸¦ »ìÆ캸¸é '/bin/mail' °ú '/usr/ucb/mail' À» ãÀ» ¼ö ÀÖ´Ù. '/bin/mail' µµ ¾µ ¼ö ÀÖÁö¸¸ Á»´õ Æí¸®ÇÑ »ç¿ë ȯ°æÀ» Á¦°øÇØ ÁÖ´Â °ÍÀÌ '/usr/ucb/mail' À̹ǷΠÀϹÝÀûÀ¸·Î ÀüÀÚ¿ìÆí ¸í·É¾î¸¦ ¸»ÇÒ¶§´Â '/usr/ucb/mail' À» ¶æÇÑ´Ù. µû¶ó¼­ 'mail' ¸í·É¾î¸¸À¸·Î '/usr/ucb/mail' À» ÁöĪÇϱâÀ§Çؼ­´Â ´ÙÀ½°ú °°ÀÌ ÀÚ½ÅÀÇ È¨µð·ºÅ丮¿¡ ÀÖ´Â .cshrc È­ÀÏ¿¡ alias ¸¦ ¼³Á¤ÇØ ³õÀ¸¸é ½Ã½ºÅÛ login½Ã ÀÚµ¿À¸·Î '/usr/ucb/mail' ÀÌ 'mail' ·Î ´ëÄ¡µÇ¹Ç·Î Æí¸®ÇÏ´Ù. 1) Àü¼Û ¹æ¹ý * mail [usernaqme]@[hostname.domainname] * mail cupid@kjw.trigem.co.kr 2.Àü¼Û test mail Àü¼ÛÈÄ Á¦ÀÏ ¸¶Áö¸·¿¡ "sent"¶ó°í ³ª¿À¸é Á¤»óÀûÀ¸·Î ¹è´ÞÀÌ µÈ°ÍÀÌ´Ù. ¿¹) kjw¶ó´Â »ç¿ëÀÚ°¡ zeus.trigem.co.krÀ̶ó´Â system¿¡ root@zeus.trigem.co.kr·Î mailÀ» º¸³»´Â °æ¿ì % /usr/ucb/mail -v root@zeus.trigem.co.kr Subject: test test mail . EOT % root@zeus.trigem.co.kr... Connecting to zeus.trigem.co.kr via ether... Trying 158.44.1.1... connected. 220 zeus.trigem.co.kr Sendmail 4.1/KUM-0.1 ready at Fri, 2 Apr 93 14:25:38 KST >>> HELO kjw.trigem.co.kr 250 zeus.trigem.co.kr Hello kjw.trigem.co.kr, pleased to meet you >>> MAIL From: 250 ... Sender ok >>> RCPT To: 250 ... Recipient ok >>> DATA 354 Enter mail, end with "." on a line by itself >>> . 250 Mail accepted >>> QUIT 221 zeus.trigem.co.kr delivering mail root@zeus.trigem.co.kr... Sent SENDMAIL BUG: 1.sendmail bug SunOS 4.1.x VersionÀº OS ¿¡ ÀÖ´Â sendmailÀº bug¸¦ °¡Áö°í ÀÖ´Ù. systemÀÌ »õ·Î bootingµÇ¸é¼­ ¶ß´Â sendmail daemonÀ¸·Î´Â ¿ÜºÎ¿¡¼­ mailÀ» º¸³¾¶§ "User Unknown"À̶ó´Â error message¸¦ »ý¼ºÇϸ鼭 mailÀ» º¸³½ »ç¶÷¿¡°Ô µÇµ¹¾Æ°¡´Â Çö»óÀÌ ¹ß»ýÇÑ´Ù. ÀÌ Çö»óÀ» ¸·±â À§Çؼ­´Â sendmail patch¸¦ ÇØ¾ß Çϴµ¥ SUN patch Áß "100377-08.tar" fileÀ» ÀÌ¿ëÇÏ¸é µÈ´Ù.