小VPS能干什么?

作为一名网络/系统工程师,接触最多的就是console界面,tcpdump、nmap、iftop、pftop、systat等等工具都是在终端下才能来去自如,所以虽然现在的GUI是越来越华丽,但是仍然取代不了console,简捷是最大的优点。

  1. 美化使用环境:统一使用solarized作为主题,包括PuTTY、zsh、vim和mutt
  2. 搭建博客;
    2.1 octopress;
    2.2 wordpress;
  3. 使用vim+markdown+octopress记录文档;
  4. 使用mutt管理邮件列表;
  5. 安装VPN、radius,正常访问互联网;

  6. mutt

  7. getmail4
  8. procmail
  9. msmtp-mta

aptitude mutt getmail4 procmail msmtp-mta

Q1. 为什么用getmail而不用大名鼎鼎的fetchmail?

http://pyropus.ca/software/getmail/faq.html#faq-about-why

mutt

“All mail clients suck. This one just sucks less.” Michael Elkins, ca. 1995

mutt是一个高效、高度可配置的基于console的邮件用户代理(MUA)

debian中提供了mutt-patched这个包,包含了sidebar功能。

solarized

solarize是一个非常流行的配色,目前已移植到多个应用程序中。

putty

terminal emulator,这个是前提,tmux、vim、mutt都依赖于terminal emulator的底色,所以首先要搞定这个。

xterm-256color由ncurse-term提供,因此假如没有安装该软件包的化,就没有xterm-color256这个terminfo

vim without gui

set t_Co=16

mutt 配色

mutt-colors-solarized-256.muttrc
mutt-colors-solarized-16.muttrc

默认情况下,term的颜色仅支持8色,

# tput colors
8

需要安装ncurse-term这个软件包来解决

# aptitude install ncurse-term

然后重新登录

# tput colors
256

再执行mutt就不会出现

color not supported的错误了。

参考:

  1. Getting 256 color support working for mutt in xfce4-terminal
  2. http://www.robmeerman.co.uk/unix/256colours

mail storage
Maildir

The advantages of Maildir are that no locking is required, so multiple applications can work on the same mailfolder at the same time without messing up. Plus, having one file per message makes manipulating mail with scripts much simpler

The disadvantages are that some file-systems are very inefficient with both small-files and with thousands of files in one directory.

mbox

There are advantages and disadvantages with mbox format. It is slow when removing messages, as the whole thing has to be rewritten, and it can be a mess when several applications want to write to an mbox at the same time. Advantages are that the mbox format is universal and can be read by many other programs (even some in the Windows world).

IMAP
Use IMAP mail storage in these situations:

  • When you have a reliable network connection to your mailserver.
  • For accessing your mail from different locations.
  • When you need to be able to read your mail using different mail user agents.

建议用IMAP作为邮件存储方式,一来有gmail作为备份,二来还需依赖gmail做全文搜索、三呢是节省存储空间。
我想最终会选择IMAP,因为全文检索不是mutt的强项,还得依赖gmail。

mutt + gmail(imap) + msmtp

.muttrc

这个配置是没问题了,即便配置了缓存还是无法解决快速打开邮件的问题,唯一的问题是每次打开都要evaluate cache 27703多的邮件,也不是通过cache就可以迅速能够装载得了的,还是慢,所以就有了offlineimap这个工具。

mutt + gmail(imap) + msmtp + offlineimap

.muttrc

getmail

procmail

msmtp-mta

msmtp msa??

Tiny mail sending agents

If you think that installing a full-featured server-mta is overkill, there are some tiny alternatives that use less resources and that don't listen for incoming connections. Such as: the MasqMail msa, msmtp msa, esmtp msa, smtppush msa and nullmailer msa