资源简介
邮件服务器apache-james-2.3.2
代码片段和文件信息
#!/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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-08-10 09:51 james-2.3.2\
目录 0 2009-08-10 09:51 james-2.3.2\apps\
目录 0 2009-08-10 09:51 james-2.3.2\bin\
目录 0 2009-08-10 09:51 james-2.3.2\bin\lib\
目录 0 2009-08-10 09:51 james-2.3.2\conf\
目录 0 2009-08-10 09:51 james-2.3.2\ext\
目录 0 2009-08-10 09:51 james-2.3.2\lib\
目录 0 2009-08-10 09:51 james-2.3.2\logs\
目录 0 2009-08-10 09:51 james-2.3.2\tools\
目录 0 2009-08-10 09:51 james-2.3.2\tools\lib\
文件 11572 2009-08-10 09:51 james-2.3.2\LICENSE.txt
文件 1650 2009-08-10 09:51 james-2.3.2\NOTICE.txt
文件 2254 2009-08-10 09:51 james-2.3.2\README.txt
文件 5075 2009-08-10 09:51 james-2.3.2\RELEASE_NOTES.txt
文件 3316 2009-08-10 09:51 james-2.3.2\UPGRADE.txt
文件 27 2009-08-10 09:51 james-2.3.2\apps\dummy.txt
文件 4259873 2009-08-10 09:51 james-2.3.2\apps\james.sar
文件 1863 2009-08-10 09:51 james-2.3.2\bin\Wrapper.LICENSE
文件 69632 2009-08-10 09:51 james-2.3.2\bin\Wrapper.dll
文件 167936 2009-08-10 09:51 james-2.3.2\bin\Wrapper.exe
文件 135 2009-08-10 09:51 james-2.3.2\bin\derby.properties
文件 25274 2009-08-10 09:51 james-2.3.2\bin\lib\excalibur-cli-1.0.jar
文件 53985 2009-08-10 09:51 james-2.3.2\bin\lib\excalibur-extension-1.0a.jar
文件 118334 2009-08-10 09:51 james-2.3.2\bin\lib\excalibur-instrument-manager-1.0.jar
文件 41533 2009-08-10 09:51 james-2.3.2\bin\lib\excalibur-io-1.1.jar
文件 89145 2009-08-10 09:51 james-2.3.2\bin\lib\excalibur-logger-2.1.jar
文件 32412 2009-08-10 09:51 james-2.3.2\bin\lib\excalibur-monitor-2.1.jar
文件 65261 2009-08-10 09:51 james-2.3.2\bin\lib\jakarta-oro-2.0.8.jar
文件 343900 2009-08-10 09:51 james-2.3.2\bin\lib\mx4j-jmx.jar
文件 266911 2009-08-10 09:51 james-2.3.2\bin\lib\mx4j-tools.jar
文件 2559 2009-08-10 09:51 james-2.3.2\bin\lib\mx4j.LICENSE
............此处省略58个文件信息
相关资源
- 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参考文档
评论
共有 条评论