LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-04-2003, 06:01 PM   #1
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
sendmail config prob


now i am not sure about the sendmail configureation section but obviously it ain't setup right. i am trying to setup a perl script that will send a message via email to someone with a report of how many spam emails were deleted using my new service. this is the error
sendmail: warning: My hostname joes-box is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf
postdrop: warning: My hostname joes-box is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf

attached is my main.cf file (i have done no editing to it). i do not pay for a domain name and i do not run a webserver except for my internal network. my main question is this: is it possible to run a mail server without having a domain name? and if so where can i find information on setting it up. i went to sendmail.org and found little help and i am terrible at reading man files. (can't understand them to the fullest) any help would me much appriciated. thanks in advance.
joe

below i will place in my code for the perl script.

=====
code
=====
#!/usr/bin/perl

open (FILE, "</home/joe/mailfilter_logs/.mailfilter.log"); #read the file
@log = <FILE>; #put the file into an array seperated on the carrage
close (FILE);

foreach $log (@log) {
if ($log =~ "@freelotto.com"){
$counter++;
}
}
open (MAIL, "|/usr/sbin/sendmail -t") || die; #this is said to use sendmail to send the output that i specify to the recepiant. below is the email

print MAIL "To: joes_box@cox.net\n From: mailfilter/n";
print MAIL "Subject: Deleted mail for bonnie\n\n";
print MAIL "$counter E-mails were deleted today. send a message to bonnie \n
letting her know that the program is working";
close (MAIL);

========
end code
========

to see my main.cf go here
 
Old 03-06-2003, 01:41 AM   #2
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Original Poster
Rep: Reputation: 30
update on the questions

i have been reading up on MUTT and think that there is a way to use cli and send the mail using MUTT. but as i read i get the feeling that MUTT is only for mail within my home network. i haven't found anything that shows how to setup MUTT for accessing my pop3 account (my isp). if it is possible please let me know how i can do this or at least lead me in the right direction.
 
Old 03-08-2003, 11:28 PM   #3
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Original Poster
Rep: Reputation: 30
never mind, i got an idea from another thread that lead me to MIME::Lite. a perl mod that helps get around sendmail. but now i have an other problem. when i go to send the message i can not use variables within the message text. so i made the message an attachment. i am making it a normal *.txt file (so that windows can read it). here is the code:

====
code
====
#!/usr/bin/perl
use MIME::Lite; #use the MIME::Lite Module

open (FILE, "</home/joe/mailfilter_logs/.mailfilter.log"); #open the filter log just for opening
@log = <FILE>; #put the filter log into the array seperated on the carrage
close (FILE); #close the log

foreach $log (@log) {
#print $log;
if ($log =~ /superdealmail.com/){ #for each line of the filter log see if @superdealmail.com is in that line
$counter++; #if so then add 1 to the variable $counter
print $log;
print $counter;
}
}
#$counter=($counter/2);
#next line: write over the file mailfilter_delete_count.txt or if not print that it can't
open (MAIL,">/home/joe/mailfilter_logs/mailfilter_delete_count.txt") || print "cant open the file";
#next line: add this line to the file
print MAIL "there were $counter emails sent by \"superdealmail.com\"\n that were deleted this week.";
close (MAIL); #close the file
#next line: setup MIME::Lite to use my smtp server to send out
MIME::Lite->send('smtp', "smtp.xxxxx.xxxx.net", Timeout=>60);
$msg = MIME::Lite->new( #setup the new message section
From =>'pandaroo2@xxx.net',
To =>'joes_box@xxx.net',
Subject =>'Helloooooo, nurse!',
Data=>'The attachment is the report from Joe\'s Mailfilter Service (JMS)'
); #end new message section
$msg->scrub(content-type); #from the website to stop using content-type but doesn't work
$msg->attach(TYPE =>'Data', #setup the attachment section & type of attachment !!!!!!!!!!!!THIS IS THE AREA THAT I AM HAVING PROBLEMS WITH!!!!!!!!!!!!!
Path =>'/home/joe/mailfilter_logs/', #where the attachment is located in my puter
Filename =>'mailfilter_delete_count.txt' #the name of the file to be sent
); #end attachment section
#next line: send the message
$msg->send;
========
end code
========

here is the mod at cpan
http://search.cpan.org/author/ERYQ/M...ite.pm#VERSION
i can not get the attachment to send any data. i just get an empty file. if anyone can help me the i will be vary greatful. can someone help me here??

Last edited by joesbox; 03-08-2003 at 11:29 PM.
 
Old 03-09-2003, 07:32 PM   #4
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,852

Rep: Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553
Re: update on the questions

Quote:
Originally posted by joesbox
... but as i read i get the feeling that MUTT is only for mail within my home network. i haven't found anything that shows how to setup MUTT for accessing my pop3 account (my isp). ...
Have you read through the ``manual.txt'' file that comes with mutt? On RH, for example, it's under ``/usr/share/doc/mutt*''. That's the user manual and it contains descriptions for all the options that you can configure in .muttrc (and there are a lot of them). I haven't set up a mutt config for POP3 though but I briefly used it for an IMAP mail directory. Take a look in that manual file for details on how to use it. Note, however, that the support for POP3 and IMAP has to be enabled when mutt is compiled. Your distribution may not have done this so you may have to remove the precompiled binary package and compile it from sources (following the installation instructions on how to enable support for POP3). BTW, we use mutt at work to send out email notifications to customers -- including attachments -- so it definitely is possible to use it for mail destined to addresses outside your LAN.

Good luck,

Rick
 
Old 03-09-2003, 10:17 PM   #5
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Original Poster
Rep: Reputation: 30
thanks for the info. but i think that i found a way to get around sendmail. there is a mod for perl that allows me to use my isp's smtp server. all i got to do is a little tweeking and i will get it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail - Config for IP Block's & Config Issues Thom_Redhat Linux - Software 1 04-07-2006 01:29 PM
linksys wpc54g config prob comatozed Linux - Wireless Networking 3 08-13-2005 04:43 PM
Some internet config prob rhl_one Slackware 16 01-11-2004 03:31 PM
just wondering...sendmail prob GraemeK Linux - Networking 11 12-08-2003 11:57 AM
WLAN Config Prob lanmanx Linux - Newbie 1 06-29-2003 01:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration