473,511 Members | 14,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Manipulating mailboxes


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

Jul 19 '05 #1
3 1388
Laszlo Zsolt Nagy <ga*****@geochemsource.com> 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.
Jul 19 '05 #2

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: ka*****@i.com.ua
Jul 19 '05 #3
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
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2235
by: Jed Parsons | last post by:
What headers to I have to know about to build thread trees from Unix mailboxes? Is it enough to get the In-Reply-To header for each message and build a dictionary of { Message-ID: message }...
1
1215
by: Eric S. Johansson | last post by:
I've been searching around for the equivalent to the mailbox module except with the capability of writing messages as well as reading. If it makes it easier, I only need to write to maildir...
0
1098
by: skippy | last post by:
I am writing a program in C# that needs to create and modify exchange mailboxes/recipients on our exchange 5.5 server. I had this working a long time ago in VB but I can not find any code in .net...
4
2709
by: Ron Vecchi | last post by:
I a runnning w2k3 pop3 mail server that came with iis6. I would like to write an application that progammtically creates the new mailboxes in an already established mail domain. Does anyone know...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.