Add New Notes

This commit is contained in:
geekard
2012-08-08 14:26:04 +08:00
commit 5ef7c20052
2374 changed files with 276187 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,97 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-22T16:52:11+08:00
====== Gnus-Gmail ======
Created Sunday 22 May 2011
http://www.emacswiki.org/emacs/GnusGmail
===== Accessing Gmail via Imap =====
Firstly, dont forget to **enable IMAP** in your Gmail account (settings->forwarding POP/IMAP). Settings to tell gnus to use Gmails IMAP as a (secondary) select method are as follows:
__(add-to-list 'gnus-secondary-select-methods '(nnimap "gmail"__
__ (nnimap-address "imap.gmail.com")__
__ (nnimap-server-port 993)__
__ (nnimap-stream ssl)))__
with a line like the following one in your__ ~/.authinfo __
__machine imap.gmail.com login username@gmail.com password secret port 993__
如:
geekard imap.gmail.com login geekard@gmail.com password 701178zj12912 port 993
**PS:**上面只是配置了收邮件的功能下面配置利用gmail的smtp服务器发邮件或中转邮件。gnus的配置文件为: ~/.gnus
Also, if you want to take advantage of **using gmails SMTP server** (so gmail keeps track of your sent mail), you can use the following settings:
__(setq message-send-mail-function 'smtpmail-send-it__
__ smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))__
__ smtpmail-auth-credentials '(("smtp.gmail.com" 587 "username@gmail.com" nil))__
__ smtpmail-default-smtp-server "smtp.gmail.com"__
__ smtpmail-smtp-server "smtp.gmail.com"__
__ smtpmail-smtp-service 587__
__ smtpmail-local-domain "yourcompany.com")__
NOTE: You will need** starttls**, which is used to set up the SSL encrypted connection to the GMail server. This is contained in the “gnutls-bin” package on earlier versions of debian and ubuntu. With later versions (at least Ubuntu 9.10), starttls is in its own package, and the “gnutls-bin” package is not needed. If you dont have starttls installed, youll get a (rather generic) “smtpmail-send-it: Sending failed; SMTP protocol error” error message.
NOTE: (Pointed out by ChristofHarper) You can also store your password in the **smtpmail-auth-credentials** line, but this means that youve got to be more careful when sharing config files with other people.
NOTE: It seems that the above settings (which are what Google recommends) dont work for some people. Another possibility is to use port 25, and then use **~/.authinfo** to convert it back to 587, thus circumventing some code which was getting confused about SMTP through a non-25 port. To do this, replace all occurrences of 587 with 25 in the above snippet, and add the following line to your ~/.authinfo (see GnusAuthinfo and GnusEncryptedAuthInfo):
__machine smtp.gmail.com login username@gmail.com password secret port 587__
If you dont wish to store your password there, just omit the “password secret” altogether and youll be prompted when you send an email.
===== Accessing the [Gmail] folders =====
All Gmail system labels have a prefix [Gmail], it matches the default value of gnus-ignored-newsgroups, so we could set it to “^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\”]\”[#()]” to work around.
===== Accessing Gmail via POP =====
“Retrieving mail with POP3 is supported over SSL/TLS and with StartTLS.” (from GNUS-NEWS)
Put the following in your gnus-init-file is sufficient.
__(setq mail-sources__
__ '((pop :server "pop.gmail.com"__
__ :port 995__
__ :user "Leo@gmail.com"__
__ :password "wrongpw"__
__ :stream ssl)))__
I have tested this with No Gnus 0.6 (2006-10-19) and XftGnuEmacs (2006-10-04).
===== Accessing Gmail via an external mail retriever =====
Note that you can also get your mail from Gmail using **fetchmail** if thats installed on your home system. The following __.fetchmailrc__ works for me:
__ poll pop.gmail.com with proto POP3 and options no dns__
__ user 'USERNAME@gmail.com' there with password 'PASSWORD' is 'LOCALUSERNAME' here options ssl__
You can then set up a cron job to run fetchmail every few minutes:
__ */3 * * * * fetchmail -s >/dev/null 2>&1__
ALTERNATE: Instead of using cron, you could always add “__set daemon 300__” (without the quotes) to your .fetchmailrc to use its **built-in daemonic capabilities**. The “300” tells it to run every 300 **seconds **(five minutes). Change this number to suit your tastes.
and let gnus read your mail from wherever the usual location is on your system.
Another possibility: if you set up a Gmail filter by entering “in:inbox” in the “Has the words” field (you will get an error message but ignore it) you can have Gmail forward all your mail from your inbox (leaving spam behind) to some location where you can access it without changing your emacs or gnus installation.
Not even the above is necessary (as of 2006-12-02), gmail has now an option for forwarding the whole inbox to another address. dida
===== Storing sent mail in the server =====
By default, the mail you send from Gnus is not copied to the Gmail server, so if you open the folder “Sent mail”, you wont see it. You will only see mail sent from the web interface.
TODO: how to store sent mail in the server? (See below.)
A workaround can be **CCing yourself** whenever you send a mail. With this approach youll get a copy which is reflected on the server as well. Moreover, youll be the sender of these copies which makes it easy to define a view including only these messages. To use this solution, write this into your .gnus.el file:
__(setq gnus-posting-styles__
__ '((".*"__
__ ("CC" "username@gmail.com")__
__ (address "username@gmail.com"))))__
Actually, the problem seems to be solved if you send mail via gmails smtp server - at their “Recommended IMAP client settings” they say:
“Do NOT save sent messages on the server. If your client is sending mail through Gmails SMTP server, your sent messages will be automatically copied to the [Gmail]/Sent Mail folder.”

View File

@@ -0,0 +1,369 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-22T20:25:04+08:00
====== How email works (MTA, MDA, MUA) ======
Created Sunday 22 May 2011
http://en.kioskea.net/contents/courrier-electronique/fonctionnement-mta-mua.php3
What is email?
Electronic mail (also known as email or e-mail) is one of the most commonly used services on the Internet, allowing people to send messages to one or more recipients. Email was invented by Ray Tomlinson in 1972.
Why use email?
The operating principle behind email is relatively simple, which has quickly made it the most popular service used on the Internet.
As with a traditional postal service, for your message to reach your recipient, all you need to know is their address. Its two main advantages over "paper mail" are the speed at which the email is sent (practically instantaneous) and the lower cost (included with the cost of an Internet connection).
What's more, email can be used to instantaneously send a message to several people at once.
Email addresses
Email addresses (both for senders and recipients) are two strings separated by the character "@" (the "at sign"):
user@domain
The right-hand part describes the domain name involved, and the left-hand part refers to the user who belongs to that domain. One or more mail servers (MX records in the Domain Name System) correspond to each domain.
An email address can be up to 255 characters long and can include the following characters:
Lowercase letters from a to z;
Digits
The characters ".","_" and "-" (full stop, underscore, and hyphen)
In practice, an email address often looks something like this:
firstname.lastname@provider.domain
Email, as simple as it is to use, relies on a more complicated set of operating procedures than that of the Web. For most users, its operation is transparent, which means that it is not necessary to understand how email works in order to be able to use it.
However, the short introduction below has been provided to help users understand its basic principles, give them an idea of how to best configure their email clients and inform them about the underlying mechanisms of spam.
How email works
{{./courrier-electronique-images-schema-mua-mta-mda.png}}
Email is based around the use of electronic mailboxes. When an email is sent, the message is routed from server to server, all the way to the recipient's email server. More precisely, the message is sent to the mail server tasked with transporting emails (called the MTA, for Mail Transport Agent) to the recipient's MTA. On the Internet, MTAs communicate with one another using the protocol SMTP, and so are logically called SMTP servers (or sometimes outgoing mail servers).
The recipient's MTA then delivers the email to the incoming mail server (called the MDA, for Mail Delivery Agent), which stores the email as it waits for the user to accept it. There are two main protocols used for retrieving email on an MDA:
POP3 (Post Office Protocol), the older of the two, which is used for retrieving email and, in certain cases, leaving a copy of it on the server.
IMAP (Internet Message Access Protocol), which is used for coordinating the status of emails (read, deleted, moved) across multiple email clients. With IMAP, a copy of every message is saved on the server, so that this synchronisation task can be completed.
For this reason, incoming mail servers are called POP servers or IMAP servers, depending on which protocol is used.
Schematic diagram of MTA-MDA-MUA
To use a real-world analogy, MTAs act as the post office (the sorting area and mail carrier, which handle message transportation), while MDAs act as mailboxes, which store messages (as much as their volume will allow) until the recipients check the box. This means that it is not necessary for recipients to be connected in order for them to be sent email.
To keep everyone from checking other users' emails, MDA is protected by a user name called a login and by a password.
Retrieving mail is done using a software program called an MUA (Mail User Agent).
When the MUA is a program installed on the user's system, it is called an email client (such as Mozilla Thunderbird, Microsoft Outlook, Eudora Mail, Incredimail or Lotus Notes).
When it is a web interface used for interacting with the incoming mail server, it is called webmail.
Open relay
By default, and for historical reasons, it is not necessary to authenticate oneself to send email, which means that it is very easy to falsify one's own address when sending mail.
For this reason, nearly all Internet service providers lock down their SMTP servers to that only their subscribers can use them, or more precisely only machines whose IP address belongs to the ISP's domain. This explains why travelling users must modify the outgoing server settings in their email clients each time they move to a new home or business.
When an organisation's email server is improperly configured and allows third-party users on any network to send emails, this is called an open relay.
Open relays are generally used by spammers, as using them hides the true origins of their messages. As a result, many ISPs keep an up-to-date blacklist of open relays, to keep subscribers from receiving messages from such servers.
Using email
An email client, a software program for writing, checking and sending email, is generally made up of a number of windows. The main windows of this software are:
Incoming, In, Inbox: This represents the main mailbox for receiving email,
Sent, Outbox, Out: These are copies of messages that you have sent.
Deleted, Trash: The trash bin containing deleted emails. When emails are shown in the trash, you can still retrieve them. To permanently delete them, you will need empty the trash bin.
Folders: Most clients can be used to file emails in folders, much like folders on a hard drive.
Email fields
Here are the meanings of the fields to be filled in when you send an email:
From: this is your email address; most of the time you will not have to fill in this field, because it is generally set by the email client according to your preferences.
To: This field is used for the recipient's email address.
Subject: this is the title that your recipients will see when they want to read the email
Cc (carbon copy): this allows an email to be send to a large number of people by writing their respective addresses separated by commas
Bcc (blind carbon copy): This is a Cc, except that the recipient does not see the list of people in the Bcc field
Message: This is the body of your message
The Carbon Copy function sends a copy to people not directly involved with the message but whom you wish to keep up to date with the message contents or show that you sent the email to the recipient(s).
The Blind Carbon Copy function makes it possible to forward messages without any of the recipients or even the hidden recipients seeing that the message is being forwarded to them. It is generally recommended when sending an email to many people to forward it using Blind copy so as to prevent one of the recipients from replying to everyone or assembling a list of addresses.
Other email functions are:
Attached Files, Attachments: A file can be attached to an email by specifying its location on the hard drive.
Signature: If the email client allows it, you are often able to set a signature, meaning a few lines of text which will be added to the end of the document.
What to do with a message
There are many operations that can be performed on emails:
New, Compose, Write: Write a new message
Erase, Delete, Remove: Erase a message
Store, Save, Backup, Drafts: Copy a message into a safer place
Print: Print a message
Reply: Send a reply message to the sender (sometimes including their own message in the body of the document, with each line preceded by the symbol ">" and "Re:" followed by their chosen subject as the title, to show that it is a reply. The Reply All button makes it possible to send a reply to the sender as well as everyone else who had been put as a recipient or on copy.
Forward: Forwards the message to someone else, letting them know that the message comes from you. The subject is generally preceded by Fwd: to indicate that it is a forwarded message.
Redirect, Transmit: Forward a message to someone, letting them know where it originally came from. The subject is generally preceded by Fwd: to indicate that it is a forwarded message.
Netiquette
Netiquette (a contraction of the words "Net" and "etiquette") refers to the set of rules governing correct behaviour on the Internet, in order to respect others and be respected in turn.
They serve as guidelines for civility and proper conduct, so that all users can act in a like manner respectful of others.
When composing and sending a message
Indicate the subject of the message clearly in the "Subject" field. This is particularly critical for the recipient If the message's subject is explicit, it will make it much easier for the recipient, when looking at all the emails received, to tell which ones are most important and which less so. This will also allow the recipient to easily sort out their mail. You can make a distinction between a general subject, normally placed within brackets (such as for the name of a project) and a short summary of the message; for example:
[Project X] Meeting on 13 December
Only send email to people who are involved - It is ill-advised, and annoying for recipients, to send email to anyone you know. Recipients waste valuable time sorting out the messages which actually involve them from those which they have little or no interest in. What's more, this practice needlessly ties up network resources.
The "To:" field designates the primary recipient. This is the person to whom the email is addressed.
The "Cc:" field designates people who are being kept informed about this email communication.
The "Bcc:" field designates recipients whom the other recipients cannot see. It is recommended to not use this feature. Instead, it is advisable to separately forward them a copy of the preceding message.
Be brief and give ample context for the message. To be read and understood, it is preferable to use short, precise sentences. If the message is long, divide it into multiple paragraphs to make it easier to read. A precise, well-structured text helps prevent misunderstandings or misinterpretations. A message can be quickly and easily forwarded to other users. Use suitable language, and avoid misplaced humour, sarcasm, and insults. For the benefit of recipients in professional settings, it is helpful to begin a message with one of the following phrases:
For your information
For your approval
Follow-up
If documents must be attached to the message, take the recipients into consideration. The recipient of an attached file might not have the software to read it. Make sure that the file is saved in a format which most current software can read. (e.g. .rtf instead of .doc). Additionally, be aware of the attachment's size. The larger the size of the file, the longer it will take to send and receive. A hefty attachment might be blocked by the remote email server, or fill up the recipient's inbox, preventing other messages from being received. Use compression/decompression utilities (such as ZIP) to reduce the size of these files.
Before sending a message which is supposed to contain an attachment, make sure that the attachment is really there!
Avoid using uppercase letters. Text written in uppercase is difficult to read. What's more, using words in all capital letters on the Internet indicates that you are expressing strong emotions (such as joy or anger), which the recipient of your message might not take well. To emphasise a term, place it in quote marks instead.
Before sending a message, take the time to reread it. Try correcting typos or language errors. The style of the message reflects the sender's image.
Make sure you identify yourself, and leave contact information at the end of the message. Consider leaving your signature at the bottom of your emails, but without taking up too much space (four or five lines at the most), specifying, e.g. your occupation and the organisation you belong to. Telephone numbers may be useful if one of the recipients needs to contact you quickly. Custom dictates that the signature be preceded by a line containing nothing but two dashes ("--").
When receiving a message
When a message has been read, decide immediately where to file it. Email can be managed just like traditional mail. To find a message easily, make a habit of filing the messages you receive into folders by topic. This way, it will be easier to find an old message or discussion thread. Some email clients let you assign a colour to a message. It may be useful to set a colour code for identifying certain categories of messages.
Except where necessary, do not print out emails. When email is filed properly, it may be easily found if needed. For this reason, it is useless to print out every email. This prevents wasting paper, helping to preserve the environment.
Respect the private nature of the messages you receive. Never forward or copy to others an email personally addressed to you without the consent of the original sender.
On using emoticons (smileys)
Emoticons (sometimes called smileys) are symbols included in messages to indicate the mood of the person who wrote the message (humourous, sarcastic, ironic, etc.) Their use is normally reserved for non-professional messages.
To create an emoticon, simply use punctuation symbols. To see them more easily, tilt your head 90 degrees to the left.
Next »
Concept of mailing lists
A mailing list is one of the most commonly used services on the Internet, allowing people to send messages to one or more recipients. Email was invented by Ray Tomlinson in 1972.
Mailing list managers
A mailing list is based around software called a mailing list manager (or MLM for short).
This software distributes emails to all subscribers. It must properly handle bounced emails, as well as addresses which are not responding. If a user on the list has programmed an away message, the mailing list manager and that user's email client might send messages back and forth to one another, leading to an unending chain of emails.
An MLM also responds to commands found in the subject or body of the email. Here are a few example commands which most mailing list managers understand:
SUBSCRIBE: used for requesting a subscription to the list
UNSUBCRIBE: used for unsubscribing from the list
HELP: requests that the MLM list all commands available
Discussion list/Mailing list
The mailing list manager is generally administered by a list administrator whose job is to keep the lists in good working order and configure them as needed. Some lists may be moderated, meaning that every message shared must first be approved by a moderator to be transmitted to the list.
A list's administrator can decide if the subscribers may or may not respond to messages, if list membership is open to all. When the subscribers can reply to the list, it is called a "discussion list".
Structure of an email
An email has three basic parts:
The header, a set of lines containing information about the message's transportation, such as the sender's address, the recipient's address, or timestamps showing when the message was sent by intermediary servers to the transport agents (MTAs), which act as a mail sorting office. The header begins with a From line and is changed each time it passes through an intermediary server. Using headers, you can see the exact path taken by the email, and how long it took each server to process.
The message proper, made up of the two following elements:
the header fields, a set of lines describing the message's settings, such as the sender, the recipient, the date, etc. Each one has the following form:
Name: Value
An email includes at least the three following headers:
From: The sender's email address
To: The recipient's email address
Date: The date when the email was sent
It may contain the following optional fields:
Received: Various information about the intermediary servers and the date when the message was processed.
Reply-To: A reply address.
Subject: The message's subject
Message-ID: A unique identification for the message.
the message body, containing the message, separated from the header by a line break.
An email is made up of lines of displayable 7-bit US-ASCII characters. Each line has at most 76 characters, for compatibility reasons, and ends with the characters CRLF (\r\n).
Concept of a header
It is important to note that header data is no guarantee of when the message was sent or who sent it.
Additional personalised headers (called X-headers) can be set in order to provide the appropriate information. X-headers are so called because their name must begin with X-.
Some anti-spam software programs mark messages as unwanted using the following header:
X-Spam-Status: Yes
Introduction to MIME
MIME (Multipurpose Internet Mail Extensions) is a standard which was proposed by Bell Communications in 1991 in order to expand upon the limited capabilities of email, and in particular to allow documents (such as images, sound, and text) to be inserted in a message. It was originally defined by RFCs 1341 and 1342 in June 1992.
Using headers, MIME describes the type of message content and the encoding used.
MIME adds the following features to email service:
Be able to send multiple attachments with a single message;
Unlimited message length;
Use of character sets other than ASCII code;
Use of rich text (layouts, fonts, colours, etc)
Binary attachments (executables, images, audio or video files, etc.), which may be divided if needed.
MIME uses special header directives to describe the format used in a message body, so that the email client can interpret it correctly:
MIME-Version: This is the version of the MIME standard used in the message. Currently only version 1.0 exists.
Content-type: Describes the data's type and subtype. It can include a "charset" parameter, separated by a semi-colon, defining which character set to use.
Content-Transfer-Encoding: Defines the encoding used in the message body
Content-ID: Represents a unique identification for each message segment
Content-Description: Gives additional information about the message content.
Content-Disposition: Defines the attachment's settings, in particular the name associated with the file, using the attribute filename.
Primary MIME types
MIME types, used in the Content-Type header, are used to classify documents attached to an email. A MIME type is comprised as follows:
Content-type: main_mime_type/mime_subtype
A GIF image, for example, has the following MIME type:
Content-type: image/gif
The primary data types, sometimes called "discrete data types," are:
text: readable text data text/rfc822 [RFC822]; text/plain [RFC2646]; text/html [RFC2854] .
image: binary data representing digital images: image/jpeg; image/gif; image/png.
audio: digital sound data: audio/basic; audio/wav
video: video data: video/mpeg
application: Other binary data: application/octet-stream; application/pdf
MIME types are also used on the Web to classify documents transferred using the protocol HTTP. Thus during a transaction between a web server and a browser, the first thing the web server does is send the MIME type of the file to the browser, so that the browser knows how to display the document.
Encoding formats
To transfer binary data, MIME offers five encoding formats which can be used in the header transfer-encoding:
7bit: 7-bit text format (for messages without accented characters);
8bit: 8-bit text format;
quoted-printable: Quoted-Printable format, recommended for messages which use a 7-bit alphabet (such as when there are accent marks);
base64: Base 64, recommended for sending binary files as attachments;
binary: binary format; not recommended.
Since MIME is very open, it can use third-party encoding formats such as:
BinHex (a proprietary format belonging to Apple),
uuencode,
xxencode
Header encoding
The transfer-encoding header is used to specify an encoding format for the message body, but it doesn't solve the problem of encoding headers themselves (such as the message subject).
To encode headers with character sets which use more than 7 bits, such as for including accented letters in an email's subject, the MIME standard offers the following format:
=?charset?encoding?result?=
charset represents the character set used,
encoding defines the encoding desired with two possible values:
Q for quoted-printable
B for base64
result: text encoded using the method specified.
Below is an example of Quoted-Printable encoding with "Building façade" as the email's subject.
Subject: Building fa=?ISO-8859-1?Q?=E7ade?=
Composite messages
With the MIME type "multipart", the MIME standard allows for composite messages, meaning messages which include multiple attachments, which may even be nested.
To do so, MIME allows for a standard called boundary. This is an arbitrary string defined as an attribute in the Content-type header:
Content-Type: multipart/mixed;
boundary="------------020005090303070203010601"
Each separator delimits a portion of content beginning with the headers Content-Type and Content-Encoding. It is essential that the value of this separator is not found within the message contents.
There are several types of separators:
multipart/mixed defines a series of multiple elements
multipart/alternative defines alternatives for the same information, such as a message in either text and HTML format. If the email client is able to display messages with a layout and configured to do so, it will show the HTML version; otherwise, it will display the test version.
multipart/parallel defines data present at the same time (such as sound and image).
multipart/signed defines a digital signature for message data
multipart/related defines related pieces of information
List of MIME types
MIME types are standardised by a group called the IANA (Internet Assigned Numbers Authority). Here is a non-exhaustive list of the most common MIME types.
MIME Type Type of file Associated extension
application/atom+xml Files in ATOM format atom
application/iges CAS files iges
application/javascript JavaScript files js
application/dxf AutoCAD files dxf
application/mp4 MPEG4 files mp4
application/iges IGES CAD exchange format igs,iges
application/octet-stream Non-interpreted binary files bin
application/msword Microsoft Word document files doc
application/pdf Adobe Acrobat files pdf
application/postscript PostScript files ai,eps,ps
application/rtf Rich text format rtf
application/sgml SGML files sgml
application/vnd.ms-excel Microsoft Excel spreadsheet files xls
application/vnd.ms-powerpoint Microsoft Powerpoint presentation files ppt
application/xml XML file xml
application/x-tar Compressed tar files tar
application/zip Compressed ZIP files man
audio/basic Basic audio files au,snd
audio/mpeg MPEG audio files mpg,mp3
audio/mp4 MPEG-4 audio files mp4
audio/x-aiff AIFF audio files aif,aiff,aifc
audio/x-wav Wave audio files wav
image/gif Gif images man
image/jpeg Jpeg images jpg,jpeg,jpe
image/png Images PNG png
image/tiff Tiff images tiff,tif
image/x-portable-bitmap PBM Bitmap files pbm
image/x-portable-graymap PBM Graymap files pgm
image/x-portable-pixmap PBM Pixmap files ppm
multipart/x-zip Zip archive files zip
multipart/x-gzip GNU zip archive files gz,gzip
text/css Style sheet css
text/csv Comma-separated text files csv
text/html HTML files htm,html
text/plain Unformatted text files txt,g,h,c,cc,hh,m,f90
text/richtext Rich text files rtx
text/rtf Rich Text Format text files rtf
text/tab-separated-value Tab-separated text files tsv
text/xml XML files xml
video/h264 H.264 videos h264
video/dv DV videos dv
video/mpeg MPEG videos mpeg,mpg,mpe
video/quicktime QuickTime videos qt,mov
video/msvideo Microsoft Windows videos avi
More Information
Official list of MIME types (IANA - )
Main RFCs:
RFC 2045: MIME Part One: Format of Internet Message Bodies
RFC 2046: MIME Part Two: Media Types
RFC 2047: MIME Part Three: Message Header Extensions for Non-ASCII Text
RFC 2048: MIME Part Four: Registration Procedures
RFC 2049: MIME Part Five: Conformance Criteria and Examples
Secondary RFCs:
RFC 1524: The formal description of mailcap files. Mailcap files describe how to handle media types.
RFC 2015: MIME Security with Pretty Good Privacy (PGP).
RFC 2110: MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML).
RFC 2111: Content-ID and Message-ID Uniform Resource Locators.
RFC 2112: The MIME Multipart/Related Content-type.
RFC 2183: Defines the syntax and sematics of the "Content-Disposition" header to convey presentational information.
RFC 2184: MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations
Next »

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,104 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-22T18:01:51+08:00
====== all ======
Created Sunday 22 May 2011
http://www.opensubscriber.com/message/help-gnu-emacs@gnu.org/4314598.html
I use fetchmail. It fetches mail in the background, so gnus start is
faster :)
this is my ~/.fetchmailrc
----
set daemon 300
set no syslog
set logfile /home/ME/.fetchmail.log
defaults
protocol pop3
port 995
no rewrite # do not write additionnal
headers
mda "/usr/bin/procmail -d %s"
poll pop.gmail.com
user "EXAMPLE@gmai..." pass "SOMEPASSWORD"
flush
options ssl sslcertck
sslcertpath "/etc/ssl/certs"
----
for the ssl stuff you may need to install the said ssl certificates.
You then need to use procmail to sort your mail. The following few
lines will suffice in your ~/.procmailrc
----
VERBOSE=off
PATH=$HOME/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:.
MAILDIR=$HOME/mail
DEFAULT=$MAILDIR/inbox
LOGFILE=$MAILDIR/log
# add a header with number of lines in the email
:0bw
LINES=|wc -l | tr -d " "
:0fhw
|formail -a "Lines: $LINES"
# put all email in the gnus file
:0
inbox
----
This will store all your mail in ~/mail/inbox
Then in your ~/.emacsrc you can put the following
----
(setq
user-full-name "YOUR NAME"
user-mail-address "EXAMPLE@gmai..."
nnmail-spool-file "~/mail/inbox"
display-time-mail-file "~/mail/inbox")
(setq gnus-select-method
'(nnml ""
(nnml-directory "~/Gnus/mail/")
(nnml-active-file "~/Gnus/mail/active")))
----
(I'm not sure you need these last two lines if you are fine with the
default directories)
Finally for smtp you can use (for example) msmtp, with the following in
~/.emacs
----
(setq sendmail-program "/usr/bin/msmtp")
----
and the following in ~/.msmtprc
----
defaults
logfile ~/.msmtp.log
# gmail account
account gmail
host smtp.gmail.com
port 587
auth on
tls on
user EXAMPLE@gmai...
password SOMEPASSWORD
# set default account
account default : gmail
----
Then start fetchmail with the command "fetchmail", and it should be
working.
Evan

