- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- corrupted attachments
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2006 09:25 PM
тАО07-06-2006 09:25 PM
corrupted attachments
Every Friday automatically emails with attachments are sent from on of our HP-UX machines using mailx from a shell script. Some of these mails go directly to our internal our exchange server and some of them are sent cross-domain over the internet. Internally sent emails are received successfully, but one of our customers receives the email with a corrupted attachment. I have tested by sending the mail to my private mail server and the attachment is OK. Has anyone met the same issue? Can I change a parameter with mailx or should the customer change setting on their exchange server?
Here is a code fragment:
## Begin code
file="HUBBA.DAT"
filealias="HUBBA_$(date '+%m%d').DAT"
purpose="leerlingen-administratie"
filepath="/tmp"
DATFILE="${filepath}/${file}"
EXTENSION="${file#*.}"
BASE_NAME="${file%.${EXTENSION}}"
subject="blah blah"
message="blah blah"
# Check if datfile exists
f_check_datfile
f_retval
# Send the E-mail message...
mailx -r ${RETURN_ADDRESS} -s "${subject}" ${target_address} <
${notification}
Hallo ${firstname}. ${sirname},
${message}
${notification}
Bij dit bericht is het bestand ${filealias} als bijlage toegevoegd.
===================================================
Dit is een automatisch gegenereerde email.
Als u deze email ten onrechte heeft ontvangen,
meldt u dit a.u.b. aan ${RETURN_ADDRESS}
===================================================
EOF
## End code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2006 11:45 PM
тАО07-06-2006 11:45 PM
Re: corrupted attachments
mailx -r ${RETURN_ADDRESS} -s "${subject}" ${target_address} <
TO
mailx -m -r ${RETURN_ADDRESS} -s "${subject}" ${target_address} <
The "-m" tells mailx that the message contains mime encoded items.
I tested your original code sniplet and I ALSO received a "garbled" message:
----------------------------------------------
begin 666 =dah.txt
M:&]S=&YA;65A#0I(4B!D979E;&]P;65N="P@1&%T82!297!O
`
end
notification
Hallo firstname. sirname,
----------------------------------------------
But once I added the "-m" option the item came in as an attachment.
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2006 12:00 AM
тАО07-07-2006 12:00 AM
Re: corrupted attachments
If you continue to have problems, you might want to give SEP's famous mailfile attachment script a shot:
http://www.hpux.ws/mailfile2
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2006 12:00 AM
тАО07-07-2006 12:00 AM
Re: corrupted attachments
You are right! In the original code I do use the -m option. With -m the email text is OK, but in the attachment some line feeds just dissapear.
If I don't use the "-m" even the text in the email looks Russian to me.
I personally think that it hat to do with setting on the customers' Exchange settings, but I'm not sure.
All suggestions are welcome!
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2006 12:04 AM
тАО07-07-2006 12:04 AM
Re: corrupted attachments
Thanks for the hint. I will give it a go!
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2006 12:24 AM
тАО07-07-2006 12:24 AM
Re: corrupted attachments
if this is just a text file, then try changing the EXTENSION to ".txt"
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2006 12:42 AM
тАО07-07-2006 12:42 AM
Re: corrupted attachments
Originally the extension is (excuse me) .cum (for cumulative file). Because of all firewalls and proxies I alias it to .DAT instead ;^)
We tested by mailing from UNIX to customer;
customer forwards mail including attachment;
They try to load file into forms application (I think it uses SQL*loader on background), which failes.
When I open the attachment with Ultraedit, some line feeds and spaces (just four or five times in fourhudred lines) are dissapeared. It beats me what causes it.
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2006 12:53 AM
тАО07-07-2006 12:53 AM
Re: corrupted attachments
You may want to run the file through 'ux2dos' before attaching it so that LF's get translated to CR's & LF's. If you don't have 'ux2dos', 'awk' also works:
awk '{print $0"\r"}' < file_unix > file_dos
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2006 01:03 AM
тАО07-07-2006 01:03 AM
Re: corrupted attachments
I do use ux2dos :
$(ux2dos ${DATFILE} | uuencode ${filealias})
, but thanx for the hint.
More and more I begin to think are to be found in exchange. Is anyone feeling exchange goeroe today?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2006 01:21 AM
тАО07-07-2006 01:21 AM
Re: corrupted attachments
I guess I missed that ;-).
I wonder if sending the file as a binary will make a difference. Try compressing or gziping it before you attach it. Of course, the danger here is if the message gets alterted en route, the archive will be corrupt.
PCS