View Single Post
  #6  
Old 23rd July 2007, 15:24
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
Default Another try

During my experiments to get to know Debian and ISPConfig I always login as root. If something goes really wrong, I just reinstall the OS.

In Terminal:
# which sendmail
/usr/sbin/sendmail

No luck: that's what is in my cgi script already.

I'll describe the working situation first.

SENDMAIL

Let's assume you own domain happydomain.com. Let's also assume that your ISP's outgoing mail server uses this smtp code: smtp.nicehost.com, and your email address is blah@nicehost.com.
Furthermore
user name: blahusername
password: blahpassword

Say you need an smtp server to send email through mail forms on your web page, hosted on your own server at home. If you want to use your ISP's smtp server you can do this with the help of smarthost.

The following configuration works flawlessly in Fedora Core 6 (FC6) with Sendmail:

In /etc/mail/sendmail.mc add these lines:

dnl MASQUERADE_AS('your.domain')dnl
define(`SMART_HOST',`your.smtp.server')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl

These lines have to be modified to look like:

dnl MASQUERADE_AS('happydomain.com')dnl
define(`SMART_HOST',`smtp.nicehost.com')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl

In order to authenticate to the email server of your ISP make sure to have the following line in the file /etc/mail/sendmail.mc:

FEATURE(`authinfo', `hash /etc/mail/authinfo')

and create this file:

/etc/mail/authinfo

with this inside:

AuthInfo:your.smtp.server "U:user@your.smtp.server" "I:user" "P: passwd" "M:LOGIN PLAIN"

where you modify this line to look like this:

AuthInfo:smtp.nicehost.com "U:user@smtp.nicehost.com" "I:blahusername" "P:blahpassword" "M:LOGIN PLAIN"

Now generate the sendmail.cf file using this command:
make -C /etc/mail

Create a file named: /etc/mail/genericstable
with this inside it: root user@domain.com
(do not replace user@domain.com with your own data)

Execute this:
makemap hash /etc/mail/genericstable < /etc/mail/genericstable

and run:

makemap hash /etc/mail/authinfo < /etc/mail/authinfo

and make authinfo readable only by root:
chmod 600 /etc/mail/authinfo

This did it for me. I can send emails using my ISP's outgoing mail server with my FC6 server.


POSTFIX

I have not been able, so far, to find instructions on the web how to configure Postfix in the same manner as Sendmail. Alright, I have modified a line in /etc/postfix/main.cf to look like: relayhost = smtp.nicehost.com, but my web form didn't execute anything besides telling me the mail was sent, which wasn't the case.

I'm not amazed that it doesn't work because no authentication method was set up.

Any suggestions how to get it working for Postfix?
Reply With Quote