Results 1 to 9 of 9

Thread: Sending mail with Postfix - need help

  1. #1

    Question Sending mail with Postfix - need help

    Hi all. I apologize in advance for the length of this post, and yes, I realize this is an impossibly simple task I'm asking for help with, but I have tried, honest I have.

    I am dealing with my first Linux pc and learning has been a slow and sometimes painful experience, but I have managed to set up a "headless" file server using SuSe 11.1, and successfully set up a RAID 1 array to store all the data for two Vista clients that are also on the network. File sharing works great and I'm happy with that...BUT.

    All I want is some method for the Linux server to notify my Vista machine if one of the disks in the RAID dies. It seems like it should be incredibly simple to set up using mdadm, and in fact, I have managed to set up mdadm to automatically send email test messages to a local account. What I can't get working is the process of sending email to my "regular" email account, myname@bellsouth.net.

    I know there is a ton of stuff on how to accomplish this out on the 'net. I've read so many "how-to's" and tutorials on configuring Postfix that I've literally lost count days ago. Some of them were really good, some weren't so good but all were helpful to some degree. But I can't seem to send any type of email from the linux machine. I've tried so many hints and tips that I very well may have confuzzled the whole system where nothing will work even if I do it right at this point, but if so I don't mind (as a last resort) wiping the disk and reinstalling Linux from scratch. I've used a .forward file to forward root's email to my bellsouth address. I've used MAILADDR in the mdadm.conf file to point to the bellsouth address. Neither method works for me though.

    Here's what's happening at this point. Test emails sent from the Linux system to "myname@bellsouth.net" do not get delivered. BUT, I do get a bounce notification that IS delivered to the bellsouth.net account, which tells me that "bellsouth.net requires valid sender domain (in reply to RCPT TO command)".

    I have never messed with setting up a mail server of any type before this. And until 3 weeks ago had never messed with Linux at all. So I expect many of you are either shaking your heads in dismay or laughing your tails off at my ignorance, but I'm desperate .

    What is the simplest way to send notification to a client machine that there is a problem with the RAID array on the server? Is it email or is it something else? If it would be easier, I don't mind setting Outlook on my Vista machine to go fetch email from the server, but I haven't been able to configure it to do so, at least not yet.

    Most importantly, can someone please point me to the "best" how-to for a total beginner to set up whatever system is recommended?

    Sorry...I know this is long but I'm hoping someone will take pity on me. My head has been hurting for four days now from banging it against this particular brick wall and I am about ready to give it up. Except I'm too neurotic to admit defeat and this will bug me forever until I get it working.

    Thanks much,

    RJ

  2. #2

    Default Re: Sending mail with Postfix - need help

    OK I've done this only once...

    But is this a dynamic ip you're sending from? If so I got a feeling this is the problem and you need to find a way of sending it via elsewhere. Like through your ISP mail server.

    Hopefully what I've just typed makes a little sense to you, as like you when I did it my head was spinning, but I'm guessing you may of stumbled across this on your travels.

    What I found was one of my accs would bounce it but another wouldn't. It can also use the DNS server to do it but this will depend on the acc. Some email accs don't like it straight from dynamic IP's

    Hopefully I'm not barking up the wrong tree and if completely wrong someone else will point you in the right direction. But it certainly sounds like the trouble I encountered.

    I'm presuming that you can recieve mail at least.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  3. #3
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    1,770

    Default Re: Sending mail with Postfix - need help

    Here's what's happening at this point. Test emails sent from the Linux system to "myname@bellsouth.net" do not get delivered. BUT, I do get a bounce notification that IS delivered to the bellsouth.net account, which tells me that "bellsouth.net requires valid sender domain (in reply to RCPT TO command)".
    This means that your setup is correct and the test mail actually got sent to the bellsouth.net server. They rejected it because they found that a mail was received from a server with invalid domain - meaning, your server does not have a registered domain. Mail servers are generally set up to reject this sort of emails to avoid spam mails (Otherwise, theoretically anyone can send spam mails like this impersonating as someone else).

    You have to change the setup to connect to the ISP's SMTP port for sending mails, rather than through the Postfix program. (I don't know how to do it in your RAID configuration files, but someone else can help).
    openSUSE 12.3 (x86_64) with Kernel 3.7.10-1.16-desktop and KDE 4.11.2 on MacBook Pro
    Latest MS Windows version used: Win95

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Sending mail with Postfix - need help

    Most mail receiving servers are set up to reject mail from home connections because chances are they are hijacked PCs sending out spam. You wouldn't believe the amount of attempts from such machines until you see a log of a typical mail server. It is probably the single most effective spam block for a mail server and you don't even have to handle the mail, just to look at the sender's IP address.

    How does the receiving mail server know it's a home connection? ISPs voluntarily declare their dynamic ranges to various blacklists. Sometimes if they don't, those ranges are put in by volunteers anyway.

    So the upshot is, to get mail out from your machine, you should relay it to your ISP's mailserver. There's a postfix setting for the relay host you can set.

    Of course, malware is getting smarter too and starting to read mail program settings to discover the relay host setting. It's a never-ending arms race.

  5. #5

    Default Re: Sending mail with Postfix - need help

    Hi and thanks for the assistance everyone. I didn't do a great job of describing all the things I've attempted, because the post was already too long. But, the server is behind a router and the network has a static WAN IP. I have already set up "mail.bellsouth.net" (both with and without brackets around the name)as a relay host in the postfix main.cf file. Mail still bounces with the same error message whether I use the relay or not. My static IP address is assigned by bellsouth so this machine *should* be able to send via smtp to their servers, if I understand correctly.

    One thing that has me very confused is that the "bounced" messages seem to originate from the Linux box, and they are delivered to my external bellsouth.net email just fine. But if an automatically generated message like that gets delivered, why doesn't the original email? I'm sure I'm missing something obvious. And it's probably something I've done to myself by attempting to change configurations based on multiple online tutorials but without really knowing what I'm doing.

    Anyway, at this point my efforts are focused on simply sending email period. If I can make that work I'm not worried about mdadm...I can make it send notification to whomever I want. It just doesn't get delivered to any external email.

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Sending mail with Postfix - need help

    Sounds like a misconfiguration of postfix then.

    You should look at the mail headers, especially the Received: lines, those will tell you who handed what to who when. Also the mail log, /var/log/mail.

  7. #7

    Default Re: Sending mail with Postfix - need help

    Ken, thanks. I'll just keep looking for a tutorial that I can understand and follow and hope for the best.

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Sending mail with Postfix - need help

    The out-of-the box config for Postfix on openSUSE only needs a couple of setting changes for it to work as a forwarder. If you are massively changing main.cf, you are doing it wrong. Generally you only need to change a couple of things in /etc/sysconfig/postfix with YaST. These are:

    POSTFIX_RELAYHOST
    POSTFIX_ADD_MYNETWORKS_STYLE (if you need to send from other machines on your LAN, and also look at SMTPD_LISTEN_REMOTE, see below)

    And in /etc/sysconfig/mail:

    FROM_HEADER
    SMTPD_LISTEN_REMOTE

    This assumes you trust your LAN and you are behind a firewall. If mail is generated only from the machine itself, then you don't need to change POSTFIX_ADD_MYNETWORKS_STYLE or SMTPD_LISTEN_REMOTE. The FROM_HEADER is what sets your outgoing mail to a believable domain, rather than some random name assigned to your machine by DHCP. But that is overrriden by what your mail program uses anyway.

  9. #9
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    1,770

    Default Re: Sending mail with Postfix - need help

    One more point:
    Some ISP mail service do not "relay" your mails unless you have an agreement with them to do so. Also, they may need you to authenticate. (I don't know how that part is done in Postfix - I am not a Postfix expert ).

    Anyway, try sending it as suggested by ken_yap and then we will see.
    openSUSE 12.3 (x86_64) with Kernel 3.7.10-1.16-desktop and KDE 4.11.2 on MacBook Pro
    Latest MS Windows version used: Win95

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •