Proper edit of for port 587 + other

Discussion in 'Parallels Pro for Linux' started by AnthonyG@, Apr 3, 2009.

  1. AnthonyG@

    AnthonyG@ New Member

    Ok, I have gone over the forums here and noticed a couple of posts on changing the sendmail configuration to allow port 587. Since most ISP's block port 25, and port 587 is a secondary standard, I am looking to implement the change.

    Since the post regarding the change is 2-years old, I am seeking the proper way to make the change.

    I have tried to edit the file and enabled the line:

    DAEMON_OPTIONS('Port=submission, Name=MSA, M=Ea')dnl

    then restarted sendmail, I get a password prompt from Outlook when trying to send email. Before it would only attempt them come back with an error stating it couldn't send. I tried a few different settings within Outlook to no avail. I also did a send from another account I have via earthlink to my mail server, and it was rejected as port 25 was no longer open. I went back in, dnl'd the line back out, restarted sendmail, did a test and was back to square one (email from outside sources accepted, but cannot send due to port 25 block by Cox).

    What I need to do is enable port 587 so that any client can send through it, and I would also like to enable port 3535 as an alternate config for some clients. What is the proper way to edit to allow this? I know on my prior config, which was done through directly, whenever the server was rebooted the settings were lost. I need to always ensure 25, 587 and 3535 are always open for my clients, regardless if the system is rebooted.

    One thing I did notice, maybe this is ProX specific, is that the "only listen on IPv4 loopback (" is enabled by default! Now I was thinking this had to do with mailscanner to prevent circumventing things, but I am not sure. Want to make sure mailscanner is doing it's job, and still accepting emails from listed ports.
  2. xtcweb

    xtcweb New Member

    Make sure you have both of these lines in your
    DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
    DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
    That should be it.
  3. cepheid

    cepheid Kilo Poster

    I was able to set my sendmail to work with both ports 25 and 587 by following the instructions from this board and from another Ensim board (maybe at theplanet? not sure).

    After you enable port 587, you must explicitly enable port 25 as well, as follows:
    DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
    dnl The following is required to ensure that sendmail still listens on 25!
    DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl

    Not sure how to go about adding a third port, although I'm sure it requires another DAEMON_OPTIONS line similar to the above, where you specify Port=3535 and possibly a different Name. That isn't ensim-specific, though, and you can probably find it on Google in any number of places.

    Hope this helps.
  4. AnthonyG@

    AnthonyG@ New Member

    Here are the changes I have made:

    dnl'd the local loopback address, which was enabled:
    dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl

    created the suggested:
    DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl

    also enabled port 587 line a bit farther down.

    Did a Make -C /etc/mail
    then m4 /etc/mail/ > /etc/mail/ to make sure
    then shutdown MailScanner and sendmail, issued a kill command for sendmail to make sure, then restarted both services.

    When the client tries to send email to server, it comes back with logon rejected (800ccc92) and keeps prompting me for a password. When I tried to send an email via another account to server it comes back with: 554 5.3.5 buildaddr: unknown mailer virthostmail - in body of message (bounce).

    Now I checked the ports via netstat to ensure they are open (already open on firewall), and it is showing the following as open and listening, but nothing is transversing:

    tcp 0 0 *:submission *:* LISTEN 18588/sendmail: sm-
    tcp 0 0 *:ms-la *:* LISTEN 18588/sendmail: sm-
    tcp 0 0 *:smtp *:* LISTEN 18588/sendmail: sm-

    and via lsof

    sendmail 18588 root 4u IPv4 307212 TCP *:smtp (LISTEN)
    sendmail 18588 root 5u IPv4 307213 TCP *:ms-la (LISTEN)
    sendmail 18588 root 6u IPv4 307214 TCP *:submission (LISTEN)

    So it may be listening now, but it's not finding users? This was a clean install, and only file I have edited was to re-enable the ports I needed. So why the headaches?
  5. cepheid

    cepheid Kilo Poster

    Don't use /etc/mail/ Use /usr/lib/opcenter/sendmail/install/ ... that's the proper Ensim file. Make your edits there. I also wouldn't disable the local loopback address as I believe Ensim needs it to handle mail from virtual hosts.

    After editing in the directory above, do the m4 command, then simply "service sendmail restart" and you're done.
  6. AnthonyG@

    AnthonyG@ New Member

    Resolved: Edit for port 587 + other

    Cepheid your a genius! Going to post full directions for anyone else who may need them in future.

    Ok, went into appropriate directory, /usr/lib/opcenter/sendmail/install/

    cp (make a backup)

    pico -w (or your favorite text editor)

    Scroll part of way down until you find line "dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl"

    Create entries under that one. I created two as when I added alternate, it stopped listening to port 25. Port XXXX would be any alternate port you might specify, thus circumventing any block on port 25 most ISP's utilize. Port 25 still needs to be open for other domains to send email to your server.

    DAEMON_OPTIONS(`Port=25, Name=MTA')dnl
    DAEMON_OPTIONS(`Port=XXXX, Name=MTA')dnl

    A bit farther down I enabled port 587 for Outlook and some other clients. This also circumvents port 25 blocking, and is an acceptable port.

    Find "dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea")dnl"

    remove the dnl from front of line

    DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea")dnl

    Now I am not 100%, but I could probably make port XXXX listed above under the same listing (MSA) to force authentication of anyone sending email, but the only reason port XXXX is included is for those email clients who can't authenticate and send directly, that would normally send via port 25. I just opened an additional port to make it easier for them; ie: Outlook Express clients.

    After you complete, save the file. then issue

    m4 > /etc/mail/

    This will create the .cf file in the correct directory for sendmail (under RHEL5 or similar environments).

    then issue commands to stop sendmail and MailScanner

    service sendmail stop
    service MailScanner stop

    Issued a kill command just in case:

    killall -HUP sendmail

    I sent system through maintenance mode, to update other sites in system with changes. I did notice that sites had their own sendmail directories.

    service epld restart

    This will also start sendmail and MailScanner as well, so no need to issue separate commands to restart those services.

    Now your system should be listening on 25, XXXX and 587 for mail. To check:

    lsof +M -i4

    You will get feedback as such, or similar (plus other data, truncated for this post):

    sendmail 7931 root 4u IPv4 199837 TCP *:ms-la (LISTEN)
    sendmail 7931 root 5u IPv4 199838 TCP *:smtp (LISTEN)
    sendmail 7931 root 6u IPv4 199839 TCP *:submission (LISTEN)

    Make sure your firewall has the XXXX port open, and port 587 if you enabled it. You can check if your system is accepting connections from other mailservers (not clients) by using MXToolbox's diagnostic. This will only tell you if port is open, not validate your server is actually accepting email. I would suggest sending a message from another provider (hotmail, yahoo, etc) to an address on your server to see if it bounces back, but if you followed the directions above, all should be working 100%.

    You can also check the port by using telnet. Telnet to your servers IP and each respective port you opened. You should get a response back from the IP+port.

    Again, thanks Cepheid for the correct directory to edit for Parallels ProX 10 environment.

    Keywords: sendmail,,, alternate port, 25 blocked, port 587, alternate smtp port, ProX 10, Parallels
  7. zaph

    zaph New Member

    I would add a change to that. Don't edit

    Copy to another file (for example we use, and edit the COPY. Ensim/Parallels often overwrite the file when the CP is updated.

Share This Page