Help needed to remove attachment as soon as received

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
User avatar
kani
New user
New user
Posts: 18
Joined: 2010-04-01 18:31

Help needed to remove attachment as soon as received

Post by kani » 2010-04-08 19:40

I want to forward all my emails to another email account but I do not want to store the attachments. I need to have only the email body in that.

How to create a user defined function that deletes the attachment and where should I include this function so hmail recognizes that function.

Thank you for your help!

Situation:
a@mysite.com receives all emails and keeps it's copy, and forwards all emails to b@mysite.com here I do not want to store attachments in b@mysite.com.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Help needed to remove attachment as soon as received

Post by ^DooM^ » 2010-04-08 20:44

this script was written to zip up pdf files on receipt of email, with a little work from you I'm sure it can be altered to remove attachment rather than zip it

http://www.hmailserver.com/forum/viewto ... =14&t=8101
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
kani
New user
New user
Posts: 18
Joined: 2010-04-01 18:31

Re: Help needed to remove attachment as soon as received

Post by kani » 2010-04-08 21:02

Thanks for your reply, it seems processing all emails to the server.

I am thinking about calling a function only when an email received into an account (not for all account). I will setup a rule to process all emails to an account and call a function (user defined) to remove the attached. Is that doable?

If yes, please give me some links to learn how to do this. Thank you!

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Help needed to remove attachment as soon as received

Post by ^DooM^ » 2010-04-08 21:04

use an account rule to run a function or add an if clause to the script to only process if going to a specific account.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
kani
New user
New user
Posts: 18
Joined: 2010-04-01 18:31

Re: Help needed to remove attachment as soon as received

Post by kani » 2010-04-08 22:14

http://www.hmailserver.com/forum/viewto ... 75#p107475

This was very close to what I was looking for. I made minor changed and using it.

Great post that.

Post Reply