Mail services and mail commands in linux

47
Commands and Linux Mail in Services Group Topic : Group Number : H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux

description

It is about different commands and uses of Mail used in Linux

Transcript of Mail services and mail commands in linux

  • 1. H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux

2. H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux21HarshKhandelwal39KomalTiwari41Lopa Sejpal47NirajGurnani49Pankaj Lilan 3. Introduction and Basics of Mail in LinuxThe ProcedureWorking With mail in LinuxMailing Commands and DescriptionH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 4. ONE TWO THREE FOUR 3. WORKING WITH MAILS IN LINUX1. When an email is sent, the message is routed from serverto server, all the way to the recipients email server.2. The message is sent to the mail server tasked withtransporting emails (called the MTA, for Mail TransportAgent) to the recipients MTA.3. The recipients MTA then delivers the email to the incomingmail server (called the MDA, for Mail Delivery Agent),which stores the email as it waits for the user to accept it.4. Retrieving mail is done using a software program calledan MUA (Mail User Agent) 1. Introduction and Basics of Mail in Linux1. Linux is the first applications that UNIX users arefamiliar with.2. An email message never appears on your terminalthe moment it is received.3. Email is deposited in your mailbox even when youare not logged in. 2. The Procedure1. It helps to know that an Internet mail messageconsists of two parts; mail headers and a mailbody, separated by a blank line.2. The mail headers contain the source anddestination of the mail, a user-supplied subjectline, the date it was sent, and various other kindsof useful information. 4. MAILING COMMANDS AND DESCRIPTION1. mail - send and receive mail2. Task: Compose mail3. Use following format:mail -s SummaryH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 5. H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 6. H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 7. H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 8. ServicesRendered ByLinux MailH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 9. H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 10. Linux Mail v/s Internet MailMechanism used to move mail on theinternet is quiet complexTELNET and SSH work within a simpleclient-server frameworkInternet Mail Handlings requires thework of at least three agenciesLinux is flexible but windows is flexibleLinux has centralized applicationinstallation whereas the latter hasdecentralized oneH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 11. InternetMailHandlingsMUAMTAMDAH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 12. Stands for MAIL USER AGENT It is for reading the mailbox andsending mailMUA Stands for MAIL TRANSPORTAGENT It is for transporting mail betweenmachinesMTA Stands for MAIL DELIVERYAGENT It is for delivering mail to therecipients mailboxesMDAOverviewH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 13. H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 14. LINUXINTERNETSERVERSH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux Web - Apache HTTP Server, ApacheTomcat Databases - MySQL, PostgreSQL,Oracle Programming and scripting - PHP,Java, Perl, JavaScript, CSS, XHTML,Bash FTP - ProFTPD, Pure-FTPd, vsftpd SMTP (outgoing email) - exim,postfix, qmail, sendmail POP3 and IMAP (incoming email) -qpopper, UW IMAP, Courier-IMAP DNS (Domain Name System) -BIND, djbdns Web control panels - cPanel andWebHost Manager, Plesk,DirectAdmin, Webmin 15. LINUXINTERNALNETWORKSERVERS File server - Samba(SMB, CIFS), NFS, iSCSI LDAP (directory services) OpenLDAP DHCP - ISC DHCP Routing -Quagga, OSPF, RIP, VRRP, CARPH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 16. And its typesMailing ListH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 17. Mailing List A mailing list is a collection ofnames and addresses used byan individual or an organizationto send material to multiplerecipients. The term is oftenextendedto include the peoplesubscribed to such a list, so thegroup of subscribers is referredto as "the mailing list", or simply"the list".H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 18. One WayAnnouncementTwo WayDiscussionModeratedMailing List TypesH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 19. One-Way AnnouncementH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 20. The owner(s) and/or editor(s) of the list arethe only people who are allowed to sendmessages to the subscribers.From the list administrators to the listsubscribers, The communication flows inone direction.This type of list is primarily used fornewsletters, product announcements, anddissemination of information that does notrequire feedback from the subscriber.One-Way AnnouncementH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 21. Two Way DiscussionH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 22. The list administrators and the list subscribersare both permitted to post messages to the list.Between the administrators and thesubscribers, and back and forth betweendifferent subscribers, the communication flowstwo ways.This type of list is primarily used for discussiongroups engaged in the exchange of ideas andinformation centered on a specific topic.Two Way DiscussionH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 23. ModeratedH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 24. This type of discussion list has an editor oreditors who review all incoming messages.The editor can then decide to allow the messageto be sent to all the subscribers on the list, ornot allow the message to be posted to the list.Moderated lists can be used to control thediscussion by keeping off topic, inflammatory, orotherwise inappropriate messages from thereaching subscribers.ModeratedH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 25. In LinuxWorking of E-mailH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 26. Working of E-mail In Linux You will need to make sure that thesendmail, sendmail-cf and m4 software RPMs areinstalled. Incoming mail servers are called POPservers or IMAP servers, depending on whichprotocol is used. It is not necessary for recipients to be connected inorder for them to be sent email. To keep everyone from checking other usersemails, MDA is protected by a user name calleda login and by a passwordH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 27. Working of E-mail In Linux Email is based around the use of electronicmailboxes. When an email is sent, the message isrouted from server to server, all the way to therecipients email server. More precisely, the message is sent to the mailserver tasked with transporting emails called theMTA(Mail Transport Agent), to the recipientsMTA. On the Internet, MTAs communicate withone another using the protocol SMTP, and so arelogically called SMTP servers.H.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 28. Working of E-mail In Linux The recipients MTA then delivers the email tothe incoming mail server called MDA(MailDelivery Agent), which stores the email as itwaits for the user to accept it. There are two main protocols used forretrieving email on an MDA:i. POP3 (Post Office Protocol)ii. IMAP (Internet Message Access Protocol)H.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 29. MDA(Mail Delivery Agent)POP3(Post Office Protocol) POP3 is used for retrievingemail and, in certaincases, leaving a copy of it onthe server.IMAP(Internet Message Access Protocol) IMAP is used forcoordinating the status ofemails(read, deleted, moved)across multiple emailclients.H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 30. o MTAs act as the postoffice (the sorting areaand mail carrier, whichhandle messagetransportation)o MDAs act asmailboxes, which storemessages until therecipients check thebox. It is not necessaryfor recipients to beconnected in order forthem to be sent email.Working process of POP3 & IMAP Server :H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 31. And DescriptionsMailing CommandsH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 32. : mail - send and receive mail Task: Compose mail Use following format:mail -s For example write mail to [email protected]:$ mail - "Hello" [email protected] are then expected to type in your message, followed by an control-D at the beginning ofa line. To stop simply type dot (.): Output:Hi,This is a testmail [-iInv ] [-s subject ] [-c cc-addr ] [-b bcc-addr ] to-addr...mail [-iInNv -f ] [name ]mail [-iInNv [-u user ] ]H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 33. -sSpecify subject on command line (only the first argument after the -s flag isused as a subject; be careful to quote subjects containing spaces.) -cSend carbon copies to list of users. -bSend blind carbon copies to list List should be a comma-separated list ofnames. -fRead in the contents of your mbox (or the specified file) for processing; whenyou quitmail writes undeleted messages back to this file.H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 34. -vVerbose mode. The details of delivery are displayed on the users terminal. -iIgnore tty interrupt signals. This is particularly useful when using mail on noisy phonelines. -IForces mail to run in interactive mode even when input isnt a terminal. Inparticular, the `~special character when sending mail is only active in interactivemode. -nInhibits reading /etc/mail.rc upon startup. -NInhibits the initial display of message headers when reading mail or editing a mailfolder.H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 35. Mailing Commands and Descriptions Mail is an intelligent mail processing system, whichhas a command syntax reminiscent of ed1 with linesreplaced by messages.mail [-s subject ] [-c cc-addr ] [-b bcc-addr ] to-addr...mail [-f name ]mail [-u user ]H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 36. Mailing Commands and Descriptions -v :- Verbose mode. The details ofdelivery are displayed on the usersterminal. -I :- Ignore tty interrupt signals. This isparticularly useful when using mail onnoisy phone lines. -c :- Send carbon copies to list of users.H.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 37. Mailing Commands and Descriptions -b :- Send blind carbon copies to list List shouldbe a comma-separated list of names. -f :- Read in the contents of your mbox (or thespecified file) for processing; whenyou quitmail writes undeleted messages backto this file. -c :- Send carbon copies to list of users. -N :- Inhibits the initial display of messageheaders when reading mail or editing a mailfolder.H.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 38. Mailing Commands and Descriptions - :- Print out the preceding message. Ifgiven a numeric argument n goes tothe n th previous message and prints it. ? :- Prints a brief summary of commands. ! :- Executes the shell (see sh(1)and csh(1)) command which follows.H.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 39. Mailing Commands and Descriptions Print(P ) Like print but also prints out ignoredheader fields. See also print ignore and retain Reply(R ) Reply to originator. Does not reply to otherrecipients of the original message. Type(T ) Identical to the Print command.H.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 40. Mailing Commands and Descriptions edit(e ) Takes a list of messages and points thetext editor at each one in turn. On returnfrom the editor, the message is read backin. exit(ex) Effects an immediate return to theShell without modifying the users systemmailbox, his mbox file, or his edit file in -fH.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 41. Mailing Commands and Descriptions preserve(pre ) A synonym for hold print(p ) Takes a message list and types out eachmessage on the users terminal. type(t ) A synonym for printH.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 42. Mailing Commands and Descriptions copy(co ) The copy command does the same thingthat save does, except that it does not mark themessages it is used on for deletion when you quit. Delete(d ) Takes a list of messages as argument and marksthem all as deleted. Deleted messages will not besaved in mbox nor will they be available for mostother commands. exit(x ) A synonym for exitH.L. Institute of Computer ApplicationsContinueMail Services and Mail Commands in Linux 43. How to Retrieve an E-mail? Retrieving mail is done using a softwareprogram called an MUA (Mail User Agent). When the MUA is a program installed on theusers system, it is called an email client (suchas Mozilla Thunderbird, Microsoft Outlook). When it is a web interface used for interactingwith the incoming mail server, it iscalled webmailH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 44. SENDING MAIL FROM A SHELL SCRIPT Now, with the basics covered you can sendmails from your shell scripts. Heres a simpleshell script that gives you a reading of theusage of space on your partitions and mailsthe data to you.#!/bin/bashdf -h | mail -s disk space [email protected]. Institute of Computer Applications Mail Services and Mail Commands in Linux 45. Reading Mail In normal usage mail is given no arguments and checksyour mail out of the post office, then prints out a oneline header of each message found. The currentmessage is initially the first message (numbered 1) andcan be printed using the print command (which can beabbreviated `p) . You can move among the messagesmuch as you move between lines in ed1, with thecommands `+and `-moving backwards andforwards, and simple numbers.H.L. Institute of Computer Applications Mail Services and Mail Commands in Linux 46. Disposing of MailH.L. Institute of Computer Applications After examining a message you can delete `d)the message or reply `r) to it. Deletion causesthe mail program to forget about the message.This is not irreversible; the message canbe undeleted `u) by giving its number, orthe mail session can be aborted by givingtheexit `x) command. Deleted messages will,however, usually disappear never to be seenagain.Mail Services and Mail Commands in Linux 47. Any Questions ?????Thank - YouH.L. Institute of Computer Applications Mail Services and Mail Commands in Linux