資源簡介
javamail相關jar包 配置apache james用到

代碼片段和文件信息
#!/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??2007-04-25?16:00??james-2.3.1\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\apps\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\bin\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\bin\lib\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\conf\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\ext\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\lib\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\logs\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\tools\
?????目錄???????????0??2007-04-25?16:00??james-2.3.1\tools\lib\
?????文件???????11685??2007-04-25?16:00??james-2.3.1\LICENSE.txt
?????文件????????1685??2007-04-25?16:00??james-2.3.1\NOTICE.txt
?????文件????????2325??2007-04-25?16:00??james-2.3.1\README.txt
?????文件????????3294??2007-04-25?16:00??james-2.3.1\UPGRADE.txt
?????文件??????????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
?????文件????????1863??2007-04-25?16:00??james-2.3.1\bin\Wrapper.LICENSE
?????文件???????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
?????文件?????????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
............此處省略57個文件信息
評論
共有 條評論