Sponsored Content
Top Forums Shell Programming and Scripting Problem with MIME::Lite / Sendmail Post 302466030 by andi25 on Monday 25th of October 2010 08:32:03 AM
Old 10-25-2010
Problem with MIME::Lite / Sendmail

Hi all,

i'm using the pearl package MIME::Lite zu send eMails via sendmail. I have the problem, that in the "Received From" part oft the email header occure the user and the hostname of my machine. I'd like to have a name or an email address instead of that:

Code:
Received: from MEINSERVER.MEINEDOMAIN.de (MEINEDOMAIN.de [212.78.165.xx])
     by zieldomain.de (Postfix) with ESMTPS id 6C123A385E
     for <empfaenger@email.de>; Thu, 21 Oct 2010 11:43:21 +0200 (CEST)
...
Received: (from USER@localhost)

Actually i'm not sure if it is a perl problem or a sendmail problem...

Here is an extract of my sendmail.mf:

Sendmail.mf

Code:
LOCAL_DOMAIN(`MEINSERVER.MEINEDOMAIN.de')dnl

perl code

Code:
#!/usr/bin/perl

use strict;
use MIME::Lite; 
use Time::localtime; 
use MIME::Words qw(:all);

use open ':utf8';

my $mailtext="";

mail();
sub mail 
{

        my $sendmail = "/usr/sbin/sendmail -t";
        my $from = "me\@email.de";
        my $reply_to = "me\@email.de";
        my $subject  = "Subject";
        my $mail_message = "content";

        my $msg = MIME::Lite->new
        (
                #Subject => $subject,
                Subject => $subject,
                From    => $from,
                To      => 'receptient@email.de',
                Type    => 'multipart/mixed',
        );

        $mailtext=$mail_message;

        my $part = MIME::Lite->new(
                 Type     => 'TEXT',
                 Data     => $mailtext,
        );


        MIME::Lite->send("sendmail", $sendmail);
        $msg->send;
}
exit;

I hope that somebody can help me. I really don't know much about emails :-)

Thank you very much!
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Sendmail problem

problem: user 1 sends an email thru exchange to a unix box w/ 2 ip's and hostnames running sendmail. Email is marked sent to one address and deffered to the other. any ideas as to how to get them both marked as sent? actual error below. When email is sent to the 2nd host the email is proccessed... (2 Replies)
Discussion started by: Optimus_P
2 Replies

2. HP-UX

sendmail problem with HP-UX

Hello, I'm trying to configure sendmail on a HP-UX 11.0 to send a mail from my server to my mailbox. I have changed the macro DS in sendmail.cf with the name of the smtp server. When I try to send a message it is always put in the queue and never sent. In the log, I get : May 29 15:30:53 smmv6... (2 Replies)
Discussion started by: aribault
2 Replies

3. Red Hat

sendmail problem

Hi everyone... i'm trying to send mail with attachment using /usr/sbin/sendmail and from some reason it's not working for me only from one computer. the command i'm using is: cat /etc/fstab | /usr/sbin/sendmail -t RECIPIENT@MAIL.COM am i doing something wrong? p.s. the OS is RedHat. (6 Replies)
Discussion started by: eliraza6
6 Replies

4. UNIX for Dummies Questions & Answers

sendmail problem

I have a user who's email comes out looking like this: From name@domain.com Wed Aug 6 15:36:39 2008 Return-Path: <name@domain.com> X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on it2 X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=AWL,BAYES_20,MISSING_SUBJECT,... (1 Reply)
Discussion started by: photon
1 Replies

5. Linux

Sendmail problem

I am trying to send mail from my CentOS server. I have made nacessory changes required from sendmail. But it is not working. I am getting following messages in maillog- Dec 17 09:25:12 localhost sendmail: mBH3tCTi016891: fps.company.com did not issue MAIL/EXPN/VRFY/ETRN during... (1 Reply)
Discussion started by: kailas.awchar
1 Replies

6. Shell Programming and Scripting

ambigouity on using Mime::Lite?

Hi Everyone, I have a question related to using MIME::Lite module in perl.Below i mentioned code blocks used for sending mail through MIME::Lite. $msg = MIME::Lite -> new ( From => $from, To => $to, Subject... (0 Replies)
Discussion started by: DILEEP410
0 Replies

7. Shell Programming and Scripting

Problem sending excel attachments with MIME::Lite in perl

I am running a perl script that generates an excel doc and then emails it as an attachment. I can generate the excel file fine. I can scp it from the box and open it with no problems. When I send it over email, the file does open properly. The file in email is only 288 B, but on the server it is... (1 Reply)
Discussion started by: Mike_the_Man
1 Replies

8. 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

9. Solaris

Problem with sendmail

We are using web application which is hosted on Solaris server(Solaris OS 5.10). This application contains some feedback form and contact us form, which should trigger email to our web admin once those are submitted by users. This forms are integrated with mailmerge.cgi utility(perl utility)... (0 Replies)
Discussion started by: paventhan
0 Replies

10. UNIX and Linux Applications

Problem with sendmail

We are using web application which is hosted on Solaris server(Solaris OS 5.10). This application contains some feedback form and contact us form, which should trigger email to our web admin once those are submitted by users. This forms are integrated with mailmerge.cgi utility(perl utility)... (0 Replies)
Discussion started by: paventhan
0 Replies
Log::Handler::Output::Sendmail(3pm)			User Contributed Perl Documentation		       Log::Handler::Output::Sendmail(3pm)

NAME
Log::Handler::Output::Sendmail - Log messages with sendmail. SYNOPSIS
use Log::Handler::Output::Sendmail; my $email = Log::Handler::Output::Sendmail->new( from => 'bar@foo.example', to => 'foo@bar.example', subject => 'your subject', ); $email->log(message => $message); DESCRIPTION
With this output module it's possible to log messages via "sendmail". METHODS
new() Call "new()" to create a new Log::Handler::Output::Sendmail object. The following options are possible: from The sender address (From). to The receipient address (To). cc Carbon Copy (Cc). bcc Blind Carbon Copy (Bcc) subject The subject of the mail. sender This option is identical with "sendmail -f". header With this options it's possible to set your own header. my $email = Log::Handler::Output::Sendmail->new( from => 'bar@foo.example', to => 'foo@bar.example', header => 'Content-Type: text/plain; charset= UTF-8', ); Or my $email = Log::Handler::Output::Sendmail->new( header => { From => 'bar@foo.example', To => 'foo@bar.example', Subject => 'my subject', 'Content-Type' => text/plain; charset= UTF-8', } ); Or my $email = Log::Handler::Output::Sendmail->new( header => [ 'From: bar@foo.example', 'To: foo@bar.example', 'Subject: my subject', 'Content-Type: text/plain; charset= UTF-8', ] ); sendmail The default is set to "/usr/sbin/sendmail". params Parameters for "sendmail". The default is set to "-t". maxsize Set the maximum size of the buffer in bytes. All messages will be buffered and if "maxsize" is exceeded the buffer is flushed and the messages will be send as email. The default is set to 1048576 bytes. Set 0 if you want no buffering and send a mail for each log message. debug Set 1 if you want to enable debugging. The messages can be fetched with $SIG{__WARN__}. log() Call "log()" if you want to log a message as email. $email->log(message => "this message will be mailed"); If you pass the level then its placed into the subject: $email->log(message => "foo", level => "INFO"); $email->log(message => "bar", level => "ERROR"); $email->log(message => "baz", level => "DEBUG"); The lowest level is used: Subject: ERROR ... You can pass the level with "Log::Handler" by setting message_pattern => '%L' flush() Call "flush()" if you want to flush the buffered messages. validate() Validate a configuration. reload() Reload with a new configuration. errstr() This function returns the last error message. DESTROY
"DESTROY" is defined and called "flush()". PREREQUISITES
Carp Params::Validate EXPORTS
No exports. REPORT BUGS
Please report all bugs to <jschulz.cpan(at)bloonix.de>. If you send me a mail then add Log::Handler into the subject. AUTHOR
Jonny Schulz <jschulz.cpan(at)bloonix.de>. COPYRIGHT
Copyright (C) 2007-2009 by Jonny Schulz. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-11-21 Log::Handler::Output::Sendmail(3pm)
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy