Re: [SLE] Postfix question

From: Carlos E. R. (robin1.listas_at_tiscali.es)
Date: 09/24/04

  • Next message: James Knott: "Re: [SLE] Why logical volume?"
    To: suse-linux-e@suse.com
    Date: Fri, 24 Sep 2004 02:13:54 +0200
    
    

    On Thursday 23 September 2004 07:59, Bob S wrote:

    > On Tuesday 21 September 2004 19:39, Carlos E. R. wrote:
    > >The Tuesday 2004-09-21 at 02:05 -0400, Bob S wrote:
    >
    > ...............<snip all kinds of stuff throughout the message - Getting
    > awfully long> Hope that this has not made it too confusing though.

    Time ago the sign '>' was preceded with the initials of each correspondent.
    That method is customary in fidonet, for example. Pity current email clients
    do not support it well.

    By the way, I'm now using kmail in order to see how it is configured. Normally
    I use Pine - this demonstrates that it is possible to use a number of mail
    clients in Pine, sharing the folders.

    >
    > First of all at end of the last message Carlos asked about my system. (No
    > crystal ball) Anyway 8.2 with stock kernel 2.4 KDE 3.3 upgraded not too

    I was more interested in your network configuration. One computer or more,
    etc. But I think I don't need it now.

    Also I referred to the fact that looking at the /var/log/mail file a lot can
    be known about what is the problem/s. That is important.

    > long ago which has Kmail 1.7.

    I have suse 9.1 with defaults kde 3.2.1 and kmail 1.6.2

    > That is when problem with the outgoing mail
    > started. I have never ever set up a MTA (since SuSE 6 something) Always
    > used either Mozilla or Kmail. Kmail being my favorite and used now for
    > several years. When I received the returned mail and saw Postfix and
    > linux.localhost it surprised me and prompted my question for this thread. I
    > do remember though back about 7.2 or somewhere therein, I used to get root
    > messages in my mailbox. Have not now for quite a long time.

    Yes, you need the alias thing. Also, the default 'Inbox' of kmail does not
    read from system mail, it has to be added.

    Ok, instead of answering every question as they come, I'll try to clarify some
    of them.

    Read the following carefully.

    **** To avoid the error you were getting with suseconfig.
    =======================================

    My fault. I told you to edit postfix configuration files directly, and that
    has that side effect. You can undo the changes:

     nimrodel:/home/cer # cd /etc/postfix
     nimrodel:/etc/postfix # ls *SuSEconfig
     main.cf.SuSEconfig master.cf.SuSEconfig
     nimrodel:/etc/postfix #

    You see the files 'main.cf.SuSEconfig' and 'master.cf.SuSEconfig'. Those are
    the files SuSEconfig wants to activate, but has stopped short of doing it
    because it noticed _I_ modified 'main.cf' and 'master.cf' manually.
    Therefore, you choose: let suseconfig do its work, or do it yourself.

    I think you'd better choose suseconfig way, at least till you are confortable.
    Just copy the '*SuSEconfig' files over the modified '*' file. You'd better
    backup it before just in case.

    Then, we go to Yast, and configure mail the easy way:

    **** Yast
    ============

    Start "yast", go to "Network Services/ Mail Transfer Agent".

      Connection type : permanent.
      Enable Virus Scanning: you choose.
           Next

      Outgoing mail server
          None
               Masquerading - empty
                Authentification - empty

      Incoming mail - I'll paste it (use fixed width font to view):

    ┌Incoming Mail───────────────────────────────┐
    │[ ] Accept remote SMTP connections │
    │ ┌Downloading─────────────────────────────┐ │
    │ │Server Protocol │ │
    │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ AUTO▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ │
    │ │Remote user name Password │ │
    │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ │
    │ │Local user │ │
    │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ │
    │ │ [Details...] │ │
    │ └────────────────────────────────────────┘ │
    │Forward root's mail to │
    │bob▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ <====
    │Delivery Mode │
    │Through procmail▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │
    │ [Aliases...][Virtual domains...] │
    └────────────────────────────────────────────┘

    Don't define the downloading section, because you use KMail for that. Leave it
    empty.

    In virtual domains, you can define:

      your_email@yourisp.hisdomain bob

    In aliases, there will be many, but one of them will be:

      root bob

    which means that mail sent to 'root' will instead goes to 'bob'.

    Finally,type Finish.

    **** Some testing
    =================

    For these tests, we will use the system mail program, ie, a CLI. The program
    'mail' in Suse 8.2 and later is in fact 'nail'. Check it, typing 'man mail'
    will bring up nail's man page. It is a symlink.

    Do "sux -" on an xterm, or open a root console in kde's Konsole. Type:

    nimrodel:/etc/postfix # mail cer
    Subject: test
    hola
    . <==== the dot\n signals the end of the email.
    EOT
    nimrodel:/etc/postfix #
    nimrodel:/etc/postfix #
    You have new mail in /var/spool/mail/cer
    nimrodel:/etc/postfix #

    That is, send a manual email to yourself. If after a minute, when typing enter
    on bob's console (on any bob's console, in fact), you see the message that
    you have a new email, all is well - so far :-). You may try to send another
    to 'root', it should also appear there.

            You may or you may not see them using kmail, that is a different matter.
    Later.

    You may - no, do - check it looking at the '/var/log/mail' file. You will see
    entries from several postfix's processes, and perhaps amavis and/or
    spamassassin. The end will be something like:

    Sep 24 00:00:05 nimrodel postfix/local[9618]: 35DAA20D14:
    to=<cer@nimrodel.valinor>, orig_to=<root@nimrodel.valinor>, relay=local,
    delay=1, status=sent (delivered to command: /usr/bin/procmail)

    Sep 24 00:00:05 nimrodel postfix/qmgr[5286]: 35DAA20D14: removed

    Now, we try sending an email to "your_email@yourisp.hisdomain".

    nimrodel:/etc/postfix # mail your_email@yourisp.hisdomain
    Subject: Hello there!
    See me?
    .
    EOT
    nimrodel:/etc/postfix #
    You have new mail in /var/spool/mail/bob

    It will show in the log:

    Sep 24 00:09:32 nimrodel postfix/pipe[9797]: C765820D11:
    to=<cer@nimrodel.valinor>, orig_to=<robin1.listas@tiscali.es>, relay=vscan,
    delay=1, status=sent (nimrodel.valinor)

    ...

    Sep 24 00:09:32 nimrodel postfix/local[9802]: 341CD20D14:
    to=<cer@nimrodel.valinor>, relay=local, delay=0, status=sent (delivered to
    command: /usr/bin/procmail)

    Notice the first line of the two shows how it is redirected to a different
    address, ie, instead of going to your "external" address, it goes to your
    local one.

    **** Advanced settings, postfix.
    =================================

    If you need to tailor postfix settings without disturbing yast or suseconfig,
    just edit the file '/etc/sysconfig/postfix' instead, and later call
    suseconfig. Else, go to Yast/system/"/etc/sysconfig editor" -->

      Network/Mail/General
      Network/Mail/Postfix

    The entries are commented. In the '/etc/sysconfig/postfix' file, it is even
    possible to enter new settings; for example:

      POSTFIX_ADD_MESSAGE_SIZE_LIMIT="10240000"
      POSTFIX_ADD_BOUNCE_SIZE_LIMIT="4800"

    Trick:

    If you need verbose debug info in postfix, edit this in 'etc/postfix/main.cf':

      debug_peer_level = 2
      debug_peer_list = sanctum.com

    With this, conversations between your postfix server and that server will be
    logged VERY verbosely. Notice that if you have problems only with one remote
    server, you only need debug info for that one.

    **** Sending outside.
    ========================

    The settings I explained above are for postfix sending on its own (what your
    ISP said you might be trying to do). It works, unless some server thinks you
    are a spammer. So far, we have only tried to send locally. We can now try to
    send to an external address; if you have a secondary address (or a friend's -
    you can use me, but the delay is long), try it:

      mail -r "bob@fromaddress" bob@toaddress"

    Now, this may, or may not work. If it doesn't, the reason will be seen on the
    log file. However, it doesn't matter if your provider requires pop before
    smtp or whatever authentication, because you are bypassing them. Your DNS
    setting, however, does matter.

    Ok, so far, so good.

    If it doesn't work, I have to see the log.

    **** Configuration possibilities.
    ===================================

     1) Postfix may send directly, on its own, like above.

    The advantage is that you control it.

    The main disadvantage is that some servers outside will not accept your email.

    Depends on your case; for me it works, and in fact, I have to use it (easier
    method when having different accounts). For some people it may be very
    problematic.

     2) Postfix may send to another SMTP server, who will then send the email.

    This is a relay server. In this mode, we are not using the full capabilities
    of postfix, but it also has some advantages. In some cases, it can be a
    necessity, because the corporate network or the ISP has a firewall that
    blocks outgoing SMTP connections. In my opinion, it makes sense on a business
    (more control, no secrets given), but it is arguable for a provider (it makes
    life difficult for spammers, but you might want to use another server for
    your own reasons, like having several accounts).

     3) Your MUA (Kmail) may hand off mail to the localhost smtp server.

    If postfix is already configured, it makes life easier, all MUAs just use the
    local services. If you have a real domain name and several local users, this
    is the way to go, certainly. For a single account, it may be an overkill.

    It also depends on your preferences; this is the method I always use, and some
    people never use it. ¡You choose! :-)

     4) Your MUA (Kmail) may hand off mail to _any_ remote smtp server (unless
    your ISP blocks it).

    Limitations:
    -------------

    In case #4, options #1 and #2 do not matter.

    In case #3, if there are problems, the log file will tell me what exactly is
    going wrong. I can even increase verbosity as needed. With kmail (#4), my
    toolbox is more limited.

    In cases #2 and #4, you need to setup authentication. How?

    In case #4, some MUAs can first fetch mail, then send. However, postfix (#2)
    can not handle it. Otherwise, #2 and #4 should use login/password
    authentication.

    Auth #2 - For postfix, I already explained it. The login/pass pairs go into
    file '/etc/postfix/sasl_passwd':

      mail.remote.server user:pass

    After editing postfix databases files (like this), you need to update the
    binary database:

      postmap sasl_passwd

    and reload postfix (I think it will reload itself after sometime):

      rcpostfix reload

    Auth #4. Go to Settings/Configure Kmail, then Network, Sending tab. Chose
    modify or new (notice: you may set up several outgoing accounts: one may be
    local, another remote).

    You will have a dialog showing "Transport: smtp". The "general" tab will have
    something like:

    name: arbitrary
    host: mail.sanctum.com (or sanctum.com, as they say)
    port: 25
     X server requires authentication
        login whatever
        password whatever
     X store SMTP password in configuration file
                  (or it will ask for it every time)

    On the security tab, press the button "check what the server supports", it
    will tell you what to use.

    *** Well... what else?
    =======================

    I don't know, I hope this write up is prety much complete O:-)

    >
    > OK - Back to basics - Configuring Kmail -Let's forget about Postfix for
    > now!. Kmail - configure - Network - sending - When I set it for
    > smtp.sanctum.com When attempting to send a message I receive a message that
    > the server is unknown - When set for mail.sanctum.com or just sanctum.com
    > receive a message that the address for the recipient is unknown.

    Notice that this last error is very similar to the error you reported the
    first day. If it happens to every person you mail to, there is probably
    something wrong in kmail (at worst, a problem at your provider house: I don't
    believe it). If it is with only one person, that persons has problems, not
    you.

    I would setup kmail to send to localhost instead, and let postfix handle it.
    There is more control.

    > When
    > authentication for either of those addresses is added - Get message that
    > authentication failed, most likely the password. (password IS correct.)

    Who knows?

    Er... I think I'll skip the rest of your message, because I think most
    questions are covered above. I would be repeating myself.

    > >Don't touch that. To know what mails are in there, and why, use "mailq".
    > >If you need to hold, delete mails, use postsuper. If you want to have a
    > >look, use "mc" to browse files. If you want to read a mail that is there,
    > >use "postcat file".
    >
    > OK, for curiosity's sake, I went and browsed those directories.Out of the
    > hundred or more directories, there is not one mail in there. 0 -nothing -
    > only contains one pid file of 17 bytes.

    That's normal, 'mailq' showed nothing.

    >
    > >For example, "postcat -q 28D0720D17|less" displays my queued email (one)
    > >by that ID.
    >
    > Couldn't do that, nothing there. (have two messages in the outbox of Kmail
    > though)

    Ok, postfix will not see them.

    > >No. Unless you have configured postfix to relay to your ISP, and that is
    > >not the default config. It could be, but I doubt it.
    >
    > But, when I looked at main.cf it showed relay host=sanctum.com

    The space, as Patrick said.

    -- 
    Cheers,
           Carlos Robinson
    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: James Knott: "Re: [SLE] Why logical volume?"