View File

@@ -0,0 +1,187 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-22T20:29:36+08:00
====== esmtp ======
Created Sunday 22 May 2011
===== Introduction =====
esmtp is a user configurable **relay-only Mail Transfer Agent (MTA)** with a sendmail compatible syntax. It's based on libESMTP supporting the **AUTH** (including the CRAM-MD5 and NTLM SASL mechanisms) and the **StartTLS** SMTP extensions.
===== Configuration =====
This is a simple configuration file for a quick start:
__hostname = mail.myisp.com:25__
__username = "myself"__
__password = "secret"__
__starttls = enabled__
__mda "/usr/bin/procmail -d %T"__
If you have more than one SMTP account you have them automatically chosen for you:
identity myself@myisp.com
hostname mail.myisp.com:25
username "myself"
password "secret"
__starttls enabled__
__default__
identity myself@anotherisp.com
hostname smtp.anotherisp.com:25
username "myself"
password "secret"
mda "/usr/bin/procmail -d %T"
===== Configuration options =====
See the esmtprc man page for more detailed information on the configuration options.
===== Invocation =====
esmtp is command line compatible with sendmail.
See the esmtp man page for information on how to invoke it.
===== Interfacing to Mail User Agents =====
Most Mail User Agents (MUAs) will work without need to configuration provided that you install a** symbolic from /usr/sbin/sendmail to the esmtp executable**. This should already be taken care of by the install target of the makefile when building from source.
If by any reason it is not possible to have (such as no administrator privileges or the use of another MTA for local delivery) then you will have to **reconfigure your MUA **to use the esmtp executable instead.
===== Mutt =====
If not using a symbolic link to the esmtp executable you can make Mutt use esmtp by adding the following line to your __~/.muttrc__:
__set sendmail="/path/to/esmtp"__
Esmtp supports sendmail envelope sender__ -f __flag, and you are advised to always enable it by adding the following line to Mutt configuration file:
__set use_envelope_from=yes__
For debugging purposes you may prefer to put in your ~/.muttrc:
__set sendmail="/path/to/esmtp -v -X /tmp/esmtp.log"__
This will enable verbose output and logging of the traffic with the SMTP server.
===== Interfacing to Mail Delivery Agents =====
esmtp relies upon a **Mail Delivery Agent (MDA) for local mail delivery**, so you need one if you want to **avoid having another MTA for local delivery.**
Notice that at the moment esmtp does not honor mail aliases or .forward files.
To deliver to other users beside yourself, the MDA must be installed with **setuid** flag -- which is done by default in most Linux distributions.
==== Procmail ====
To use procmail with esmtp set the mda configuration value to:
__mda="/usr/bin/procmail -d %T"__
If the mail message doesn't have a Date: header, such as those generated by vixie-cron, neither esmtp or procmail will add one for you. A simple hack is to pipe the message through the __formail__ program (also part of the procmail distribution), such as:
__mda='/usr/bin/formail -a "Date: `date -R`" | /usr/bin/procmail -d %T'__
Or, alternatively, add the following rule to your .procmailrc:
__:0fw__
__* ! ^Date:__
__| formail -a "Date: `date -R`"__
===== Interfacing with other mail applications =====
==== Fetchmail ====
By default fetchmail delivers messages via SMTP to port 25 on the machine it is running. Because **esmtp has no SMTP server** if you are not using another MTA for local delivery then you will need to** configure fetchmail to use esmtp executable**. This is accomplished by adding the following lines to the top of your ~/.fetchmailrc:
__defaults__
__ mda "/path/to/esmtp -f %F %T"__
Since esmtp simply **forwards the mail to another MDA **you can avoid this redundant step by simply replacing the value inside the quotes above by whichever value you use on your [[~/.esmtprc.]]
===== Interfacing with particular mail servers =====
==== Gmail ====
First edit your** ~/.esmtprc** according to http://mail.google.com/support/bin/answer.py?answer=13287. It should look like this:
__identity username@gmail.com__
__ hostname smtp.gmail.com:587__
__ username "username@gmail.com"__
__ password "password"__
__ starttls required__
Since Gmail requires the use of the **StartTLS** extension, you'll need to add the **Cert-Authority (CA) root certificate **which signed Gmail server certificate.
You can follow the instructions to use Mozilla's CA cert bundle, found elsewhere in this document.
===== Using the StartTLS extension =====
TLS support in __libESMTP__ although usable is not yet as robust and featureful as the rest of the library. At the moment to use the StartTLS extension you will need to:
* create a __~/.authenticate__ directory for the certificates. All files and directories in ~/.authenticate (including itself) must be user-readable only, i.e., they must have 0600 and 0700 permissions respectively.
* put the certificate of the trusted Cert-Authority that signed the server certificate into __~/.authenticate/ca.pem__.
* if a client certificate is required by the server then put it (including the private key) into ~/.authenticate/private/smtp-starttls.pem or ~/.authenticate/host.name/private/smtp-starttls.pem. If your client certificate has a passphrase then it should be specificied with the certificate_passphrase configuration.
* enable (or require) the StartTLS extension with the starttls configuration option. Note that the value of the hostname configuration option of the server you connect MUST match the name in the server certificate, since it will be used to verify the server identity.
In case of failure no error message will appear. Instead, libESMTP will terminate the SMTP connection right after issuing the STARTLS command.
For more information about TLS support in libEMSTP see the comments in smtp-tls.c in the libESMTP source distribution.
===== Using CA root certificates from mozilla.org =====
Mozilla.org's browsers already ship with a bundle of CA root certificates. For most cases this bundle should suffice. You can download the bundle a format suitable to esmtp from http://curl.haxx.se/docs/caextract.html, as
mkdir ~/.authenticate
chmod 0700 ~/.authenticate
wget http://curl.haxx.se/ca/cacert.pem
mv cacert.pem ~/.authenticate/ca.pem
chmod 0600 ~/.authenticate/ca.pem
===== Using CA root certificates from debian =====
If you use Debian, you can also use the CA root certificates included in the ca-certificates package:
mkdir ~/.authenticate
chmod 0700 ~/.authenticate
sudo apt-get install ca-certificates
cp -a /etc/ssl/certs/ ~/.authenticate/ca
chmod -R go-rwx ~/.authenticate/ca
===== Determining the Cert-Authority certificate =====
It may happen that the mail server certificate is signed by an unknown or custom root certificate. If you think that may be your case you can try to figure out which one is using openssl:
__openssl s_client -connect hostname:port__
Depending on the SMTP mail server, you might need to play with the port number or add '-starttls smtp' option.
Look for lines in the output which can provide clues for the certification authority such as:
issuer=/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com
Once you are in possession of the root certificate, you can check if it validates the server certificate by passing it on the -CAfile option. It is does then you'll get a line like:
Verify return code: 0 (ok)
See also http://curl.haxx.se/docs/sslcerts.html
===== Queueing support for dial-in users =====
To enable mail queueing support for esmtp, a wrapper script has been included with this distribution. It's goal is to be called instead of esmtp when a mail client requests sending of an email, and then periodically or on request to actually send pending emails. First choose a place to save the script. This path will be referenced by DIR in the following examples. Then you need to create symbolic links to it with special names at one of the directories in your $PATH environment variable, e.g. $HOME/bin:
cd $HOME/bin
ln -s <<DIR>>/esmtp-wrapper sendmail
ln -s <<DIR>>/esmtp-wrapper deliver
ln -s <<DIR>>/esmtp-wrapper mailq
When esmtp-wrapper is called either as sendmail or esmtp, it will first enqueue the mail by saving the mail itself and the given parameters (like, e.g. the envelope-from address) into a directory within the caller's $HOME/.esmtp_queue directory, and then try to directly deliver the queue in background. In difference to enqueueing, successful delivery is not treated as critical at this point and therefore won't disturb the mail client's workflow. To trigger delivery of all enqueued mails, execute esmtp-wrapper either as deliver, or as mailq using '-q' as first parameter. You can check whether there are enqueued mails either by simply issueing mailq or manually checking your $HOME/.esmtp_queue directory. Maybe the best way to trigger mail delivery is within some script which is called after the internet connection has been enabled. Alternatively I find the following crontab entry quite useful:
*/10 * * * * /bin/ping -c1 mail.example.com >/dev/null 2>&1 && $HOME/bin/deliver
it will check every 10 minutes whether the mailserver mail.example.com is reachable and on success deliver all mails in the queue. BEWARE: always make sure the script is called by the right user, as esmtp-wrapper depends on that.
Last modified on 2011-02-14.

View File

@@ -0,0 +1,126 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-22T21:53:02+08:00
====== fetchmail mutt msmtp ======
Created Sunday 22 May 2011
http://blogold.chinaunix.net/u1/37261/showart_481232.html
fetchmail、msmtp、mutt 整合使用
今天看了一下自己以前写的东西,发现对于这三样东西的描述过于分散,不好。所以现在把这三样东西放在一起,写个快速上手可操作的东西。其实也没什么,就是把要做的配置全放在一起,这样看着不累人。否则要看分别看三个文档才行。
首先mutt 是用来作为邮件管理器使用的,它不负责邮件的收和发,只负责管理。所谓的管理是指,邮件排序,写邮件,删除邮件等等操作。
具体的收件操作由 fetchmail 来做,而我会将它配置成一个周期性自动执行的任务,即写入 crontab 。
发件操作由 msmtp 来做,我也将它配置成了一个周期性执行的任务。这样我以后唯一要做的事情就是打开 mutt 看邮件,而收发之类的事,就与我无关了,呵呵。
首先看 fetchmail 配置,我是在 ~/.fetchmailrc 中配置的,如下。要注意的是,要用
chmod 600 ~/.fetchmailrc 来设置它的权限,因为在这个文件里,密码是明文形式。不要让其它人读到这个文件。我的本地用户名叫 nico ,你的可能不一定。
# ~/.fetchmailrc for user-specific
# This file MUST be chmod 0600, owner fetchmail
set postmaster 你的用户名 #设定当邮件在本地无匹配用户收取时,让此人来收
defaults
protocol pop3
mda "formail -s procmail"
antispam -1
ssl sslcertck
sslcertpath '/etc/ssl/certs/'
poll pop.gmail.com proto pop3
user '电子邮件地址' there with password '密码' is '对应的本地用户名' here fastuidl 1
现在配置 /etc/msmtprc由于我的系统里就我一个人所以我用了系统默认的 /etc/msmtprc 文件。
同样要注意这个文件的权限问题。配置的时候,需要有写入权(root)。一旦配置结束,可以将它设为只读。
如果你觉得这样还不好的话,就把内容放在 ~/.msmtprc 中,并对这个文件设置只读权。我用的是 gmail 帐户,你可能不用这个。请自行修改。
#Set default values for all following accounts
defaults
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/Mail/msmtplog #发件记录放在这个文件中
# Gmail service
account gmail #帐户名,主要是为了多帐户时区分不同帐户用的
host smtp.gmail.com
from 电子邮件地址
auth on
user 用户名
password 密码
# Set a default account
account default : gmail #多帐户时,用 gmail 作为默认帐户
为减少以后的一些劳动工作,我将 msmtp 和 fetchmail 放入了 cron 任务中,让它们自己运行。
用 crontab -e 进行编辑。以后 fetchmail 每15分钟收件一次msmtp 每5分钟发件一次。
# m h dom mon dow command
*/4 * * * * fetchmail
*/12 * * * * /home/nico/Mail/msmtp-runqueue.sh
设置时用到的 msmtp-enqueue.sh 和 msmtp-runqueue.sh 这两个文件来自
/usr/share/doc/msmtp/examples/msmtpqueue/
这个目录下。只是两个小脚本而已。请注意要放在对应目录下,并给它们加上对应的权限。由于我是把所有与邮件有关的内容都放在了 ~/Mail 目录下,所以在这两个文件中相应的地方也要做个小改动。在这两个文件的开头,把
原来的 QUEUEDIR="$HOME/.msmtpqueue"
改成 QUEUEDIR="$HOME/Mail/.msmtpqueue"
这样,以后所有待发邮件全放在了 ~/Mail/.msmtpqueue 目录下。
最后是 mutt 的配置。配置 mutt 的目的,只是为了个人喜好方便使用而已。由于我所用的系统是 debian在 /etc/Muttrc 中已经存在一个默认设定了。因此,在这里我只要设定一下自己喜欢用的操作方式就 OK 了。其实也可以不设,一切都用系统默认的也可以了。在 ~/.muttrc 中写上这些就可以了,这个文件的权限就无所谓了,因为没有任何密码之类的东西在里面。如果你在这个文件中写上了密码用户名之类的东西,那也请你注意权限问题。
subscribe debian-laptop@lists.debian.org
subscribe debian-science@lists.debian.org
subscribe debian-chinese-gb@lists.debian.org
subscribe i18n-zh@googlegroups.com #我订的一些邮件列表
alias i18n i18n-zh@googlegroups.com
alias benno coordinator@translationproject.org
alias gb-list debian-chinese-gb@lists.debian.org
alias laptop-list debian-laptop@lists.debian.org
alias sci-list debian-science@lists.debian.org
#一些联系人的简写,发件时可以少打点字 :-)
ignore *
unignore from: subject to cc date x-mailer x-url mail-followup-to
# 对于邮件头,我只要 from subject to cc date 等几项,其它隐藏。
# 颜色模板,个人喜好而已。在 /usr/share/doc/mutt/ 下有好几个模板用的,网上也能找到
color normal white black
color attachment brightyellow black
color hdrdefault cyan black
color indicator black cyan
color markers brightred black
color quoted green black
color signature cyan black
color status brightgreen blue
color tilde blue black
color tree red black
color header brightgreen black ^From:
color header brightcyan black ^To:
color header brightcyan black ^Reply-To:
color header brightcyan black ^Cc:
color header brightblue black ^Subject:
color body brightred black [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+
color body brightblue black (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+
# 这是我自己的设定 (nico)
set move=no #已读邮件还是放在 /var/mail/nico
#set mbox=~/Mail/seen #如果上面 move 设为yes则将已读邮件放在这里
set trash=~/Mail/trash #放已删除邮件
set record=~/Mail/sent #放已发邮件
set postponed=~/Mail/draft #放草稿
set postpone=yes #已编辑但最后关头取消的邮件直接放草稿
set abort_unmodified=no #邮件内容不改没关系照样能发送。申请ML时有用
set wait_key=yes
set pager_index_lines=4 #浏览邮件内容时上方只要看到4封邮件
set send_charset="us-ascii:iso-8859-1:utf-8" #一般发邮件时按这个顺序选编码
set editor="vim" #用这个编辑器来写邮件
auto_view text/html #自动看一些 html 格式的邮件,其实我最不喜欢这种格式
set include #回复时包括原文
set sendmail=/home/nico/Mail/msmtp-enqueue.sh #让msmtp 来发邮件
alternates 邮件地址1|邮件地址2|邮件地址3 # 跟下面的 reverse_name 配合用的
set use_from
set from="姓名<邮件地址>" #默认的 From 字段
set reverse_name=yes #哪个邮箱收的就以那个邮箱的名字填 From 字段
hdr_order date from subject to cc #邮件头的显示顺序
应该说muttrc 中的自定义设置内容很丰富。但一般使用只要以上这些就够了。如果还想更进一步的了解这些内容,可以 man muttrc。不过我说真的大部分内容根本用不上的。以上这些绝对够了。

View File

@@ -0,0 +1,44 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-22T18:33:51+08:00
====== google group的订阅方法 ======
Created Sunday 22 May 2011
http://www.mednoter.com/archives/120.html
===== 方法一 =====
Google提供了非常便捷的方法让你可以轻松的订阅group的发言。
==== 订阅邮件列表 ====
发送电子邮件至GROUPNAME+subscribe@googlegroups.com
例如我想订阅ssmu-postgraduat这个群我只需要发送一份邮件内容随便填写
到ssmu-postgraduat+subscribe@googlegroups.com即可订阅此讨论组。
退订邮件列表
发送电子邮件至GROUPNAME+unsubscribe@googlegroups.com
例如我想退订ssmu-postgraduat这个群我只需要发送一封邮件内容随便填写
到ssmu-postgraduat+unsubscribe@googlegroups.com即可退订此讨论组。
发表主题
发送电子邮件至GROUPNAME@googlegroups.com
例如如果想在群组里发表主题在邮件里编辑好主题内容邮件主题为正文的题目。发送邮件到ssmu-postgraduat@googlegroups.com既可。
如果想修改订阅方式可以自行想办法登录Google论坛后在设置中进行更改。
提醒:
热门的讨论组一天内会有几十封邮件,为了不至于收件箱爆炸,可以建立一个过滤器。
方法二
webGroup访问限制已做调整允许非Group成员通过Web方式浏览。

View File

@@ -0,0 +1,55 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-23T10:05:20+08:00
====== smtp认证 ======
Created Monday 23 May 2011
如果想避免垃圾邮件的骚扰您会选择什么方法呢您也许会说可以用过滤主题或邮件地址的方法来进行堵截可是如果垃圾邮件制造者更换了邮件地址与主题那么过滤功能就会对此束手无策起不到任何过滤的作用了。今天小编向您推荐一种通过SMTP认证功能来过滤垃圾邮件的方法它可以有效的解决您的烦恼。
  一、关于SMTP
  一般电子邮件系统支持两个传输协议:
  第一个叫做POP3Post Office Protocol 3POP3是关于接收电子邮件的协议它是一个客户/服务器协议,在其中电子邮件由服务器接收并保存,在一定时间之后,客户电子邮件接收程序检查邮箱并下传邮件。
  第二个协议就是SMTP就是Simple Mail Transfer Protocol即简单信件传输协议。它是发送电子邮件的通讯协议, 电子邮件程序也在使用者端使用SMTP来发送邮件给服务器。
  在邮件客户端软件中通常我们配置POP3时要求输入口令但SMTP却无此需要。这就表明我们无须拥有任何信箱就可以给他人发送信件。
  也许你会有疑问如果没有信箱那该如何在邮件客户端软件中进行配置呢很简单我们完全可以杜撰一个并不存在的信箱至于POP3与其口令么随便输入一个就可以了因为你根本不会执行收信操作也不指望能从这个杜撰的信箱中收到信件。而先前免费邮局的SMTP服务器地址又是公开的、无须认证的这就为垃圾邮件打开了方便之门。任何一个别有用心者只要填入任意一个免费电子邮局的STMP地址然后就可以借用任何人的名义甚至是你自己的名义向你恶意发送垃圾邮件了。这也就是很多朋友打开信箱赫然发现自己收到了“自己”发来的垃圾邮件的缘故。
  大量垃圾邮件令我们防不胜防,只有通过过滤主题或邮件地址的方法进行堵截。然而这种方法并不见得有效,因为垃圾邮件制造者只须更换一下邮件地址与主题,过滤功能对此束手无策,起不到任何过滤作用了。
  然而这只是一种被动的防御之法真正能够治本的方法就是认证SMTP服务器简单一点来说就是必须像POP3那样只有拥有了帐户名和密码之后才能发送电邮这样就会使得那些垃圾邮件制造者无机可乘。
  二、如何设置SMTP认证
  目前流行的邮件客户端程序有Foxmail、Outlook Express等等在此我们就两种主流程序讲解一下该如何设置SMTP认证。
  需要注意的是因各大免费电子邮局基本上都增加了SMTP认证功能所以如果不进行相关的设置你可以正常接收邮件但不能发送邮件
  某些客户端程序的先前版本不支持SMTP认证所以一定要下载程序的最新版本否则会因无法设置而造成无法发送邮件。
  1、Outlook Express
  1在Outlook Express 或通讯簿中,单击“工具”菜单,然后单击'帐号‘。
  2选定163.net帐号单击“属性”。
  3选中“服务器”菜单可以看到弹出框下部有“外发邮件服务器”选中“我的服务器要求身份验证”并单击旁边的“设置”。
  4登录信息选择“使用与接收邮件服务器相同的设置”。
  2、 FoxMail
  1在Foxmail中单击“帐户”菜单选择“属性”。
  2在弹出窗口“帐户属性”里选定“邮件服务器”。
  3然后在右边“SMTP服务需要身份验证”栏前的空格打勾。
  4再点击旁边的“设置”按钮在弹出窗口“SMTP服务器验证”里点选“使用与POP3服务相同的信息”。
  5按“确定”后您的设置修改便完成了。
  注意如果设置好后还无法发送请您先把你收发软件里的163帐号删除重新添加然后再加上SMTP设置。

View File

@@ -0,0 +1,16 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-23T13:23:22+08:00
====== softs ======
Created Monday 23 May 2011
What other properties are you looking for in your email server? For my domains(osdev.org [osdev.org] and variants) here's the combination I use:
**Courier IMAP** - Supports **Maildir**, works well with most IMAP webmail setups, easy to setup, support Secure IMAP
** Postfix **for SMTP - Can offload mail delivery to another program like Procmail, replaces Sendmail
**Procmail **for Delivery - The Great thing about IMAP is that you have message folders on the server, procmail will allow you to sort incoming mail as it arrives.
** Spamassassin** - Integrates with Procmail to sort spam into a folder or /dev/null
**SquirrelMail** - Seems to be one of the best web based IMAP clients around, done in PHP
The reasons I picked the above: Free, Wanted IMAP for server-side folders, needed Maildir support because I didn't want to use mbox because of performance and locking issues, and I needed webmail and an IMAP server known to work well with webmail.

View File

@@ -0,0 +1,54 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-23T09:55:16+08:00
====== telnet smtp ======
Created Monday 23 May 2011
Welcome to the Emacs shell
~ $ __telnet smtp.qq.com smtp__
Trying 222.202.96.96...
Connected to smtp.qq.com.
Escape character is '^]'.
220 esmtp4.qq.com Esmtp QQ Mail Server
__HELO smtp.qq.com __ //向SMTP server打招呼
HELO smtp.qq.com //回显
250 esmtp4.qq.com //更正提示
__AUTH LOGIN__ //用户登录请求认证方式为LOGIN
AUTH LOGIN
334 VXNlcm5hbWU6 //需要认证提示
__Z2Vla2FyZA== __ //base64加密的用户名
Z2Vla2FyZA==
334 UGFzc3dvcmQ6
__aG80bzQ0 __//base64加密的密码
aG80bzQ0
235 Authentication successful
__MAIL from: <geekard@gmail.com> __//发送者
MAIL from: <geekard@gmail.com>
501 mail from address must be same as authorization user //错误提示
__MAIL from: <geekard@qq.com>__ //必须和认证时提供的邮箱相同
MAIL from: <geekard@qq.com>
250 Ok
__RCPT TO: <geekard@gmail.com>__ //接收者
RCPT TO: <geekard@gmail.com>
250 Ok
__DATA __//写邮件内容(包括主题等)
DATA
354 End data with <CR><LF>.<CR><LF>
__Subject: test mail from telnet. __ //主题
Subject: test mail from telnet.
__CC: geekard@qq.com __//抄送
CC: geekard@qq.com
__test mail from telnet. __//邮件正文
test mail from telnet.
__.__ //单独点号结束正文
.
250 Ok: queued as
__quit__ //发送结束
quit
221 Bye
Connection closed by foreign host.
~ $
PSbase64在线生成小工具http://www.sharejs.com/tooldetails-162.aspx

View File

@@ -0,0 +1,543 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-23T11:27:30+08:00
====== 基础 ======
Created Monday 23 May 2011
http://www.mailer.com.cn/Tool/knowledge.htm
邮件系统基础知识库
IP地址?
IP地址是在网络上分配给每台计算机或网络设备的32位数字标识。在Internet上每台计算机或网络设备的IP地址是全世界唯一的。IP地址的格式是 xxx.xxx.xxx.xxx其中xxx是 0 到 255 之间的任意整数。例如科迈网站主机的IP地址是 210.22.12.54。
什么是固定IP地址?
固定IP地址是长期分配给一台计算机或网络设备使用的IP地址。一般来说采用专线上网的计算机才拥有固定的Internet IP地址。
什么是动态IP地址?
通过Modem、ISDN、ADSL、有线宽频、小区宽频等方式上网的计算机每次上网所分配到的IP地址都不相同这就是动态IP地址。因为IP地址资源很宝贵大部分用户都是通过动态IP地址上网的。
什么是内网、什么是公网、什么是NAT?
公网、内网是两种Internet的接入方式。
内网接入方式上网的计算机得到的IP地址是Inetnet上的保留地址保留地址有如下3种形式
10.x.x.x
172.16.x.x至172.31.x.x
192.168.x.x
内网的计算机以NAT网络地址转换协议通过一个公共的网关访问Internet。内网的计算机可向Internet上的其他计算机发送连接请求但Internet上其他的计算机无法向内网的计算机发送连接请求。
公网接入方式上网的计算机得到的IP地址是Inetnet上的非保留地址。公网的计算机和Internet上的其他计算机可随意互相访问。
NATNetwork Address Translator是网络地址转换它实现内网的IP地址与公网的地址之间的相互转换将大量的内网IP地址转换为一个或少量的公网IP地址减少对公网IP地址的占用。NAT的最典型应用是在一个局域网内只需要一台计算机连接上Internet就可以利用NAT共享Internet连接使局域网内其他计算机也可以上网。使用NAT协议局域网内的计算机可以访问Internet上的计算机但Internet上的计算机无法访问局域网内的计算机。
Windows操作系统的Internet连接共享、sygate、winroute、unix/linux的natd等软件都是使用NAT协议来共享Internet连接。
所有ISPInternet服务提供商提供的内网Internet接入方式几乎都是基于NAT协议的。
什么是域名? 域名由什么构成?
  域名是internet上用来寻找网站所用的名字是internet上的重要标识相当于主机的门牌号码。 每一台主机都对应一个IP地址每一个IP地址由一连串的数字组成如101.25.11.34。人们为了方便记忆就用 域名来代替这些数字来寻找主机如mydomain.com。每一个域名与IP地址是一一对应的人们输入域名再由域名服务器DNS解析成IP地址从而找到相应的网站。每一个网址和EMAIL都要用到域名。在英文国际域名中域名可以英文字母和阿拉伯数字以及横杠""组成最长可达67个字符包括后缀并且字母的大小写没有区别每个层次最长不能超过22个字母。在国内域名中三级域名长度不得超过20个字。
什么是DNS?
域名管理系统DNSDomain Name System是域名解析服务器的意思.它在互联网的作用是把域名转换成为网络可以识别的ip地址.比如我们上网时输入的www.163.com会自动转换成为202.108.42.72
什么是A记录?
A (Address) 记录是用来指定主机名或域名对应的IP地址记录。用户可以将该域名下的网站服务器指向到自己的web server上。同时也可以设置您域名的二级域名。
什么是NS记录?
NSName Server记录是域名服务器记录用来指定该域名由哪个DNS服务器来进行解析。
什么是别名记录(CNAME)?
也被称为规范名字。这种记录允许您将多个名字映射到同一台计算机。 通常用于同时提供WWW和MAIL服务的计算机。例如有一台计算机名为“host.mydomain.com”A记录。 它同时提供WWW和MAIL服务为了便于用户访问服务。可以为该计算机设置两个别名CNAMEWWW和MAIL。 这两个别名的全称就是“www.mydomain.com”和“mail.mydomain.com”。实际上他们都指向“host.mydomain.com”。
什么是泛域名解析?
泛域名解析定义为: 客户的域名a.com之下所设的*.a.com全部解析到同一个IP地址上去。 比如客户设b.a.com就会自已自动解析到与a.com同一个IP地址上去。
什么是MX记录?
MXMail Exchanger记录是邮件交换记录它指向一个邮件服务器用于电子邮件系统发邮件时根据 收信人的地址后缀来定位邮件服务器。例如当Internet上的某用户要发一封信给 user@mydomain.com 时该用户的邮件系统通过DNS查找mydomain.com这个域名的MX记录如果MX记录存在 用户计算机就将邮件发送到MX记录所指定的邮件服务器上。
万网 MX 记录设置 希网 3322.org 动态域名 MX 记录设置 花生壳动态域名设置
检查MX记录是否存在的方法
进行DNS查询的一个非常有用的工具是nslookup可以使用它来查询DNS中的各种数据。可以在Windows的命令行下直接运行nslookup进入一个交互模式在这里能查询各种类型的DNS数据。
DNS的名字解析数据可以有各种不同的类型有设置这个zone的参数的SOA类型数据有设置名字对应的IP地址的A类型数据有设置邮件交换的MX类型数据。这些不同类型的数据均可以通过nslookup的交互模式来查询在查询过程中可以使用 set type命令设置相应的查询类型。
如:
C:\>nslookup
Default Server: [202.106.184.166]
Address: 202.106.184.166
> set type=mx
> sina.com.cn
Default Server: [202.106.184.166]
Address: 202.106.184.166
Non-authoritative answer:
sina.com.cn MX preference = 10, mail exchanger = sinamx.sina.com.cn
sina.com.cn nameserver = ns1.sina.com.cn
sina.com.cn nameserver = ns3.sina.com.cn
sinamx.sina.com.cn internet address = 202.106.187.179
sinamx.sina.com.cn internet address = 202.106.182.230
ns1.sina.com.cn internet address = 202.106.184.166
ns3.sina.com.cn internet address = 202.108.44.55
如果所要查的某域名的MX记录不存在则出现与以下类似的提示
C:\>nslookup
> set type=mx
> amaxit.com.cn
Default Server: [202.106.184.166]
Address: 202.106.184.166
*** 202.106.184.166 can't find amaxit.com.cn: Non-existent domain
在邮件系统中使用自己的域名
假设你的邮件服务器地址是: 61.176.1.120
已经建了一条A记录: mail.mydomain.com A 61.176.1.120
对于MX记录已经存在的情况
如果MX记录已经存在并且已经检查出是在某一个域名服务器上您需要做的工作就是与您的域名服务商或该域名服务器的管理人员联系把该MX记录按如下的形式进行修改
您的域名    IN MX 10 mail.mydomain.com
对于MX记录还不存在的情况
要搞清楚您的域名确切的是在哪个域名服务器DNS中进行域名解析的有两种办法一种是查阅您注册该域名时提交的有关申请资料得到当时受理申请的单位与该受理申请的单位联系让对方的相关人员帮您查清楚另一种是在WinNTWin2000或各种Unix操作系统中通过使用nslookup得到。
找到您的域名服务器后请与您的域名服务商或该服务器的管理人员联系让对方为您增加一条MX记录该记录的形式如下
您的域名   IN MX 10 mail.mydomain.com
只有主机名能否建邮件系统?
完全可以。假设你的邮件服务器的主机名是 mail.mydomain.com就是说在internet上mail.mydomain.com解析到你的 邮件服务器IP地址。你可以在你的邮件系统中建立一个叫 mail.mydomain.com的域你的email格式为 user1@mail.mydomain.com, 其它邮件系统可以发信到你的服务器使用动态域名指向的也是一样。如果你有一个静态IP地址你甚至可以建一个一IP地址为结尾的邮件系统。 还有一种情况你的域名直接指向你的邮件服务器就是说在internet上mydomain.com解析到你的邮件服务器这时你建一个mydomain.com的域 你的email格式为 user1@mydomain.com
什么是动态域名
Internet上的域名解析一般是静态的即一个域名所对应的IP地址是静态的长期不变的。也就是说如果要在Internet上搭建一个网站需要有一个固定的IP地址。
动态域名的功能就是实现固定域名到动态IP地址之间的解析。用户每次上网得到新的IP地址之后安装在用户计算机里的动态域名软件就会把这个IP地址发送到动态域名解析服务器更新域名解析数据库。Internet上的其他人要访问这个域名的时候动态域名解析服务器会返回正确的IP地址给他。
因为绝大部分Internet用户上网的时候分配到的IP地址都是动态的用传统的静态域名解析方法用户想把自己上网的计算机做成一个有固定域名的网站是不可能的。而有了动态域名这个美梦就可以成真。用户可以申请一个域名利用动态域名解析服务把域名与自己上网的计算机绑定在一起这样就可以在家里或公司里搭建自己的网站非常方便。
私网ip网段
私有地址Private address属于非注册地址专门为组织机构内部使用。以下列出留用的三类内部寻址地址A类 10.0.0.0B类 172.16.0.0 —— 172.31.0.0C类 192.168.0.0 —— 192.168.255.0。
如何查看我的电脑的IP地址
Windows系统: 用鼠标选择“开始”->“程序”->“MS-DOS方式”打开一个DOS命令行窗口执行ipconfig
unix/linux: 在命令行下输入ifconfig
什么是子域名、二级域名?
子域名是个相对的概念,是相对父域名来说的。域名有很多级,中间用点分开。例如公司的顶级域名是以 com 结尾的,所有以 com 结尾的域名便都是它的子域。例如www.amaxit.net 便是 amaxit.net 的子域,而 amaxit.net 是 net 的子域。
RBL是什么?
RBL 全称是 Real-time Blackhole Lists, 是国外的反垃圾邮件组织提供的检查垃圾邮件发送者地址的服务, RBL 功能对中国用户而言,几乎不可用。 因为我们发现大部分中国的IP地址都在 RBL 数据库里。请不要启用RBL 功能。 常用的RBL服务器地址有: relays.ordb.org;dnsbl.njabl.org;bl.spamcop.net;sbl.spamhaus.org;dun.dnsrbl.net;dnsbl.sorbs.net 查询和删除RBL中的IP地址请到http://openrbl.org/ 和 http://ordb.org
电子邮件符号@的来历
@符号在英文中曾含有两种意思,即“在”或“单价”。它的前一种意思是因其发音类 似于英文at于是常被作为“在”的代名词来使用。如“明天早晨在学校等”的英文便条就 成了“wait you schoolmorning”。除了at外它又有each的含义所以“”也常常用 来表示商品的单价符号。
美国的一位电脑工程师汤林森确立了@在电子邮件中的地位,赋予符号“@”新意。为 了能让用户方便地在网络上收发电子邮件1971年就职于美国国防部发展军用网络阿帕网的 BBN电脑公司的汤林森奉命找一种电子信箱地址的表现格式。他选中了这个在人名中绝不会 出现的符号“@”并取其前一种含义,可以简洁明了地传达某人在某地的信息,“@”就这 样进入了电脑网络。
汤林森设计的电子邮件的表现格式为“人名代码+电脑主机或公司代码+电脑主机所属 机构的性质代码+两个字母表示的国际代码”。这就是现在我们所用电子邮件地址的格式, 其中用“@”符号把用户名和电脑地址分开,使电子邮件能通过网络准确无误地传送。
电信、网通主要DNS列表
省 主服务器 辅服务器
北京 2202.96.199.133 202.96.0.133 202.106.0.20 202.106.148.1 202.97.16.195
上海 202.96.199.132 202.96.199.133 202.96.209.5 202.96.209.133
天津 202.99.96.68 10.10.64.68
广东 202.96.128.143 202.96.128.68 202.96.128.110
深圳 202.96.134.133 202.96.154.8 202.96.154.15
河南 202.102.227.68 202.102.245.12 202.102.224.68
广西 202.96.128.68 202.103.224.68 202.103.225.68
福建 202.101.98.54 202.101.98.55
厦门 202.101.103.55 202.101.103.54
湖南 202.103.0.68 202.103.96.68 202.103.96.112
江苏 202.102.15.162 202.102.29.3 202.102.13.141 202.102.24.35
陕西 202.100.13.11 202.100.4.16
西安 202.100.4.15 202.100.0.68
湖北 202.103.0.68 202.103.0.117 202.103.24.68
山东 202.102.154.3 202.102.152.3 202.102.128.68 202.102.134.68
浙江 202.96.102.3 202.96.96.68 202.96.104.18
辽宁 202.98.0.68 202.96.75.68 202.96.75.64 202.96.69.38 202.96.86.18 202.96.86.24
安徽 202.102.192.68 202.102.199.68 10.89.64.5
重庆 61.128.128.68 10.150.0.1
黑龙江 202.97.229.133 202.97.224.68
河北 202.99.160.68 10.17.128.90
保定 202.99.160.68 202.99.166.4
吉林 202.98.5.68 202.98.14.18 202.98.14.19
江西 202.101.224.68 10.117.32.40 202.109.129.2 202.101.240.36
山西 202.99.192.68 202.99.198.6
新疆 61.128.97.74 61.128.97.73
贵州 202.98.192.68 10.157.2.15
云南 202.98.96.68 202.98.160.68
四川 202.98.96.68 61.139.2.69
重庆 61.128.128.68 61.128.192.4
成都 202.98.96.68 202.98.96.69
内蒙古 202.99.224.68 10.29.0.2
青海 202.100.128.68 10.184.0.1
海南 202.100.192.68 202.100.199.8
宁夏 202.100.0.68 202.100.96.68
甘肃 202.100.72.13 10.179.64.1
香港 205.252.144.228 208.151.69.65
澳门 202.175.3.8 202.175.3.3
常见的网络服务和对应端口
服务名称
端口号/协议 [别名]
#注释
ftp-data
20/tcp
#FTP, data
ftp
21/tcp
#FTP. control
telnet
23/tcp
smtp
25/tcp mail
#Simple Mail Transfer Protocol
time
37/tcp timserver
time
37/udp timserver
domain
53/tcp
#Domain Name Server
domain
53/udp
#Domain Name Server
tftp
69/udp
#Trivial File Transfer
gopher
70/tcp
http
80/tcp www www-http
#World Wide Web
pop3
110/tcp
#Post Office Protocol - Version 3
nntp
119/tcp usenet
#Network News Transfer Protocol
netbios-ns
137/tcp nbname
#NETBIOS Name Service
netbios-ns
137/udp nbname
#NETBIOS Name Service
netbios-dgm
138/udp nbdatagram
#NETBIOS Datagram Service
netbios-ssn
139/tcp nbsession
#NETBIOS Session Service
imap
143/tcp imap4
#Internet Message Access Protocol
snmp
161/udp
#SNMP
snmptrap
162/udp snmp-trap
#SNMP trap
irc
194/tcp
#Internet Relay Chat Protocol
ipx
213/udp
#IPX over IP
ldap
389/tcp
#Lightweight Directory Access Protocol
https
443/tcp MCom
https
443/udp MCom
uucp
540/tcp uucpd
ldaps
636/tcp sldap
#LDAP over TLS/SSL
doom
666/tcp
#Doom Id Software
doom
666/udp
#Doom Id Software
phone
1167/udp
#Conference calling
ms-sql-s
1433/tcp
#Microsoft-SQL-Server
ms-sql-s
1433/udp
#Microsoft-SQL-Server
ms-sql-m
1434/tcp
#Microsoft-SQL-Monitor
ms-sql-m
1434/udp
#Microsoft-SQL-Monitor
wins
1512/tcp
#Microsoft Windows Internet Name Service
wins
1512/udp
#Microsoft Windows Internet Name Service
l2tp
1701/udp
#Layer Two Tunneling Protocol
pptp
1723/tcp
#Point-to-point tunnelling protocol
radius
1812/udp
#RADIUS authentication protocol
radacct
1813/udp
#RADIUS accounting protocol
nfsd
2049/udp nfs
#NFS server
knetd
2053/tcp
#Kerberos de-multiplexor
admin
6000/tcp
#Winmail Server Admin
webmail
6080/tcp
#Winmail Server Webmail
man
9535/tcp
#Remote Man Server