资源简介
Apache中的一个邮件服务器
代码片段和文件信息
#!/usr/bin/python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License Version 2.0 (the
# “License“); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing
# software distributed under the License is distributed on an
# “AS IS“ BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------
#
# This is a simple mail client intended to suffice as the required
# “sendmail“ client on typical UNIX-style systems. It requires an
# SMTP SMTP server for handling the e-mail that users and system
# utilities may send via “sendmail“.
#
# To install symlink from /usr/{[s]binlib[exec]}/sendmail or similar
# for the particular deployment.
#
# --------------------------------------------------------------------------
import smtplib
import socket
import os
import sys
import getopt
def Usage():
print “sendmail [-f ][-F ][-t][-h]“
sys.exit(0)
def ProcessHeaders(headers to_addrs extract fullname from_addr):
hasFrom = False
for header in headers:
if header.startswith(“To:“):
if extract:
#to = header[3:]
#to_addrs.append(to[(“<“ + to).rfind(“<“):(to + “>“).find(“>“)])
allRecipientsString = header[3:]
allRecipientsArray = allRecipientsString.split(‘‘)
for recipient in allRecipientsArray:
to_addrs.append(recipient[(“<“ + recipient).rfind(“<“):(recipient + “>“).find(“>“)])
elif header.startswith(“From:“):
hasFrom = True
if hasFrom:
header = “Sender“
else:
header = “From“
if fullname:
headers.insert(0 “%s: %s <%s>“ % (headerfullname from_addr))
else:
headers.insert(0 “%s: %s“ % (header from_addr))
return headers to_addrs
def main(argv):
try:
optlist list = getopt.getopt(sys.argv[1:] ‘f:F:hti‘)
except getopt.GetoptError:
Usage()
print >> sys.stderr “called exception“
sys.exit(2)
to_addrs = list
try:
from_addr = os.environ[‘USER‘] + ‘@‘ + socket.getfqdn()
except KeyError:
from_addr = “nobody@“ + socket.getfqdn()
fullname = ““
extract = False
for opt value in optlist:
if opt == ‘-h‘:
Usage()
elif opt == ‘-t‘:
extract = Tru
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 27 2007-04-25 16:00 james-2.3.1\apps\dummy.txt
文件 4176598 2007-04-25 16:00 james-2.3.1\apps\james.sar
文件 140 2007-04-25 16:00 james-2.3.1\bin\derby.properties
文件 25274 2007-04-25 16:00 james-2.3.1\bin\lib\excalibur-cli-1.0.jar
文件 53985 2007-04-25 16:00 james-2.3.1\bin\lib\excalibur-extension-1.0a.jar
文件 118334 2007-04-25 16:00 james-2.3.1\bin\lib\excalibur-instrument-manager-1.0.jar
文件 41533 2007-04-25 16:00 james-2.3.1\bin\lib\excalibur-io-1.1.jar
文件 89145 2007-04-25 16:00 james-2.3.1\bin\lib\excalibur-logger-2.1.jar
文件 32412 2007-04-25 16:00 james-2.3.1\bin\lib\excalibur-monitor-2.1.jar
文件 65261 2007-04-25 16:00 james-2.3.1\bin\lib\jakarta-oro-2.0.8.jar
文件 343900 2007-04-25 16:00 james-2.3.1\bin\lib\mx4j-jmx.jar
文件 266911 2007-04-25 16:00 james-2.3.1\bin\lib\mx4j-tools.jar
文件 2559 2007-04-25 16:00 james-2.3.1\bin\lib\mx4j.LICENSE
文件 201996 2007-04-25 16:00 james-2.3.1\bin\lib\phoenix-engine.jar
文件 29032 2007-04-25 16:00 james-2.3.1\bin\lib\spice-classman-1.0.jar
文件 19255 2007-04-25 16:00 james-2.3.1\bin\lib\spice-loggerstore-0.5.jar
文件 23761 2007-04-25 16:00 james-2.3.1\bin\lib\spice-salt-0.8.jar
文件 20990 2007-04-25 16:00 james-2.3.1\bin\lib\spice-xm
文件 2590 2007-04-25 16:00 james-2.3.1\bin\lib\spice.LICENSE
文件 12599 2007-04-25 16:00 james-2.3.1\bin\phoenix-loader.jar
文件 6930 2007-04-25 16:00 james-2.3.1\bin\phoenix.sh
文件 2984 2007-04-25 16:00 james-2.3.1\bin\run.bat
文件 854 2007-04-25 16:00 james-2.3.1\bin\run.sh
文件 3878 2007-04-25 16:00 james-2.3.1\bin\sendmail.py
文件 69632 2007-04-25 16:00 james-2.3.1\bin\Wrapper.dll
文件 167936 2007-04-25 16:00 james-2.3.1\bin\Wrapper.exe
文件 82258 2007-04-25 16:00 james-2.3.1\bin\wrapper.jar
文件 1863 2007-04-25 16:00 james-2.3.1\bin\Wrapper.LICENSE
文件 11071 2007-04-25 16:00 james-2.3.1\conf\kernel.xm
文件 1042 2007-04-25 16:00 james-2.3.1\conf\phoenix-service.xm
............此处省略61个文件信息
- 上一篇:2017年美国数学建模大赛题目
- 下一篇:HANVONSDK20141119.rar
相关资源
- JMail操作详解apache-james-2.3.2.zip
- apache-james-2.3.2.zip
- ADC和DAC基础 Walt Kester 和James Bryant,美
- An Adventure in Statistics_Field Andy Iles Jam
- Calculus 7th edition James Stewart 英文 高清
- Calculus合集(James Stewart Gilbert Strang)
- 电路 第十版 James W.Nilsson / Susan A.Ri
- An introduction to statistical learning with A
- James Stewart Calculus 8th Ed [2015]
- 2017年Dan Jurafsky and James H. Martin经典力
- James Stewart Calculus 8th Ed
- 统计决策论及贝叶斯分析第二版Jame
- 第一本DOCKER书 修订版 JAMES TURBULL著
- JamesW.NilssonSusanA.Riedel-ElectricCircuits11
- 计算机图形学导论 james foley中文版本
- James Stewart - Calculus 8E.pdf 无水印
- James Stewart 的 Calculus 第八版
- Calculus. 作者 James Stewart. 最新版本8e
- james 3.0.1 需要配置的文件打包合集
-
ob
ject-Oriented Modeling and Design with UM - Model Predictive Control Theory Computation an
- Apache James 3.0支持LDAP参考文档
评论
共有 条评论