Operating System - HP-UX
1825902 Members
3281 Online
109689 Solutions
New Discussion

Re: attachment in sendmail file name with the path

 
irt_1
Frequent Advisor

attachment in sendmail file name with the path

Hi All,

We tried to send email with attachment using sendmail command, the attachment was send ok we can open find from the client. The only problem is the name of the file is include the path.

For example on the sendmail config:
...
--m1_boundarystring
Content-Type: text/plain
Content-Disposition: attachment; filename=/common/local/test.txt
Content-Description: test.txt
...

and then on the receiving email the attachment filename become like this:
_common_local_test.txt (includes the whole path and it change from / to _)

and actually we want the filename simply like:
test.txt

How can we have the simpler filename instead of with the wrongly full pathname?

Thank you!

Iwan Tamimi
5 REPLIES 5
Geoff Wild
Honored Contributor

Re: attachment in sendmail file name with the path

Tons of threads on this:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=55750

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1046448

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=31333

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1055599

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Court Campbell
Honored Contributor

Re: attachment in sendmail file name with the path

# uuencode /path/to/some/file.tar.gz new_name.tar.gz | mailx -m -s "file from system" to@me.com

the second argument to uuencode is going to be the name of the attachement.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Steven Schweda
Honored Contributor

Re: attachment in sendmail file name with the path

> How can we have the simpler filename
> instead of with the wrongly full pathname?

If it's not too much to ask, how did you make
what you have now?
irt_1
Frequent Advisor

Re: attachment in sendmail file name with the path

Actually the application support already run the sendmail script for sometimes and the attachment file is just test.txt without the the pathname.

We just found out that it is the Microsoft Outlook 2003 that convert to the strange name, the previous Outlook automatically strip off the pathname. We just upgrad our mail client to Outlook 2003.

Our solution is change the script, cd to the directory instead to refer the file with the full pathname.

Anyway thank you for all of your help.

Regards,

Iwan
Steven Schweda
Honored Contributor

Re: attachment in sendmail file name with the path

> [...] cd to the directory [...]

I was guessing something like that as the
ultimate solution, but I was waiting until
you said that you were specifying the full
path somewhere, which you never did.

Guessing what's wrong with a secret or
invisible script can waste much time and
effort.