Sponsored Content
Top Forums Shell Programming and Scripting MIME Type detection for Net::SMTP Post 302551999 by mrwatkin on Thursday 1st of September 2011 10:10:17 AM
Old 09-01-2011
MIME Type detection for Net::SMTP

I've spent a good two weeks on trying to figure out a proper way to get the mime type of a file. The "file" command on the Sparc machine I'm working on is an older version and does not support the --mime flag. It outputs things like:

somefile.pdf: Adobe Portable Document Format (PDF) v1.5

I was wondering if there was some alternative built in way to detect the mime type. I'm not allowed to use anything other than the default install of ActivePerl. I'm thinking that I'll have to create my own configuration file, but who knows.


My reason for wanting this is because I'm making my own mailer using Net::SMTP. I'm still not even sure how to set my attachments to be transferred as binary or text (or if it really matters). I know that I have to set my


Any an all responses/direction would be greatly appreciated.

Thanks in advance.
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to Set Mime type to mailx

I have a problem while sending attachement , it is displying Content into body of mail (Junk Data) instead of attachment (zip format) in Linux, same code is working in Sun Solaris.. I have read query in this site , need to set MIME type to mailx componment. Please help me how to set MIME type..... (1 Reply)
Discussion started by: suneel
1 Replies

2. Shell Programming and Scripting

Net::smtp - Did this work

Hi, I have read the related posts by perleo and those who assisted. I wish to do a similar thing, in that I wish to use the Net:smtp module. I have downloaded it and followed the instructions for the install. When I check the perldoc net::smtp, the information returns (thus showing it... (1 Reply)
Discussion started by: cheng
1 Replies

3. UNIX for Dummies Questions & Answers

Lynx - Downloading - extension handling - changing mime type?

Using Lynx, when I try to download a .rar, it confirms I want to download and its got it as an appication/rar file. However, split archives that end in .r## (.r00, .r01 ...) are not recognized as an appication/rar file and it reads the file like a .txt or .html. How can I fix this? Thanks! (2 Replies)
Discussion started by: yitzle
2 Replies

4. Shell Programming and Scripting

Retrieving File's Mime-type

Alright, so I am trying to use perl (or any other shell scripting language, awk/sed/bash for instance), to retrieve the mime-type of a file. I want to keep it in one file, and most of the modules that are on cpan that check for mime types (Magic), aren't installed on these boxes. Anyone have... (2 Replies)
Discussion started by: Rhije
2 Replies

5. Shell Programming and Scripting

Sending Attachment using MIME::Lite and Net::SMTP

Hello, I'm a newbie perl scriptor and i'm trying to figure out why i can't send an email using MIME::Lite with Net::SMTP. I keep receiving the following error: SMTP MAIL command failed: 5.7.1 Helo invalid . at attach1.pl line 31 The error keeps coming from the very last line... (2 Replies)
Discussion started by: xmaverick
2 Replies

6. Shell Programming and Scripting

Net::SMTP via PERL is not working in few cases

We are getting some special scenarios where Net::SMTP is not working for some mails. we are sending a similar kind of data via mails but some of the mails are not received. After checking the Net::SMTP in debug mode we found below difference: Good One - (Mail sent properlly) --- -----... (0 Replies)
Discussion started by: NIMISH AGARWAL
0 Replies

7. Programming

Parallel Processing Detection and Program Return Value Detection

Hey, for the purpose of a research project I need to know if a specific type of parallel processing is being utilized by any user-run programs. Is there a way to detect whether a program either returns a value to another program at the end of execution, or just utilizes any form of parallel... (4 Replies)
Discussion started by: azar.zorn
4 Replies

8. UNIX for Beginners Questions & Answers

MIME type for sending gzip file as attachment in email

Hello, I am trying to send a gzip file on email using below command but the zipped file received on email is corrupt. mailsend -smtp $smtpip -content-type 'application/x-gzip' -mime-type "application/x-gzip" -t $receiver -f $sender -sub "$subject" -M "$MSG" -attach $file file name is ... (1 Reply)
Discussion started by: tushar.modgil
1 Replies
asadmin-delete-mime(1AS)					   User Commands					  asadmin-delete-mime(1AS)

NAME
delete-mime - removes the MIME type SYNOPSIS
delete-mime --user admin_user[--password admin_password][--host localhost] [--port 4848][--passwordfile filename][--secure|-s][--instance instance_name]mime_ID Removes the MIME types associated with the named server instance. The server determines the MIME type of a requested resource by invoking the type-by-extension directive in the ObjectType section of the obj.conf file. The type-by-extension function does not work if no MIME element has been defined in the server element. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --secure if true, uses SSL/TLS to communicate with the administrative instance. --instance name of the instance. OPERANDS
mime_id internal name for the MIME types listing. It is used in a virtual-server element to define the MIME types used by the virtual server. Example 1: Using delete-mime asadmin> delete-mime --user admin --password adminadmin --host fuyako --port 7070 --instance server1 sampleMIME Deleted Mime with id = sampleMIME Where: sampleMIME is the name of the MIME deleted. EXIT STATUS
0 command executed successfully 1 error in executing the command INTERFACE EQUIVALENT
HTTP Server node, MIME Type Files page asadmin-create-mime(1AS), asadmin-list-mimes(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-mime(1AS)
All times are GMT -4. The time now is 07:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy