Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how can to return error from custom mailer ?

11 views
Skip to first unread message

Sergey

unread,
Apr 4, 2016, 5:02:02 AM4/4/16
to
Hello.

I attempt to write sms mailer and I need to return tempfail to
Sendmail in some cases. Is it possible ?

I use MAILER(fax) with my FAX_MAILER_PATH/FAX_MAILER_ARGS and Perl.

--
Regards, Sergey

Andrzej Adam Filip

unread,
Apr 4, 2016, 5:22:37 AM4/4/16
to
Sergey <a_...@sama.ru> wrote:
> I attempt to write sms mailer and I need to return tempfail to
> Sendmail in some cases. Is it possible ?
>
> I use MAILER(fax) with my FAX_MAILER_PATH/FAX_MAILER_ARGS and Perl.

Make your mailer return 75 as exit code [ "exit(75);" in perl ]

https://www.freebsd.org/cgi/man.cgi?query=sysexits
> EX_TEMPFAIL (75) Temporary failure, indicating something that is not
> really an error. In sendmail, this means that a mailer (e.g.)
> could not create a connection, and the request should be
> reattempted later.


/usr/include/sysexits.h (on Linux/Debian):
#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */

--
[Andrew] Andrzej A. Filip - https://www.linkedin.com/in/andfil

Sergey

unread,
Apr 4, 2016, 6:05:57 AM4/4/16
to
Andrzej Adam Filip wrote:

>> I attempt to write sms mailer and I need to return tempfail to
>> Sendmail in some cases. Is it possible ?

>
> Make your mailer return 75 as exit code [ "exit(75);" in perl ]
>
> https://www.freebsd.org/cgi/man.cgi?query=sysexits
>
>> EX_TEMPFAIL (75) Temporary failure, indicating something that is not
>> really an error. In sendmail, this means that a mailer (e.g.)
>> could not create a connection, and the request should be
>> reattempted later.

Thanks ! It works.

--
Regards, Sergey

Andrzej Adam Filip

unread,
Apr 4, 2016, 6:09:18 AM4/4/16
to
Have to considered/tried to use LMTP for communication with sendmail?

It may make a lot of sense unless you want to keep your mailer simple.
https://en.wikipedia.org/wiki/LMTP

Sergey

unread,
Apr 4, 2016, 10:11:14 AM4/4/16
to
Andrzej Adam Filip wrote:

> Have to considered/tried to use LMTP for communication
> with sendmail ?

I think it is overhead for mail-to-SMS (GSM) gateway.
Mailer is simple and small (sms send by gnokii):

# egrep -v "^#|^$" mailer.sms.pl | wc -l
67

And I seems it works. I will publish it here in a few days
if problems are not found.

btw, for Claus. I found Sendmail's setup here:
http://dadv.livejournal.com/175951.html (on russian, sorry).
It link describe using MAILER(sms) and it would be useful,
but it needs patching the proto.m4 and adding sms.m4 based
on fax.m4. What about to add it to Sendmail's distro ?

--
Regards, Sergey

Andrzej Adam Filip

unread,
Apr 4, 2016, 10:33:38 AM4/4/16
to
Sergey <a_...@sama.ru> wrote:
> Andrzej Adam Filip wrote:
>
>> Have to considered/tried to use LMTP for communication
>> with sendmail ?
>>
>>It may make a lot of sense unless you want to keep your mailer simple.
>> https://en.wikipedia.org/wiki/LMTP
>
> I think it is overhead for mail-to-SMS (GSM) gateway.
> Mailer is simple and small (sms send by gnokii):
>
> # egrep -v "^#|^$" mailer.sms.pl | wc -l
> 67
>
> And I seems it works. I will publish it here in a few days
> if problems are not found.
>
> btw, for Claus. I found Sendmail's setup here:
> http://dadv.livejournal.com/175951.html (on russian, sorry).
> It link describe using MAILER(sms) and it would be useful,
> but it needs patching the proto.m4 and adding sms.m4 based
> on fax.m4. What about to add it to Sendmail's distro ?

You may use LOCAL_NET_CONFIG in sendmail.mc instead of patching proto.m4
It will insert your custom lines in sendmail.cf just after all pseudo
top level domains handlers.

https://www.sendmail.com/sm/open_source/docs/m4/non_smtp_config.html
0 new messages