SMTP

24 views
Skip to first unread message

ll...@writersglen.com

unread,
May 6, 2012, 2:14:59 PM5/6/12
to Zotonic Users
Hello,

Does anyone have experience with the SMTP server in Zotonic?

Michael Connors has been helping me with my blog, lloydrprentice.com. For some reason the contact function isn't working. Here's his note:

"Zotonic smtp server runs on 2525, and is running. If I use it directly in
telnet, the mail also disappears. It appears the issue is in the smtp
server, or something external."

We've checked for possible blacklisting, but the IP address is clean.

We're just checking here to determine if there are any known issues.

Many thanks,

Lloyd


*********************************************
My books:

THE GOSPEL OF ASHES
Strength is not enough. Do they have the courage and the
cunning? Can they survive long enough to save the lives
of millions - Coming Soon

FREEIN' PANCHO
It takes a community to help a troubled boy find his way

AYA TAKEO
Star-crossed love, war and power in an alternative universe

Available through Amazon or by request
from your favorite bookstore

Websites:

thegospelofashes.com
freeinpancho.com
ayatakeo.com

**********************************************

Andreas Stenius

unread,
May 6, 2012, 3:00:21 PM5/6/12
to zotoni...@googlegroups.com
Is this for outgoing or incoming mail?

I've used it for outgoing without issues for some time now (6 months+)
with moderate traffic (~5 - 50 mails/day, by a quick estimate looking
over the logs).
This is running on a bit older version, though (from late october).

Best,
Andreas

2012/5/6 <ll...@writersglen.com>:

Michael Connors

unread,
May 6, 2012, 3:36:36 PM5/6/12
to zotoni...@googlegroups.com
Hi Andreas,

On 6 May 2012 21:00, Andreas Stenius <andreas...@astekk.se> wrote:
Is this for outgoing or incoming mail?

I've used it for outgoing without issues for some time now (6 months+)
with moderate traffic (~5 - 50 mails/day, by a quick estimate looking
over the logs).
This is running on a bit older version, though (from late october).

It is the 0.8 version of Zotonic. I have installed postfix now so we don't need it anymore, but it is probably worth looking into it anyway. 

Below is a telnet session with the Zotonic smtp server, it appears to be handling the email, it just never shows up at the other side and is not in the spam folder. Are there any logs to see retries and failures?

Thanks,
Michael


zotonic@fromtheglen:~$ telnet 127.0.0.1 2525
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 fromtheglen ESMTP Zotonic 0.8-dev
helo test
250 fromtheglen
250 sender Ok
250 recipient Ok
data
354 enter mail, end with line containing only '.'
testing the mail server
.
250 queued as 7b4849329826a994fde8dfa652853996

Marc Worrell

unread,
May 6, 2012, 3:43:12 PM5/6/12
to zotoni...@googlegroups.com
Hi Michael,

What you test there is the incoming mail server. For the contact form you only need outgoing e-mail.

Tomorrow I can give you the detailed config and some more explanation about the incoming server.

Best,

Marc 

Sent from my iPhone

Michael Connors

unread,
May 6, 2012, 3:52:09 PM5/6/12
to zotoni...@googlegroups.com

Hi Michael,

What you test there is the incoming mail server. For the contact form you only need outgoing e-mail.

Tomorrow I can give you the detailed config and some more explanation about the incoming server.


Thanks Marc,

I had not realised incoming/outgoing were different. Good to know, I was worried that it was an open relay by default.

Michael

ll...@writersglen.com

unread,
May 6, 2012, 5:08:15 PM5/6/12
to zotoni...@googlegroups.com
Thanks, Marc and Andreas,

Look forward to the config and incoming info.

All the best,

Lloyd

Marc Worrell

unread,
May 7, 2012, 4:46:30 AM5/7/12
to zotoni...@googlegroups.com
Hi,


Here is some more information about the configuration of SMTP for Zotonic.

From priv/config.in I have copied the interesting bits and copied them below.

The following are for SENDING e-mail:

 %% SMTP outbound relay configuration
 % {smtp_relay, true},
 % {smtp_host, "localhost"},
 % {smtp_port, 2525},
 % {smtp_ssl, true},

These define how to send your e-mail from Zotonic to other people.
Normally, when you don't set anything, Zotonic will use its own SMTP client for sending e-mail.
This works well and is the recommended way.

Only when you have to use your ISPs e-mailer or another SMTP server for sending e-mail you should start using an smtp_relay.

Sometimes an ISP blocks outgoing port 25 traffic, to stop spambots on PCs from sending e-mail.
And sometimes the IP range your server is in is mentioned on a blacklist.

In both cases you can enable the {smtp_relay, true} option and set the relevant bits.

 %% SMTP extra relay options:
 %% some picky/buggy/misconfigured relays might need one of these to be enabled
 % {smtp_no_mx_lookups, false},
 % {smtp_verp_as_from, false},
 % {smtp_bounce_email_override, "m...@example.com"},

These are only needed when you have problems sending e-mail through your SMTP server.
You will see appropriate errors in the e-mail log in the admin.

 %% SMTP mail queue
 %% How long to keep sent messages in the mail queue (in minutes)
 %% Leave it long enough to receive any bounce message
 % {smtp_delete_sent_after, 240},

When an e-mail is send we might need to resent it when a recoverable failure happens at the receiving party.
This setting tells how long we will keep your sent e-mail around, waiting for an error from the recipient.
After this period we will dispose your sent e-mail and are not able to re-sent it because of an error.

 %% SMTP debug options
 %% Send a copy of outgoing mail to this address
 % {smtp_bcc, "bcc@localhost"},

Useful for debugging, receive a copy of all outgoing e-mail.

 %% Send all mail to this address instead of the original recipient
 % {email_override, "override@localhost"},

Useful for development. 
This will override the original recipient of any outgoing e-mail message and instead sent it to this e-mail address.
We use it when we have a copy of a database and want to prevent to send any e-mail to people from this copy or development system.


For receiving e-mail we have the following:

 %% SMTP Inbound Server Options 
 %% Always overruled by the environment variables ZOTONIC_SMTP_LISTEN_DOMAIN, ZOTONIC_SMTP_LISTEN_IP and ZOTONIC_SMTP_LISTEN_PORT
 % {smtp_listen_domain, undefined},
 % {smtp_listen_ip, "127.0.0.1"},
 % {smtp_listen_port, 2525},

These settings are for RECEIVING e-mail from other systems by Zotonic.
Normally we listen on all IP addresses, port 2525 for incoming e-mail.

Using firewall rules (or other methods) you can redirect incoming traffic for port 25 to 2525 and start receiving e-mail.
You will need modules to handle the incoming e-mail.
When no module is enabled then all incoming e-mail is simple "black-holed" (ie. discarded) without any bounce message at all.

Example incoming e-mail modules are:

mod_email_relay
Relays e-mail send to an user's name to that user's e-mail address.
Other e-mail is discarded.

mod_email_receive
Adds infrastructure to generate unique e-mail addresses and register handlers for incoming e-mail on those addresses.
Check the notifications:
#email_ensure_handler{}, #email_add_handler{} and #email_drop_handler{}.

Please note that I am planning to refactor the message format for these handlers and the received e-mail.


Best,

Marc

ll...@writersglen.com

unread,
May 7, 2012, 10:56:41 AM5/7/12
to zotoni...@googlegroups.com
Thank you, Marc!

Do we have documentation for the mailing list module anywhere?

LRP

Reply all
Reply to author
Forward
0 new messages