Mutt and Smtp Notes

1 Environment and resources

In order to achieve an email client, need to download the following four files:
1. mutt-1.5.22.tar.gz http://www.mutt.org/download.html
2. openssl-1.0.0d.tar.gz http://www.openssl.org/source/
3. msmtp-1.4.24.tar.bz2 http://sourceforge.net/projects/msmtp/files/msmtp
4. ncurses-5.7.tar.gz ftp://invisible-island.net/ncurses/

2 Software compilation

1. Openssl cross compile step
<1>. configuration and compiling command:
./config no-sse2 no-asm shared --prefix=/usr/local/arm_openssl
<2>. Create cross compiled target directory:
mkdir /usr/local/arm_openssl
<3>. Modify the generated Makefile in CC, AR, RANLIB
CC = arm-none-linux-gnueabi-gcc
AR = arm-none-linux-gnueabi-ar
RANLIB = arm-none-linux-gnueabi-ranlib
<4>. Compile and install
make
make install
2. Msmtp cross-compilation steps:
<1>. configuration and compiling command
./configure --host=arm-none-linux-gnueabi --with-ssl=no --with-libidn=no --with-gnome-keyring=no CC=arm-none-linux-gnueabi-gcc
<2>. Compile and install
make
make install
3. Libncurses cross-compilation steps:
<1>. configuration and compiling command
./configure --prefix=/usr/local/arm_ncurses CC=arm-none-linux-gnueabi-gcc --host= arm-none-linux-gnueabi
<2>. Create cross compiled target directory:
mkdir /usr/local/arm_ncurses
<3>. Compile and install
make
make install

Installed in/usr/local/arm_ncurses directory will be generated bin/,include/,lib/,man/,share/, 5 directory, The lib directory is generated by default static library.
4. Mutt cross-compilation steps:
<1>. Configuration compiled script (note that to open the mail mutt receiver function with parameter - you need to configure the enable - pop)
./configure --prefix=/usr/local/arm_mutt --host=arm-none-linux-gnueabi --with-curses=/usr/local/arm_ncurses --enable-pop CC= arm-none-linux-gnueabi –gcc
<2>. Create cross compiled target directory:
mkdir /usr/local/arm_mutt
Modify the Makefile ./doc/directory, CC CPP AR RANLIB STRIP is modified to the host machine of GCC, GCC - E, AR, RANLIB, STRIP (originally for arm-none-linux-gnueabi - gcc...).
Amend the host_alias = arm - Linux to host_alias =
<3>. Compile and install
make
make install

3. The configuration of software—msmtp

1. Download the/usr/local/arm_openssl/lib directory to the target board /mnt directory, execute the following command, export the openssl library paths:
export LD_LIBRARY_PATH=/mnt/arm_openssl/lib:$LD_LIBRARY_PATH
2. Download the/usr/local/bin/ msmtp to the target board /mnt directory.
./msmtp –version
Print:
msmtp version 1.4.24
Platform: arm-unknown-linux-gnu
TLS/SSL library: none
Authentication library: built-in
Supported authentication methods:
plain cram-md5 external login
IDN support: disabled
NLS: disabled
Keyring support: none
System configuration file name: /usr/local/etc/msmtprc
User configuration file name: /root/.msmtprc

Copyright (C) 2010 Martin Lambers and others.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

3. In the target board create the directory/usr/local/etc, create a file msmtprc , edit content:
mkdir -p /usr/local/etc
touch /usr/local/etc/msmtprc
chmod 600 msmtprc
vi /usr/local/etc/msmtprc

#account 163
host smtp.163.com

port 25
from ***@163.com
auth login
tls off
user ***@163.com
password *********(自己邮箱的密码)

logfile /var/log/msmtp.log

4. The configuration of software—mutt

1. Download /usr/local/arm_mutt/bin/mutt to the target board after the directory /bin, use the -v parameter to check the profile directory

# ./mutt –v
Print:
Mutt 1.5.21 (2010-09-15)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.18-7.1 (7405d0-smp)
ncurses: ncurses 5.6.20061217 (compiled with 5.6)
Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL -USE_SETGID -USE_DOTLOCK -DL_STANDALONE +USE_FCNTL -USE_FLOCK
+USE_POP -USE_IMAP -USE_SMTP
-USE_SSL_OPENSSL -USE_SSL_GNUTLS -USE_SASL -USE_GSS +HAVE_GETADDRINFO
+HAVE_REGCOMP +USE_GNU_REGEX
+HAVE_COLOR +HAVE_START_COLOR +HAVE_TYPEAHEAD +HAVE_BKGDSET
+HAVE_CURS_SET +HAVE_META +HAVE_RESIZETERM
+CRYPT_BACKEND_CLASSIC_PGP +CRYPT_BACKEND_CLASSIC_SMIME -CRYPT_BACKEND_GPGME
-EXACT_ADDRESS -SUN_ATTACHMENT
+ENABLE_NLS -LOCALES_HACK +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_YESEXPR
+HAVE_ICONV -ICONV_NONTRANS -HAVE_LIBIDN +HAVE_GETSID -USE_HCACHE
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/local/arm_mutt/share/mutt"
SYSCONFDIR="/usr/local/arm_mutt/etc"
EXECSHELL="/bin/sh"
-MIXMASTER
To contact the developers, please mail to <mutt-dev@mutt.org>.
To report a bug, please visit http://bugs.mutt.org/.

2. Create cross compiled target directory:
mkdir -p /usr/local/arm_mutt/etc
3. Copy the Muttrc in the host /usr/local/arm_mutt/etc/to the /usr/local/arm_mutt/etc /directory and modified:

set sendmail="/mnt/msmtp"
set use_from=yes
set realname="xiaomo_lzm@163.com"
set from=xiaomo@163.com
set editor="vi"

run ./mutt
you will see : If the error: Error opening terminal: vt102.
The solution:
1. mkdir -p /usr/share/terminfo/v
The following two lines can be written to the/etc/profile, you don't have to repeat every time input:
export TERM=vt102
export TERMINFO=/usr/share/terminfo
2. Copy vt102 file on the host machine
host machine

Copt the vt102 file to the target board/usr/share/terminfo/v directory.

The you can run mutt normally.

5. The use of the software

Use mutt sending mail :
mutt –s subject e-mail address -a Attachment is the path
as follows:
echo “this is the test mail” | mutt -s "mail test" 1061650997@qq.com -a msmtp

then you can received


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值