Thursday, June 16, 2011

How to deliver mail to destination on different port (other than 25) using sendmail

Ramesh Dasari
- Messaging and Microsoft Unified Communications - Public - Muted

I have came across this requirement for a client PoC. Requirement is to setup a route in sendmail for a subdomain (abcd.ourdomain.com) to deliver mails to the project team's SAP server, which is...I have came across this requirement for a client PoC. Requirement is to setup a route in sendmail for a subdomain (abcd.ourdomain.com) to deliver mails to the project team's SAP server, which is running it's built-in SMTP service on port 24999 rather than on port 25 (this is default design because SAP developers wanted SAP not be be used as a MTA). As we know already, sendmail will deliver the mail to destination mentioned in mailertable on port 25 by default.

But, as project team, can't change the port in SAP, we wanted to modify sendmail configuration such that it delivers mails to SAP server on port 24999. I went through sendmail cookbook earlier so suddenly i came to know that we can use a different mailer (the mail delivery agent) i.e., we can create a new mail delivery agent (sendmail allows us to create and use multiple delivery agents).
Here is the definition i have added to sendmail.mc (all steps).

# vi /etc/mail/sendmail.mc
define(`confSAPRELAY_MAILER', `esmtp')
define(`SAPRELAY_MAILER_ARGS', `TCP $h 24999')
Equivalent sendmail.cf line after generating new sendmail.cf file using m4 is
Msaprelay, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990, T=DNS/RFC822/SMTP, A=TCP $h 24999

# vi /etc/mail/mailertable
abcd.ourdomain.com saprelay:[abcd.ourdomain.com]
# make -C /etc/mail
# service sendmail restart

After restarting service, and sending a test mail, mail is delivered to SAP server on port 24999.

Happy Learning,
Ramesh  <mailto.d.ramesh@gmail.com>,

Thursday, June 2, 2011

Changing the Default Location for .OST and .PST Files

By default, Outlook places each Offline Folders (.ost) file and Personal Folders (.pst) file that it creates in the %userprofile%\Local Settings\Application Data\Microsoft\Outlook folder. This setting allows you to change the default behavior and store the files in any folder.

Open your registry and find the appropriate key below.

  • Outlook 2010 - [HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook]

  • Outlook 2007 - [HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook]

  • Outlook 2003 - [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook]

  • Outlook XP - [HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook]

  • Outlook 2000 - [HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook]



  • Create a new REG_EXPAND_SZ (Expandable String) value called 'ForcePSTPath' and set it to equal the full path of the required personal folder directory (e.g. "C:\Mailbox").

    Restart Outlook for the change to take effect.

    Note: This is a expandable string value so you can use environment variables, such as %userprofile%, to specify the path. When the value does not exist the default value of "%userprofile%\Local Settings\Application Data\Microsoft\Outlook" is used.

    Registry Settings
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook]
    Value Name: ForcePSTPath
    Data Type: REG_EXPAND_SZ (Expanded String Value)
    Value Data: Full path to personal folder directory (Ex: D:\PSTs)