Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Manipulating mailboxes

Reply
Thread Tools

Manipulating mailboxes

 
 
Laszlo Zsolt Nagy
Guest
Posts: n/a
 
      05-23-2005

Hi All,

I need to create a daemon that sits on a server and forwards some
e-mails. (Well not only that, it needs to change header information
before forwarding and also insert messages into a database). The mailbox
module is fine but I do not see a way to delete/add messages - it is
ready only. The other possiblity is IMAP4 but it is bad because my
program should not store passwords for all users. I can only see one
solution right now:

1. Make a copy of the mailbox
2. Truncate the mailbox
3. Process the messages in the copy and forward the e-mails by sending
out real e-mails.

But this looks so clumsy. Is there a way to delete/add messages to
mailboxes of different users, directly?

Thanks,

Laci 2.0

 
Reply With Quote
 
 
 
 
Paul Rubin
Guest
Posts: n/a
 
      05-23-2005
Laszlo Zsolt Nagy <(E-Mail Removed)> writes:
> But this looks so clumsy. Is there a way to delete/add messages to
> mailboxes of different users, directly?


Why not use procmail or equivalent to drop incoming messages into
your daemon one at a time. Then use the smtp module to forward them
to their actual destinations.
 
Reply With Quote
 
 
 
 
Maksim Kasimov
Guest
Posts: n/a
 
      05-23-2005

change header information, insert messages into a database, delete/add messages, should not store passwords for all users, ... and any things else you wish to do - if your OS is UNIX - just forward mail messages of some users to your python script (you don't need to write a daemon for this)
All you need is to place file ".forward" in users home directory, and write like this:
|/path/myscript.py

and chmod the script:
chmod 777 /path/myscript.py

Laszlo Zsolt Nagy wrote:
>
> Hi All,
>
> I need to create a daemon that sits on a server and forwards some
> e-mails. (Well not only that, it needs to change header information
> before forwarding and also insert messages into a database). The mailbox
> module is fine but I do not see a way to delete/add messages - it is
> ready only. The other possiblity is IMAP4 but it is bad because my
> program should not store passwords for all users. I can only see one
> solution right now:
>
> 1. Make a copy of the mailbox
> 2. Truncate the mailbox
> 3. Process the messages in the copy and forward the e-mails by sending
> out real e-mails.
>
> But this looks so clumsy. Is there a way to delete/add messages to
> mailboxes of different users, directly?
>
> Thanks,
>
> Laci 2.0
>



--
Best regards,
Maksim Kasimov
mailto: http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
Laszlo Zsolt Nagy
Guest
Posts: n/a
 
      05-23-2005
Maksim Kasimov wrote:

>change header information, insert messages into a database, delete/add messages, should not store passwords for all users, ... and any things else you wish to do - if your OS is UNIX - just forward mail messages of some users to your python script (you don't need to write a daemon for this)
>All you need is to place file ".forward" in users home directory, and write like this:
>|/path/myscript.py
>
>


>and chmod the script:
>chmod 777 /path/myscript.py
>
>

Oh, fantastic. Then I can open stdin and read the e-mail message
from there.
Thank you so much

Laci 2.0


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing mailboxes cmika@-takethisout-25thandclement.com Perl 1 08-27-2004 07:02 AM
mailboxes Finbogey Firefox 10 03-06-2004 12:50 AM
Completely update mailboxes (Mozilla mail) Gwen Morse Firefox 0 02-07-2004 08:05 AM
Read mailboxes on exchange 5.5 using aspx Sunil ASP .Net 3 01-21-2004 12:46 AM
Where are the mailboxes? Stuart Firefox 6 01-15-2004 09:29 PM



Advertisments