LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   SuSE Postfix not sending mail at all. Simple email script. (https://www.linuxquestions.org/questions/linux-server-73/suse-postfix-not-sending-mail-at-all-simple-email-script-641084/)

Lantzvillian 05-09-2008 12:24 PM

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

TB0ne 05-09-2008 12:56 PM

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

Lantzvillian 05-09-2008 01:19 PM

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

Lantzvillian 05-09-2008 01:43 PM

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


TB0ne 05-09-2008 01:55 PM

Quote:

Originally Posted by Lantzvillian (Post 3148387)
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.

Lantzvillian 05-09-2008 03:03 PM

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


TB0ne 05-09-2008 03:28 PM

Quote:

Originally Posted by Lantzvillian (Post 3148504)
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.


All times are GMT -5. The time now is 03:53 PM.