S:MAIL FROM: <postmaster@example.com>
R:250 2.1.3 postmaster@example.com sender ok
S:RCPT TO: <webmaster@example.com>
-R:250 5.6.6 Address will be processed <webmaster@example.com>
+R:250 5.6.7 Address will be processed <webmaster@example.com>
S:RCPT TO: <postmaster@example.com>
-R:250 5.6.6 Address will be processed <postmaster@example.com>
+R:250 5.6.7 Address will be processed <postmaster@example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:MAIL FROM: <postmaster@example.com> SIZE=1024
R:250 2.1.3 postmaster@example.com sender ok
S:RCPT TO: <user1@mailref1.example.com>
-R:250 5.6.6 Address will be processed <user1@mailref1.example.com>
+R:250 5.6.7 Address will be processed <user1@mailref1.example.com>
S:RCPT TO: <user2@mailref1.example.com>
-R:250 5.6.6 Address will be processed <user2@mailref1.example.com>
+R:250 5.6.7 Address will be processed <user2@mailref1.example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:MAIL FROM: <trouble@mailref1.example.com>
R:250 2.1.3 trouble@mailref1.example.com sender ok
S:RCPT TO: <webmaster@example.com>
-R:250 5.6.6 Address will be processed <webmaster@example.com>
+R:250 5.6.7 Address will be processed <webmaster@example.com>
S:RCPT TO: <user1@mailref1.example.com>
-R:250 5.6.6 Address will be processed <user1@mailref1.example.com>
+R:250 5.6.7 Address will be processed <user1@mailref1.example.com>
S:RCPT TO: <user1@posdb.example.com>
-R:250 5.6.6 Address will be processed <user1@posdb.example.com>
+R:250 5.6.7 Address will be processed <user1@posdb.example.com>
S:RCPT TO: <user1@mardb.example.com>
-R:250 5.6.6 Address will be processed <user1@mardb.example.com>
+R:250 5.6.7 Address will be processed <user1@mardb.example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:MAIL FROM: <trouble@mailref1.example.com>
R:250 2.1.3 trouble@mailref1.example.com sender ok
S:RCPT TO: <user1@mailref1.example.com>
-R:250 5.6.6 Address will be processed <user1@mailref1.example.com>
+R:250 5.6.7 Address will be processed <user1@mailref1.example.com>
S:RCPT TO: <user2@mailref1.example.com>
-R:250 5.6.6 Address will be processed <user2@mailref1.example.com>
+R:250 5.6.7 Address will be processed <user2@mailref1.example.com>
+S:RCPT TO: <no-one@example.com>
+R:551 5.6.0 <no-one@example.com> unknown user
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:MAIL FROM: <postmaster@mailref1.example.com>
R:250 2.1.3 postmaster@mailref1.example.com sender ok
S:RCPT TO: <user2@mailref1.example.com>
-R:250 5.6.6 Address will be processed <user2@mailref1.example.com>
+R:250 5.6.7 Address will be processed <user2@mailref1.example.com>
S:RCPT TO: <user1@mailref1.example.com>
-R:250 5.6.6 Address will be processed <user1@mailref1.example.com>
+R:250 5.6.7 Address will be processed <user1@mailref1.example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:MAIL FROM: <postmaster@example.com>
R:250 2.1.3 postmaster@example.com sender ok
S:RCPT TO: <utf8-áö_üñ@example.com>
-R:250 5.6.6 Address will be processed <utf8-áö_üñ@example.com>
+R:250 5.6.7 Address will be processed <utf8-áö_üñ@example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:MAIL FROM: <trouble@mailref1.example.com>
R:250 2.1.3 trouble@mailref1.example.com sender ok
S:RCPT TO: <user1@posdb.example.com>
-R:250 5.6.6 Address will be processed <user1@posdb.example.com>
+R:250 5.6.7 Address will be processed <user1@posdb.example.com>
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
D:Subject: (feed006) A email to a not existing user after authentication
S:MAIL FROM: <trouble@mailref1.example.com>
R:250 2.1.3 trouble@mailref1.example.com sender ok
S:RCPT TO: <user1@posdb.example.com>
-R:250 5.6.6 Address will be processed <user1@posdb.example.com>
+R:250 5.6.7 Address will be processed <user1@posdb.example.com>
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
D:Subject: (feed006) A email to a not existing user after authentication
S:MAIL FROM:<supertool@mxtoolboxsmtpdiag.com>
R:250 2.1.3 supertool@mxtoolboxsmtpdiag.com sender ok
S:RCPT TO: <webmaster@example.com>
-R:250 5.6.6 Address will be processed <webmaster@example.com>
+R:250 5.6.7 Address will be processed <webmaster@example.com>
S:RCPT TO:<test@mxtoolboxsmtpdiag.com>
-R:555 2.7.0 No MX nor IP for for domain <mxtoolboxsmtpdiag.com>
+R:555 2.8.0 No MX nor IP for for domain <mxtoolboxsmtpdiag.com>
S:RCPT TO: <user1@posdb.example.com>
-R:555 2.7.0 No relay accepted for domain <posdb.example.com>
+R:555 2.8.0 No relay accepted for domain <posdb.example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:MAIL FROM:<nobody@gmail.com> SIZE=2958
R:250 2.1.3 nobody@gmail.com sender ok
S:RCPT TO:<user1@mailleur.example.com>
-R:250 5.6.6 Address will be processed <user1@mailleur.example.com>
+R:250 5.6.7 Address will be processed <user1@mailleur.example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:RCPT TO: <user1@subdom0.example.com>
R:563 5.6.4 No valid MX found for recipient domain name (domain=subdom0.example.com)
S:RCPT TO: <user1@mailref1.example.com>
-R:250 5.6.6 Address will be processed <user1@mailref1.example.com>
+R:250 5.6.7 Address will be processed <user1@mailref1.example.com>
S:QUIT
R:221 2.0.0 Bye, closing connection...
#-------------------------------------------------------------------------
S:RCPT TO: <dom1user3@example.com>
R:551 5.6.5 <dom1user3@example.com> unknown user
S:RCPT TO: <dom1user3@mailref1.example.com>
-R:250 5.6.6 Address will be processed <dom1user3@mailref1.example.com>
+R:250 5.6.7 Address will be processed <dom1user3@mailref1.example.com>
S:RCPT TO: <user1@posdb.example.com>
-R:250 5.6.6 Address will be processed <user1@posdb.example.com>
+R:250 5.6.7 Address will be processed <user1@posdb.example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
S:MAIL FROM: <postmaster@example.com>
R:250 2.1.3 postmaster@example.com sender ok
S:RCPT TO: <root@example.com>
-R:250 5.6.6 Address will be processed <root@example.com>
+R:250 5.6.7 Address will be processed <root@example.com>
S:RCPT TO: <jmp@example.com>
-R:250 5.6.6 Address will be processed <jmp@example.com>
+R:250 5.6.7 Address will be processed <jmp@example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
return (contact->privilege==rel_authentic);
#undef DISP
+#undef OPEP
+}
+/*
+\f
+*/
+/************************************************/
+/* */
+/* Procedure to report rcpt problem and */
+/* store status within the database. */
+/* */
+/************************************************/
+static void note_rcpt(CONTYP *contact,char *rcpt,int smtpcode,char *fmt,...)
+
+{
+#define OPEP "lvleml.c:note_rcpt,"
+
+va_list args;
+char **resp;
+char *report;
+char *info;
+ACTTYP action;
+
+va_start(args,fmt);
+resp=(char **)0;
+(void) rou_vasprintf(&report,fmt,args);
+(void) rou_asprintf(&info,"%d %s",smtpcode,report);
+resp=(char **)rou_addlist((void **)resp,(void *)info);
+(void) memset(&action,'\000',sizeof(ACTTYP));
+action.sessid=contact->session->sessid;
+action.code='X';
+action.reverse=contact->peername;
+action.sfrom=contact->mailfrom;
+if (contact->session->hfrom!=(char *)0)
+ action.hfrom=contact->session->hfrom;
+if (contact->session->hsubject!=(char *)0)
+ action.hsubject=contact->session->hsubject;
+action.rcptto=rcpt;
+action.resp=resp;
+if (sql_mngact(contact->sqlptr,&action)==false)
+ (void) rou_alert(0,"%s unable to store report within database (bug?",OPEP);
+(void) eml_transmit(contact,true,"%s",info);
+resp=(char **)rou_freelist((void **)resp,(genfree_t)rou_freestr);
+report=rou_freestr(report);
+va_end(args);
+
#undef OPEP
}
/*
switch (phase) {
case 0 : //is user a local user
if ((sql_mngusr(contact->sqlptr,sql_select,rcptto,&usr))==false) {
- (void) eml_transmit(contact,true,"%d 5.6.5 <%s> unknown user",
- UKNUSER,rcptto);
+ (void) note_rcpt(contact,rcptto,UKNUSER,"5.6.0 <%s> unknown user",rcptto);
phase=999; //No user found in database
}
break;
case 1 : //is user lock?
if (usr->lock==1) {
- (void) eml_transmit(contact,true,"%d 5.6.6 <%s> account lock",
- EXPIRED,rcptto);
+ (void) note_rcpt(contact,rcptto,EXPIRED,"5.6.1 <%s> account lock",rcptto);
phase=999; //No user found in database
}
break;
default : //SAFE Guard
if (remotegood==false) {
- (void) eml_transmit(contact,true,"%d 2.7.0 %s for domain <%s>",
+ (void) eml_transmit(contact,true,"%d 2.8.0 %s for domain <%s>",
NORELAY,cmt,rmtusr->domain);
}
proceed=false;
*/
/************************************************/
/* */
-/* Procedure to report rcpt problem and */
-/* store status within the database. */
-/* */
-/************************************************/
-static void note_rcpt(CONTYP *contact,char *rcpt,int smtpcode,char *fmt,...)
-
-{
-#define OPEP "lvleml.c:note_rcpt,"
-
-va_list args;
-char **resp;
-char *report;
-char *info;
-ACTTYP action;
-
-va_start(args,fmt);
-resp=(char **)0;
-(void) rou_vasprintf(&report,fmt,args);
-(void) rou_asprintf(&info,"%d %s",smtpcode,report);
-(void) rou_alert(0,"JMPDBG info=<%s>",info);
-resp=(char **)rou_addlist((void **)resp,(void *)info);
-(void) memset(&action,'\000',sizeof(ACTTYP));
-action.sessid=contact->session->sessid;
-action.code='X';
-action.reverse=contact->peername;
-action.sfrom=contact->mailfrom;
-action.hfrom="----";
-action.hsubject="----";
-if (contact->session->hfrom!=(char *)0)
- action.hfrom=contact->session->hfrom;
-if (contact->session->hsubject!=(char *)0)
- action.hsubject=contact->session->hsubject;
-action.rcptto=rcpt;
-action.resp=resp;
-if (sql_mngact(contact->sqlptr,&action)==false)
- (void) rou_alert(0,"%s unable to store report within database (bug?",OPEP);
-(void) eml_transmit(contact,true,"%s",info);
-resp=(char **)rou_freelist((void **)resp,(genfree_t)rou_freestr);
-report=rou_freestr(report);
-va_end(args);
-
-#undef OPEP
-}
-/*
-\f
-*/
-/************************************************/
-/* */
/* Procedure to send a simple SMTP ccommand*/
/* (no need to have the response wording) */
/* */
}
break;
case 7 : //everything ok
- (void) note_rcpt(contact,rcptto,CMDOK,"5.6.6 %s <%s>",detail,rcptto);
+ (void) note_rcpt(contact,rcptto,CMDOK,"5.6.7 %s <%s>",detail,rcptto);
success=true;
break;
default : //SAFE guard
CHARACTER SET utf8;"; \
) | sudo mariadb -q
@ cat mailleur.mysql | mariadb -q mailleur;
- @ cpp -P -DMYSQL datatest.sql | mariadb -q mailleur;
- @ cpp -P -DMYSQL popul.sql | mariadb -q mailleur;
+ @ cpp -P -DMYSQL \
+ datatest.sql | mariadb -q mailleur;
+ cpp -P -traditional -DMYSQL \
+ popul.sql | mariadb -q mailleur;
@ echo "MYSQL database ready"
echo " ENCODING='UTF8';"; \
) | psql -q -U postgres template1
@ cat mailleur.postg | psql -q mailleur;
- @ cpp -P -DPOSTGRESQL datatest.sql | psql -q mailleur;
- @ cpp -P -DPOSTGRESQL popul.sql | psql -q mailleur;
+ @ cpp -DPOSTGRESQL \
+ -P \
+ -traditional \
+ datatest.sql | \
+ sed -e"/^\/\//d" | \
+ psql -q mailleur;
+ @ cpp -DPOSTGRESQL \
+ -P \
+ -traditional \
+ popul.sql | \
+ sed -e"/^\/\//d" | \
+ psql -q mailleur;
@ echo "POSGRESQL database ready"
ndbpostg:
-//------------------------------------------------------------------
+
+//X------------------------------------------------------------------
//include file to ajuste result according database
-//------------------------------------------------------------------
+//Y------------------------------------------------------------------
#ifdef POSTGRESQL
#define ADDTIME(adding) 'adding'
#define CONCAT(A,B) A||B
INSERT INTO emails (email,password) \
values ('user1@mailleur.example.com','user1');
-//Set for system iwith Postgresql database
+//Set for system with Postgresql database
INSERT INTO emails (email,password) \
values ('user1@posdb.example.com','user1');
INSERT INTO emails (email,password) \
INSERT INTO remotes (remoteip,credit,lastscan) \
values ('45.197.14.139',-5,now());
INSERT INTO remotes (remoteip,credit,lastscan) \
- values ('213.209.157.107',-5,now());
+ values ('213.209.157.107',-5,now()+ADDTIME(200 day));
INSERT INTO remotes (remoteip,credit,lastscan) \
values ('122.175.193.134',-5,now());
INSERT INTO remotes (remoteip,credit,lastscan) \
$date=$action['creation'];
$reverse=$action['reverse'];
$smtpfrom=$action['smtpfrom'];
- $emailfrom=$action['emailfrom'];
- $emailfrom=htmlspecialchars($emailfrom,ENT_QUOTES);
$recipient=$action['rcptto'];
+ $emailfrom=htmlspecialchars($action['emailfrom'],ENT_QUOTES);
$subject=$action['subject'];
+ if (($subject==NULL) || (strlen($subject)==0))
+ $subject=$action['info'];
+ //generating the table contents
$line=$line."<TR>\r\n";
$line=$line."<TD align=left>$count $status</TD>\r\n";
$line=$line."<TD align=left>$date</TD>\r\n";
$line=$line."<TD align=left>$reverse</TD>\r\n";
$line=$line."<TD align=left>";
- $line=$line."$emailfrom<BR>";
- $line=$line."<FONT SIZE=-1>$smtpfrom</FONT>";
+ $line=$line."$smtpfrom<BR>";
+ $line=$line."<FONT SIZE=-1>$emailfrom</FONT>";
$line=$line."</TD>\r\n";
$line=$line."<TD align=left>$recipient</TD>\r\n";
$line=$line."<TD align=left>$subject</TD>\r\n";
$line=$line."</TR>";
+ //end of generation
$count++;
}
sql_close($dbsql);