CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 5 - Server Support
  sending logwatch to external mail address

 

 Bottom   Previous Topic   Next Topic
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
  •  beckerde
      beckerde
sending logwatch to external mail address
#1
Newbie
Joined: 2007/11/29
From
Posts: 6
My ISP blocks outgoing email if it does not login properly with a valid account.
I successfully configured sendmail to use SMART_HOST and confAUTH_OPTIONS with confAUTH_MECHANISM set to LOGIN PLAIN.

It successfully sends email because I tested it with evolution sending through 127.0.0.1, but I need to specify myacount@mydomain.com as the email address for root.

But it doesn't work for logwatch because it sends as from root@localhost.localdomain, and my ISP's smtp server rejects it. The message I get back in root@localhost account is the following:

----- Transcript of session follows -----
... while talking to smtp.mydomain.com.:
>>> MAIL From:<root@localhost.localdomain> SIZE=581 AUTH=<>
<<< 550 5.7.1 Client does not have permissions to send as this sender
554 5.0.0 Service unavailable

I thought that I should masquerade all emails from this domain, so I configured sendmail as specified in [1] section "24.3.1.4. Masquerading", but it doesn't work. It seems that masquerading in sendmail is broken or something is wrong in the documentation.

[1] http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Deployment_Guide/s1-email-mta.html#s2-email-mta-sendmail

I have sendmail 8.13.8-2 and centos-release-5-4.el5.centos.1.

Is there a way to specify the "From:myacount@mydomain.com" in logwatch ? or
Is there a way to make it work the masquerading in sendmail so I can masquerade everything as coming from a specific account?

thanks

kind regards

Domingo Becker
Posted on: 2009/11/4 17:15
Create PDF from Post Print
Top
  •  beckerde
      beckerde
Re: sending logwatch to external mail address
#2
Newbie
Joined: 2007/11/29
From
Posts: 6
An update.

There is a "MailFrom = usermailaddress" option in logwatch.conf, and it seems it's respected by logwatch.
What I get is the following:

<message>
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.13.8/8.13.8) with ESMTP id nA572920030545 for <myaccount@mydomain.com>; Thu, 5 Nov 2009 04:02:09 -0300
Received: (from root@localhost) by localhost.localdomain (8.13.8/8.13.8/Submit) id nA57243R030396; Thu, 5 Nov 2009 04:02:04 -0300
Fecha: Thu, 5 Nov 2009 04:02:04 -0300
Message-Id: <200911050702.nA57243R030396@localhost.localdomain>
Para: myaccount@mydomain.com
De: myaccount@mydomain.com
Asunto: Logwatch for localhost (Linux)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="iso-8859-1"


################### Logwatch 7.3 (03/24/06) ####################
Processing Initiated: Thu Nov 5 04:02:04 2009
Date Range Processed: yesterday
...
</message>

In the smtp session, it still uses the account root@localhost.localdomain, instead of myaccount@mydomain.com:

<smtp-session>
----- Transcript of session follows -----
... while talking to smtp.mydomain.com.:
>>> MAIL From:<root@localhost.localdomain> SIZE=4778 BODY=8BITMIME AUTH=<>
<<< 550 5.7.1 Client does not have permissions to send as this sender
554 5.0.0 Service unavailable
</smtp-session>

So, even logwatch uses my account as MailFrom, it is not used in the smtp session, and the current user's mail address is used instead (root).

Any ideas?
Posted on: 2009/11/5 11:36
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: sending logwatch to external mail address
#3
Moderator
Joined: 2006/12/13
From Tidewater Virginia, North America
Posts: 3404
You should be able to set an alternate account to get root's mail in /etc/aliases. Don't forget to run "newaliases" afterward so changes will take effect.
_________________
Phil
Required reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2009/11/5 12:57
Create PDF from Post Print
Top
  •  beckerde
      beckerde
Re: sending logwatch to external mail address
#4
Newbie
Joined: 2007/11/29
From
Posts: 6
Quote:

You should be able to set an alternate account to get root's mail in /etc/aliases.


This solves the automatic redirection of any mail to root to be sent to myaccount@mydomain.com.
But in the smtp session it still uses root@localhost.localdomain as MAIL From.

<smtp-session>

----- Transcript of session follows -----
... while talking to smtp.mydomain.com.:
>>> MAIL From:<root@localhost.localdomain> SIZE=581 AUTH=<>
<<< 550 5.7.1 Client does not have permissions to send as this sender
554 5.0.0 Service unavailable

--nA5DblUw023558.1257428267/localhost.localdomain
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Thu, 5 Nov 2009 10:37:44 -0300

Final-Recipient: RFC822; myaccount@mydomain.com
Action: failed
Status: 5.7.1
Diagnostic-Code: SMTP; 550 5.7.1 Client does not have permissions to send as this sender
Last-Attempt-Date: Thu, 5 Nov 2009 10:37:47 -0300

--nA5DblUw023558.1257428267/localhost.localdomain

</smtp-session>

thanks and regards.
Posted on: 2009/11/5 14:06
Create PDF from Post Print
Top
  •  beckerde
      beckerde
Re: sending logwatch to external mail address
#5
Newbie
Joined: 2007/11/29
From
Posts: 6
I solved it, but I did something nasty.
I first figured out from where sendmail is getting the server name, and it's getting it from /etc/hosts for 127.0.0.1, so I changed it to
127.0.0.1 mydomain.com localhost.localdomain localhost
The real server name in system-config-network remains untouched.
I also had to add an alias root@mydomain.com for myaccount@mydomain.com in my ISP service, so the ISP's smpt server doesn't reject the mail in the smtp session, because sendmail will issue "MAIL From: <root@mydomain.com>..." even when the real "From" inside the mail is another.
The sendmail.mc is the default one, with SMART_HOST and AUTH_OPTION properly configured, and the line LOCAL_DOMAIN(`localhost.localdomain')dnl commented or removed so it uses the hostname.
AuthInfo:xxx in /etc/mail/access so it's included in the next "service sendmail restart".
And it seems to be working so far.
It didn't break the other important services, a database server and ssh (I use ssh for sshfs to access some shared documents with encrypted network traffic).

If somebody sees something wrong is going to happen since that change in /etc/hosts please let me know.
Posted on: 2009/11/7 13:33
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com