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?
Recent comments
13 hours 52 min ago
20 hours 34 min ago
1 day 24 min ago
1 day 2 hours ago
1 day 10 hours ago
1 day 19 hours ago
1 day 20 hours ago
2 days 19 min ago
2 days 4 hours ago
2 days 5 hours ago