R:250-SIZE 52428800
R:250-8BITMIME
R:250 ENHANCEDSTATUSCODES
-S:MAIL FROM:<jmrcpn@gmail.com> SIZE=2958
-R:250 2.1.3 jmrcpn@gmail.com sender ok
+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 2.6.4 Address accepted <user1@mailleur.example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
D:Subject: (feed008) sending email to local only
-D:From: Maitre Post <postmaster@example.com>
-D:To: Maitre WEB <webmaster@example.com>
+D:From: A Nobody <nobody@gmail.com>
+D:To: A simple very local user <user1@mailleur.example.com>
D:
-D:.single dot, next is an empty line starting with a '.'
-D:.
-D:This email is sent to 3 domain X 1 users
+D:this ia an email "from" gmail.
+D:test text text
D:
C:.
#-------------------------------------------------------------------------
/* Procedure to extract IPs from an hostname */
/* */
/********************************************************/
-PUBLIC char **dns_get_ip_list(char *hostname)
+PUBLIC char **dns_get_ip_list(const char *hostname)
{
char **iplst;
phase=999; //No domain (Bug?)
break;
case 1 : //getting MX list
- if ((dns=dns_getmx(domain))==(MXTYP **)0)
- phase=999; //domain without MX?
+ if ((dns=dns_getmx(domain))!=(MXTYP **)0)
+ phase++; //Ok, we have an MX list
break;
- case 2 : //establishing MX IP
+ case 2 : { //what is the domain IP
+ char **ipl;
+
+ if ((ipl=dns_get_ip_list(domain))!=(char **)0) {
+ MXTYP *mx0;
+
+ ipl=(char **)rou_freelist((void **)ipl,(genfree_t)rou_freestr);
+ mx0=(MXTYP *)calloc(1,sizeof(MXTYP *));
+ mx0->preference=0;
+ mx0->mxname=strdup(domain);
+ dns=(MXTYP **)rou_addlist((void **)dns,(void *)mx0);
+ }
+ else
+ phase=999; //no MX, no IP!
+ }
+ break;
+ case 3 : //establishing MX IP
status=dns_remote;
if (afns==(AFNTYP **)0) //No local IP?
phase=999;
break;
- case 3 : //checking best MX with local interface
+ case 4 : //checking best MX with local interface
while (*afns!=(AFNTYP *)0) {
_Bool ismx;
extern BLKTYP **dns_addblklist(BLKTYP **blklist,char *entry);
//Procedure to get a list of IP related to a hostname
-extern char **dns_get_ip_list(char *hostname);
+extern char **dns_get_ip_list(const char *hostname);
//Procedure to get ONE SPF entry within domain dns
extern char *dns_getspf(char *domain);