Thursday, November 26, 2009

sending e-mails using an smtp server which only accepts from address which has "company.com"

The problem I was facing with sending mails using my smtp server was , that it did not accept mails which did not have an @"company.com" in its mailing address. Had to work a way around it in the submit.cf file.

Although am sure there are much more easier ways to do this, this is the best I could come up with :-)

cd /etc/mail/

there should be a submit.mc file . Please note that it is not suggested to edit the submit.cf/ sendmail.cf files directly , and instead use the .mc files for editing. The below settings had to be appaended into submit.mc file

MASQUERADE_AS(company-name.com')dnl
FEATURE(masquerade_envelope)dnl
MASQUERADE_DOMAIN(`localhost')dnl
MASQUERADE_DOMAIN(`localhost.localdomain')dnl
dnl
FEATURE(`msp', smtp-mail-server')dnl






After adding the changes. You will need to execute the command m4 submit.mc >submit.cf.


Please note that in order to use a machine as a client, you need not have the sendmail daemon running.

No comments:

Post a Comment