LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-09-2008, 12:24 PM   #1
Lantzvillian
Member
 
Registered: Oct 2007
Location: BC, Canada
Distribution: Fedora, Debian
Posts: 210

Rep: Reputation: 41
SuSE Postfix not sending mail at all. Simple email script.


Hey everyone,
I have a simple script that opens a vpn connection, runs rsync, and closes the connection.

Now I want an email to be sent out everytime the backup is successful. The problem is that I am mind boggled by the documentation and howtos out there.. Thet all describe setting up a full time server. In Windoze with a 10 line vbs script I can have it chuck an email out to anyone.. In linux do I need to have it all configured? I tried using mutt/sendmail.. it just sends it to the box.. or doesn't send it at all.

Any suggestions? I tried bouncing it off of gmail to a gmail account, but no mamais whey.

Ronnie
 
Old 05-09-2008, 12:56 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,120

Rep: Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451
You don't need a full-time server to do this, but you DO need to tell postfix or sendmail where to send the messages. Otherwise, user@domain.com will just sit on your box, since it doesn't know where to go.

It can be as simple as (sorry, not familiar with postfix since I use sendmail).

DS=mail.relay.server (or the address of that server)

That line will tell the mail service to send the messages it gets, along to that relay server, which will send it out from there. That's the only part you need to configure. You would also have to set up a Windows server, and tell it what to do with email as well, so this isn't any different.

After that, instead of 10 lines of VBS, you can use:

mailx -s "Subject is" "text of message" user@domain.com
 
Old 05-09-2008, 01:19 PM   #3
Lantzvillian
Member
 
Registered: Oct 2007
Location: BC, Canada
Distribution: Fedora, Debian
Posts: 210

Original Poster
Rep: Reputation: 41
is what I followed for the most part.. This just seems like waaay too much work. I can't even tell if stuff si being sent now because there is nothing in my var/logs.

http://www.dcs.napier.ac.uk/~peter/linux/postfix.html
 
Old 05-09-2008, 01:43 PM   #4
Lantzvillian
Member
 
Registered: Oct 2007
Location: BC, Canada
Distribution: Fedora, Debian
Posts: 210

Original Poster
Rep: Reputation: 41
Here is a tail from the logs:

Code:
X-Postfix-Sender: rfc822; root@bsibackup1.site
Arrival-Date: Thu,  8 May 2008 10:51:11 -0700 (PDT)

Final-Recipient: rfc822; brashr@itas.ca
Action: failed
Status: 5.7.0
Remote-MTA: dns; smtp.gmail.com
Diagnostic-Code: smtp; 530 5.7.0 Must issue a STARTTLS command first.
    v25sm7956843wah.36

--1E33E9082F5.1210269072/bsibackup1.site
Content-Description: Undelivered Message
Content-Type: message/rfc822

Received: by bsibackup1.site (Postfix, from userid 0)
        id 1E33E9082F5; Thu,  8 May 2008 10:51:11 -0700 (PDT)
Date: Thu, 08 May 2008 10:51:11 -0700
To: brashr@itas.ca
Subject: Backup Report
User-Agent: Heirloom mailx 12.2 01/07/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <20080508175112.1E33E9082F5@bsibackup1.site>
From: root@bsibackup1.site (root)

shoes

--1E33E9082F5.1210269072/bsibackup1.site--
 
Old 05-09-2008, 01:55 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,120

Rep: Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451
Quote:
Originally Posted by Lantzvillian View Post
is what I followed for the most part.. This just seems like waaay too much work. I can't even tell if stuff si being sent now because there is nothing in my var/logs.

http://www.dcs.napier.ac.uk/~peter/linux/postfix.html
The outgoing stuff is going to be in your mail logs. And I'm not sure why editing a couple of config parameters in a text file is "waaaay too much work". If all you're going to do is shovel any mail messages along to another relay host, you just have to set up that one parameter. From looking at that same page, that would seem to be the "relayhost = ex-server1.napier.ac.uk" Set that to be the SMTP gateway for your ISP. That's it. You have to tell Windows where to forward messages too...

That doc set is pretty complete, but it goes into exchange servers, SASL, canonical name translation..all things that are way beyond what you're needing.

So set postfix to use a relay host, start postfix, then your mailx command will work.
 
Old 05-09-2008, 03:03 PM   #6
Lantzvillian
Member
 
Registered: Oct 2007
Location: BC, Canada
Distribution: Fedora, Debian
Posts: 210

Original Poster
Rep: Reputation: 41
Problem is I have done that relayhost. Restarted postfix after each change so thats out. It seems to me in the log that the relay isn't the problem if you look at my previous post.

I do know how to read, and I double checked that directive, but somethings off.
Heres part of the conf.
Code:
readme_directory = /usr/share/doc/packages/postfix/README_FILES
inet_protocols = all
biff = no
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
myhostname = bsibackup1.site
program_directory = /usr/lib/postfix
inet_interfaces = localhost
masquerade_domains = gmail.com
mydestination = $myhostname, localhost.$mydomain
defer_transports =
mynetworks_style = subnet
disable_dns_lookups = no
relayhost = smtp.gmail.com
mailbox_command =
mailbox_transport =
strict_8bitmime = no
disable_mime_output_conversion = no
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
strict_rfc821_envelopes = no
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtp_sasl_auth_enable = yes
smtpd_sasl_auth_enable = no
smtpd_use_tls = no
smtp_use_tls = no
alias_maps = hash:/etc/aliases
mailbox_size_limit = 0

Last edited by Lantzvillian; 05-09-2008 at 03:07 PM.
 
Old 05-09-2008, 03:28 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,120

Rep: Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451Reputation: 6451
Quote:
Originally Posted by Lantzvillian View Post
Problem is I have done that relayhost. Restarted postfix after each change so thats out. It seems to me in the log that the relay isn't the problem if you look at my previous post.

Code:
relayhost = smtp.gmail.com
mailbox_transport =
Ahh...I understand now. For me, I'm doing this on a corporate network, where my relay host doesn't require authentication, since we're going through the internal network/other proxy servers, to talk to the rest of the world.

I found this:

http://postfix.state-of-mind.de/patr...ilservers.html

That might help you out. It covers doing the SASL thing, and seems a bit easier to follow than the other link.

Sorry, I misunderstood your environment.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Blacklist Email Sending on Postfix carlosinfl Linux - Server 1 04-15-2010 04:14 PM
Postfix w/ spamassassin is sending extra copies of email nino_of_qubic Linux - Server 0 03-14-2008 03:48 PM
sending mail using postfix fakie_flip Linux - Software 5 12-31-2007 05:01 AM
Why is PostFix sending mail using the email address of the smtp account? taigon Linux - Server 34 02-09-2007 01:09 AM
Postfix mail transfer agent not sending mail locally or to other servers sketelsen Linux - Software 3 02-09-2006 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:28 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