Maxim Shaev пишет:
Dmitry Agafonov пишет:

Возвращаясь к вашему вопросу: создайте нужные почтовые папки, настройте "инструменты->сортировщик писем" и откройте для себя формат UNIX MBOX :)

Да, я нахожу файлы соответствующие моим папкам в почтовике, это они? и как мне оттуда выцарапать нужное мне письмо?

В любом скриптовом языке (Perl/Python/Ruby) должен быть какой-нибудь (возможно, и не один) модуль для парсинга почтовых сообщений.

В аттаче очень простой пример на питоне - он требует присутствия в текущей директории файла с именем mbox и соответствующим содержимым :)

Но решать подобные задачи в тех ОС/MUA, которые вы используете - сущее мучение :(

--
С уважением, Прокопьев Евгений
#!/usr/bin/python

# Copyright (C) 2006 Eugene Prokopiev <enp at altlinux dot org>
#
# This program is free software; you can redistribute it and/or 
# modify it under the terms of the GNU General Public License 
# as published by the Free Software Foundation; either 
# version 2 of the License, or (at your option) any later 
# version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

import os,sys,getopt,email,email.Errors,email.Parser,mailbox

mbox = mailbox.PortableUnixMailbox(open("mbox","r"),email.message_from_file)

parser = email.Parser.Parser()

try:
        while 1:
                mailmsg = mbox.next()
                if not mailmsg:
                        print "All Done!"
                        sys.exit()
                try:
                        mailfrom = 
parser.parsestr(mailmsg.as_string()).get("From")
                        print "Processed message from : %s" %(mailfrom,)
                        del mailmsg
                except IOError:
                        print "Box is invalid"
                        sys.exit(1)
except email.Errors.MessageParseError:
        print "Error Parsing Mail"
        sys.exit(1)
_____________________________________________________
Oo-discuss mailing list
Oo-discuss at openoffice.ru
https://lists.openoffice.ru/mailman/listinfo/oo-discuss

Ответить