1

Topic: external smtp transport?

Hey I've recently installed iRedOS on a virtual machine, and am trying to configure it to send mail though my isp's smtp server.  I am quite new to mail servers in general and redmail and am wondering how (if?) it can be configured in the open source version.

Typically I have done mysql config setups for virtual domains where I configure things similar to this:

domain
localdomain.com
*

transport
:
smtp.myisp.com


Thanks in advance to any help someone might provide.

2

Re: external smtp transport?

Reference: http://www.postfix.org/postconf.5.html#relayhost

3

Re: external smtp transport?

Hey, thankyou for the reply.

Alright, so I have gone into main.cf and set

relayhost = smtp.mysip.net

and am getting "message failed to send" in roundcube.

/var/log/maillog gives...
Recipient address rejected: Domain not found;

Under my domain settings in postfixadmin I have my domain set up domain.com and have transport set to dovecot. (left it as default)

My other options there are virtual, local, and relay, seeing as how local mails will be sent locally and not through my isps external server, I'm not really sure what to do for this.

Thanks again

4

Re: external smtp transport?

So I can send mail from root using mail, but no luck on sending mail via roundcube yet.

5

Re: external smtp transport?

Hi.

create a /etc/postfix/transport :

company.com    :
.company.com   :
*            smtp:[smtp.isp.com]


in /etc/postfix/main.cf
add :
, hash:/etc/postfix/transport
to transport_maps

then :
postalias hash:/etc/postfix/transport
and restart postfix

no need to use the relayhost

6

Re: external smtp transport?

@saidmsl, Since per-user and per-domain transport support is supported in iRedMail, you can modify LDAP/SQL data directly, no hash file required.

Reference: http://www.iredmail.org/forum/topic334- … ution.html

7

Re: external smtp transport?

ZhangHuangbin wrote:

@saidmsl, Since per-user and per-domain transport support is supported in iRedMail, you can modify LDAP/SQL data directly, no hash file required.

Reference: http://www.iredmail.org/forum/topic334- … ution.html

Alright this is the information I'm looking for I think.
However, I'm running mysql, and I still don't understand how this works.

/etc/postfix/mysql_transport_maps_domain.cf

user        = vmail
password    = *****
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT transport FROM domain WHERE domain='%s' AND active='1'

saidsml's solution seems to be a system wide setting, which is fine, but if Redmail supports per-user and per-domain transport -- where do I fill this information in for each appropriate user or domain? mysql?

8

Re: external smtp transport?

Just set transport in transport column.
Per-user setting is set in vmail.mailbox table, transport column.

Order of tranports: per-user setting --> per-domain setting --> default transport set in postfix main.cf.

9

Re: external smtp transport?

ZhangHuangbin wrote:

Just set transport in transport column.
Per-user setting is set in vmail.mailbox table, transport column.

Order of tranports: per-user setting --> per-domain setting --> default transport set in postfix main.cf.

Oh well that was easy wink

I thought that the domain table was just for virtual email domains on the server, not for transport as well.

In case anyone out there is as dense as me...

I went into phpmyadmin, under vmail db, domain table, added a new row.
Under domain I put *, and under transport I put smtp:smtp.myisp.net.

This sets all non local mail to go out through my isp.

10

Re: external smtp transport?

vbundi wrote:
ZhangHuangbin wrote:

Just set transport in transport column.
Per-user setting is set in vmail.mailbox table, transport column.

Order of tranports: per-user setting --> per-domain setting --> default transport set in postfix main.cf.

Oh well that was easy wink

I thought that the domain table was just for virtual email domains on the server, not for transport as well.

In case anyone out there is as dense as me...

I went into phpmyadmin, under vmail db, domain table, added a new row.
Under domain I put *, and under transport I put smtp:smtp.myisp.net.

This sets all non local mail to go out through my isp.


Does the paid-for web interface tie this together with postfixadmin so I don't have to use 2 different tools to set up domains and their transports?

11

Re: external smtp transport?

Screenshots:

Per-domain transport/relay setting:
http://iredmail.googlecode.com/hg/screenshots/iredadmin/domain_profile_relay.png

Per-user transport/relay setting:
http://iredmail.googlecode.com/hg/screenshots/iredadmin/user_profile_relay.png

12

Re: external smtp transport?

Hi,

i tried your setup, but did not work, that's why i prefered to use a system wide settings
till i get more time to look into (it's a production server and could not prevent users from sending mails, they had to work)

13

Re: external smtp transport?

Hi,

What If I only want e-mail sent outside my localdomain to use the relay settings. Where do I set the smtp server ?

Thanks in advance.