Link to home
Start Free TrialLog in
Avatar of remeshk
remeshkFlag for United States of America

asked on

Linux mail convert to pdf format and send to pther ID

Hi All,

I need to convert a user mails to a pdf format and send it to other mail id.

PLease advise how can I do it.   I have the idea that will work only if text format mails.

But I need if any pictures sending in that mail that need to convert to pdf format.

Please help, this is an urgent.

Thanks in advance.

Avatar of Dave Howe
Dave Howe
Flag of United Kingdom of Great Britain and Northern Ireland image

If they were text only, there would be no need to convert to a pdf, and not seeing the benefits of doing so if it is an image. in theory, you could use fpdf in php, but that would not get you inline images using html bodies (as trying to render and pdf that would be a nightmare)

I would see if you can programically "print" the email (using an email client) to a ps magicprinter, then have that do ps2pdf and forward it on.

however, I would normally just "pull" the email as a raw, stick it in an attachment ending .eml (of type mime822) and forward it like that.
Avatar of remeshk

ASKER

Thanks for your iformation.

I found a solution for converting PDF is cups-pdf.

I have installed Cups-pdf in my machine and set as default printer and it is working.

I am trying to covert to PDF in /etc/aliases file. But it is not working...

I given entry in aliases file is

ram:   |/usr/bin/lpd

Please asdvise how can I run a script once a mail comes.
no, you can't do it in aliases - you can do it (for a given user) in a .forward file though.

examples here:

http://www.xs4all.nl/~sjoel/the-networking-cd-bookshelf/sendmail/ch25_07.htm

(for sendmail, but other mtas tend to honour the convention. what mta are you using?)
Avatar of remeshk

ASKER

thanks Dave,  for your information,  I am using Qmail.

may I know why this is not supporting to a user ?

for working this do I need to change anything in the configuration file ???

Please advise.
ASKER CERTIFIED SOLUTION
Avatar of Dave Howe
Dave Howe
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial