Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SMTP for SMF...how to set this up?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Warhead
Tux's lil' helper
Tux's lil' helper


Joined: 09 Oct 2003
Posts: 122
Location: Verden, near Bremen, Germany

PostPosted: Thu Jul 19, 2007 9:08 pm    Post subject: SMTP for SMF...how to set this up? Reply with quote

Quick and dirty: I have installed the simple machines forum and now I need an MTA so the forum can send e-mails. Is there any LIGHTWEIGHT and EASY setup for this? I just have to be able to send e-mails via SMTP. No pop3, no ssl, no fancy stuff, just plain SMTP. I found nothing like that in the documentation pages and I am really lost, since I tried to configure netqmail, vpopmail and postfix, but none of it could be convinced to work.

Regards
Warhead
_________________
To Rome said Nero: "If to smoke you turn
I shall not cease to fiddle while you burn."
To Nero Rome replied: "Pray do your worst,
'Tis my excuse that you were fiddling first."
--Orm Pludge
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Thu Jul 19, 2007 9:27 pm    Post subject: Reply with quote

Setting up Postfix in five easy steps.

1. Remove USE flags you don't need and build Postfix
Code:
echo "mail-mta/postfix        -ldap -mysql -postgres -ssl -sasl" >> /etc/portage/package.use
emege postfix


2. edit /etc/mail/aliases and point root: to a local admin user (ie you) and run newaliases
Code:
vi /etc/mail/aliases
newaliases


3. Add these lines to the bottom of your /etc/postfix/main.cf and edit the two fields with <>
Code:
# local settings
myhostname = $<your_fully_qualified_host_name>
mydomain = $<your_domainname>
myorigin = $mydomin
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks_style = subnet
mynetworks = 127.0.0.0/8

smtpd_recipient_restrictions =
        reject_unknown_recipient_domain
        permit_mynetworks
        reject_unauth_destination
        permit


4. Add to default runlevel and start Postfix
Code:
rc-update add postfix default
/etc/init.d/postfix start


Dang that was only fours steps... well that's how easy it is. :)

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.


Last edited by kashani on Mon Oct 01, 2007 10:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
Warhead
Tux's lil' helper
Tux's lil' helper


Joined: 09 Oct 2003
Posts: 122
Location: Verden, near Bremen, Germany

PostPosted: Thu Jul 19, 2007 10:08 pm    Post subject: Reply with quote

Thanks for your quick answer.
I created a user called maildemon and then followed your steps. After all the postfix service starts but in the configuration of the forum I want to use I have to give the following information:
mailtype (set so smtp)
SMTPserver (i set that to localhost)
SMTPport (let that on 25)
smtp username (uses the name of my user there)
smtp password (was nut sure, used the accountpasword of the user)

When the forum tries to send an e-mail it fails with the error (according to the forums log):
Couldn't get mail server response codes

SO I guess I misconfigured something, but I do not see it.

Regards
Warhead
_________________
To Rome said Nero: "If to smoke you turn
I shall not cease to fiddle while you burn."
To Nero Rome replied: "Pray do your worst,
'Tis my excuse that you were fiddling first."
--Orm Pludge
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Thu Jul 19, 2007 10:43 pm    Post subject: Reply with quote

You shouldn't need any usernames and passwords to send mail. Try removing those.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Warhead
Tux's lil' helper
Tux's lil' helper


Joined: 09 Oct 2003
Posts: 122
Location: Verden, near Bremen, Germany

PostPosted: Thu Jul 19, 2007 11:18 pm    Post subject: Reply with quote

Well, partly a success...no error messages in the forum log, but none of the mails sent seem to arrive...

Regards
Warhead

PS I have found the content of the mails the forum was supposed to send in:
/var/spool/postfix/maildrop
Does postfix write a log, where I could see, what goes wrong?
_________________
To Rome said Nero: "If to smoke you turn
I shall not cease to fiddle while you burn."
To Nero Rome replied: "Pray do your worst,
'Tis my excuse that you were fiddling first."
--Orm Pludge
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Thu Jul 19, 2007 11:22 pm    Post subject: Reply with quote

Couple things to try.

mailq
This command will should you anything in Postfix's queue and the short reason why its there.

tail -n 500 /var/log/messages | less
Postfix is pretty good about logging why things went wrong.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Warhead
Tux's lil' helper
Tux's lil' helper


Joined: 09 Oct 2003
Posts: 122
Location: Verden, near Bremen, Germany

PostPosted: Thu Jul 19, 2007 11:42 pm    Post subject: Reply with quote

mailq tells me the mail system is down...
/var/log/messages reveals:

postfix/postdrop[11734]: warning: unable to look up public/pickup: No such file or directory

Regards
Warhead

PS: After rebooting my system, the mailservice seems to work. I guess there were some conflicts (I merged and unmerged several MTAs today). But it seems my problem is beyond configuring, bacause when I send a mail to e.g. my googlemail account, it gets bounced:

The IP you're using to send email is not authorized 550-5.7.1 to send email directly to our servers. Please use 550 5.7.1 the SMTP relay at your service provider instead.

PPS: Tried to create another googlemail account for the forum, but I am unable to send via this one to:

Ran into problems sending Mail. Error: 530 5.7.0 Must issue a STARTTLS command first
_________________
To Rome said Nero: "If to smoke you turn
I shall not cease to fiddle while you burn."
To Nero Rome replied: "Pray do your worst,
'Tis my excuse that you were fiddling first."
--Orm Pludge
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Fri Jul 20, 2007 5:37 pm    Post subject: Reply with quote

And you *thought* you wanted a nice and simple MTA. :)

There are a couple of solutions here and we're going to try the easiest one first. In your main.cf there is an example of how to set a relayhost.

Code:

# The relayhost parameter specifies the default host to send mail to
# no relayhost is given, mail is routed directly to the destination.
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]


So at the bottom or your config, I like having all my modifications at the bottom so I don't have to go looking through a large config for them, with the settings you added yesterday add this line. If you have comcast it's likely smtp.comcast.com and stuff like that.
Code:
relayhost = mailhost.yourisp.com


I don't remember if the above needs to be in [] or if you can skip them so keep an eye on the logs after you add it and have restarted Postfix. However your ISP might require you to authenticate before you can send email which is a more complicated config. That should show up in the logs as well so post back with any of that info if it fails.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum