寻觅生命中的那一片浅草......

文章带标签 Mail

Send Mail with Gmail and sSMTP on CentOS 5

sSMTP is an extremely simple, resource conserving, smtp server that will allow your desktop or server to send email. in this article we are going to use sSMTP to send outgoing email through gmail.

1、Install sSMTP.
Unfortunately,ssmtp is not in CentOS 5 yum base repository,so we have to download and install it manually.

#wget ftp://ftp.muug.mb.ca/mirror/fedora/epel/5/x86_64/ssmtp-2.61-11.8.el5.x86_64.rpm
#rpm -Uvh ssmtp-2.61-11.8.el5.x86_64.rpm

2、configure sSMTP
First,backup and empty /etc/ssmtp/ssmtp.conf
#/bin/cp /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.OLD
#> /etc/ssmtp/ssmtp.conf
#vi /etc/ssmtp/ssmtp.conf
root=sender@gmail.com
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES
RewriteDomain=
Hostname=sender@gmail.com
AuthUser=sender@gmail.com
AuthPass=password
FromLineOverride=YES

add content above,save and quit.

Second,add each account that you want to be able to send mail from by editing, ‘/etc/ssmtp/revaliases’:

#echo ‘root:sender@gmail.com:smtp.gmail.com:587’ >> /etc/ssmtp/revaliases

Please replace sender and password with your Gmail accountname and password.

Third,backup old sendmail
#/bin/mv /usr/sbin/sendmail /usr/sbin/sendmail.OLD
#ln -s /usr/sbin/ssmtp /usr/sbin/sendmail

On my system,sendmail is provided by postfix.

3、Now try sending an email

You can send an email through your favorite email client, like ‘mail’, or type:

ssmtp someemail@email.com

You will then type your message, hit enter and ‘ctrl+d‘

Now that you have a simple outgoing email server setup, you can do all sorts of neat things:
Configure cron jobs to send log reports to your email address
Alert you of all kinds of system changes
Send email alerts when your computer reaches a certain temperature
Send email through PHP, Python, Ruby, and Perl

References:

http://topo.72pines.com/2009/02/18/linux-命令行下用-gmail-smtp-发信/
http://blog.rogerz.cn/archives/599
http://www.nixtutor.com/linux/send-mail-with-gmail-and-ssmtp/

CentOS5.2、5.3上安装ispCP OMEGA

IspCP Omega 简单介绍:
IspCP 是作为另一款开源虚拟主机管理系统VHCS2的替代产品,采用Apache2+PHP5(fastcgi模式,支持每个虚机独立的php.ini)+MySQL5(提供内置的phpmyadmin)提供 Web 服务(也支持传统的 CGI),FTP 采用 Proftpd(也支持 webftp 功能),邮件是 postfix+courier+squirrermail,和 IspCPH管理平台(PHP 代码,支持管理员、代理商、虚拟主机用户三级用户,相互之间可以自由切换,自由增加子域名、FTP、MySQL、Mail 账号),另外对于每个虚拟主机都有独立的每天完整备份机制(可以用 FTP 下载)。

系统:CentOS5.2,无桌面,安装开发工具,开发库

一、禁用SELinux
# vi /etc/selinux/config

SELINUX=enforcing
修改为
SELINUX=disabled

# vi /etc/sysconfig/network
将HOSTNAME修改为
HOSTNAME=test.test.com

iptables没必要禁了,ispCP安装好后,会生成防火墙规则,并启用iptables

重启系统
# init 6
阅读全文»

smtp、esmtp、pop3命令使用

SMTP命令:

HELO fqdn  识别发送SMTP主机
MAIL FROM:<sender>  识别邮件发件人
RCPT TO:<recipient> 识别邮件收信人信息
DATA    指示发送主机邮件数据发送已经准备好
RSET    中断当前邮件传输
VRFY string  允许发送主机在发送邮件前验证收件人的有效性
HELP    列出接收主机能支持的SMTP命令
QUIT    中断并关闭SMTP会话
TURN    触发收信服务器发送队列中的消息到发信服务器

阅读全文»

Linux提取特定字符

cat maildress | cut -d\< -f2| cut -d\> -f1 > test.txt
cat test1 | grep “@163.com” > test2

用excel的高级筛选功能可以删除重复的行

转载:smtp 认证过程(163.com)

220 163.com Anti-spam GT for Coremail System (163com[20050206])

ehlo www.163.com

250-mail

250-PIPELINING

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN PLAIN

250 8BITMIME

auth login

334 dXNlcm5hbWU6

c2hpeWF5b3U=   –此为用户名的base64编码,请用下面那个网址进行转换,注意有些smtp服务器的认证用户名是包含所在域,即形如user@example.com

334 UGFzc3dvcmQ6

**********     –此为密码的base64编码

235 Authentication successful

mail from: <shiyayou@163.com>

250 Mail OK

阅读全文»

2024年三月
« 5月    
 123
45678910
11121314151617
18192021222324
25262728293031